Python create water sensor

Python and python framework
Post Reply
jeroenb42
Posts: 8
Joined: Wednesday 09 May 2018 10:36
Target OS: Raspberry Pi
Domoticz version:
Contact:

Python create water sensor

Post by jeroenb42 » Thursday 11 October 2018 11:09

I have been working on updating the Homewizard plugin created by @Wobbles (I have an energylink which his code does not yet cover) and I am trying to add a water sensor. I have seen images of people who have a water meter in Domoticz with an indication of liter. I've managed to create a counter that has an m3 measure but I want to have is liters. How can I do that? And more importantly, how can I do that in Python.

What I have is this:
Domoticz.Device(Name="Water Day", Unit=self.water_today_id, TypeName="Counter Incremental", Image=11, Switchtype=2).Create()

It creates what I want except for the liter indication. Any way I can either change that after I create it or create it correctly right away?

@Wobbles, once I have a stable update, I will share it with you. Can you send me a PM with your email address so we can chat?

jeroenb42
Posts: 8
Joined: Wednesday 09 May 2018 10:36
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Python create water sensor

Post by jeroenb42 » Saturday 13 October 2018 13:20

I got my own question answered so I thought I would share the results.

The homewizard has 2 water values (at least in my case), waterflow and water usage. I created the sensors using the following code:

Waterflow
Domoticz.Device(Name="Water", Unit=self.water_id, TypeName="Waterflow").Create()

Water usage in liters
MyOptions = {"ValueQuantity":"Volume","ValueUnits":"liters"}
Domoticz.Device(Name="Water Day", Unit=self.water_today_id, Type=113, Switchtype=3, Options=MyOptions).Create()

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest