Working on python plugin for Aduro H1 wood-pellet stove
Posted: Saturday 03 December 2022 19:24
Hi all,
A few days ago I came across the pyduro python library written by Clement Prevot.
https://github.com/clementprevot/pyduro
This thing allows one to control the Aduro H series of wood and pellet stoves (and hybrids) without the mobile app that works via the cloud.
I own a H1 stove, so I was looking for this opportunity for a few years already.
I am now attempting to write a plugin for domoticz based on this library. First steps are good, but I have 2 questions
1) I cant switch an on/off switch on and off..
This sounds weird, but let me explain.
I created a simple on/off switch unit(device) in plugin.py onStart(self) with
BurnerSwitch = Domoticz.Unit(Name="Burner switch", DeviceID="Aduro", Unit=1, Type=244, Subtype=73, Switchtype=0).Create()
This works nicely and I now have it under devices and in the Switches tab.
By default the switch is off. When I push the button I see a popup with "Switching on". In plugin.py, the onCommand function is correctly triggered.
BUT, the switch doesn't switch on?!? It stays in the Off state. When I push it again, it again pops up the message " Switching on".
What am I missing? Should I do something in onCommand? Or did I make a mistake in the Unit definition?
2) The pyduro library has a function to discover the stove in the local network. It can find the IP address and serial number. Only the pincode then needs to be configured manually. However, autodiscovery can go wrong for many reasons, So I want to be able to edit it manually. My idea was to do the discovery to fill the IP address and serial number with the correct default value in the plugin hardware setup page. But I can't find out how to do that. Can you set the default value of a param field from a python variable? and if so, how?
Lastly if anyone wants to help or has ideas on the plugins functions, let me know. Happy to cooperate and/or discuss.
Regards,
Bert Haverkamp
A few days ago I came across the pyduro python library written by Clement Prevot.
https://github.com/clementprevot/pyduro
This thing allows one to control the Aduro H series of wood and pellet stoves (and hybrids) without the mobile app that works via the cloud.
I own a H1 stove, so I was looking for this opportunity for a few years already.
I am now attempting to write a plugin for domoticz based on this library. First steps are good, but I have 2 questions
1) I cant switch an on/off switch on and off..
This sounds weird, but let me explain.
I created a simple on/off switch unit(device) in plugin.py onStart(self) with
BurnerSwitch = Domoticz.Unit(Name="Burner switch", DeviceID="Aduro", Unit=1, Type=244, Subtype=73, Switchtype=0).Create()
This works nicely and I now have it under devices and in the Switches tab.
By default the switch is off. When I push the button I see a popup with "Switching on". In plugin.py, the onCommand function is correctly triggered.
BUT, the switch doesn't switch on?!? It stays in the Off state. When I push it again, it again pops up the message " Switching on".
What am I missing? Should I do something in onCommand? Or did I make a mistake in the Unit definition?
2) The pyduro library has a function to discover the stove in the local network. It can find the IP address and serial number. Only the pincode then needs to be configured manually. However, autodiscovery can go wrong for many reasons, So I want to be able to edit it manually. My idea was to do the discovery to fill the IP address and serial number with the correct default value in the plugin hardware setup page. But I can't find out how to do that. Can you set the default value of a param field from a python variable? and if so, how?
Lastly if anyone wants to help or has ideas on the plugins functions, let me know. Happy to cooperate and/or discuss.
Regards,
Bert Haverkamp