Page 1 of 1

Working on python plugin for Aduro H1 wood-pellet stove

Posted: Saturday 03 December 2022 19:24
by brjhaverkamp
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

Re: Working on python plugin for Aduro H1 wood-pellet stove

Posted: Sunday 04 December 2022 13:01
by brjhaverkamp
Hi all,

I am still stuck at point one of my earlier post:
Getting the switch to flip in the dashboard.
The documentation on https://www.domoticz.com/wiki/Developin ... hon_plugin is not entirely consistent, as it is in transition from Domoticz to DomoticzEx I guess. But I figures out that Devices[Unit] should be Devices[DeviceID].Units[Unit].

I think I miss the update() command in the plugin.py onCommand callback.
Currently (for test/debug purposes it looks like this:

Code: Select all

 def onCommand(self, DeviceID, Unit, Command, Level, Color):
        Domoticz.Log("onCommand called for Device " + str(DeviceID) + " Unit " + str(Unit) + ": Parameter '" + str(Command) + "', Level: " + str(Level))
        print(Devices[DeviceID].Units[Unit])
        Devices[DeviceID].Units[Unit].nValue=1
        print(Devices[DeviceID].Units[Unit])
        Devices[DeviceID].Units[Unit].Update(nValue=1,sValue="Test")

I am able to set the nValue,(as I verify with the print statement) but that doesnt update the switch as I expected.
Can anyone help, point,suggest or advice me here?

I added the full plugin.py as attachment. Still not much to see there, But it might help.
Regards,

Bert Haverkamp