Creating a water counter plugin

Python and python framework

Moderator: leecollings

Post Reply
galinette
Posts: 68
Joined: Monday 11 December 2017 22:57
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Creating a water counter plugin

Post by galinette »

Dear all,

I am making a water consumption meter (counter). The hardware works and I can retrieve the actual counter value in Python. So far so good. I was also already successful in making electrical counter plugins, with "Usage" and "kWh" Typenames.

But I cannot find any documentation about the way to create the device in the python plugin code. I would like to pass the direct counter values (already incremented) to the counter. So this is not an "Counter Incremental" if I understand right. Then I would like Domoticz to display nice usage histograms in the log, as for "Usage" (electric) devices.

1) Which TypeName should I use, or which Type/SubType ? I have tried with TypeName="Counter", I see the device in Domoticz but the icon is missing, and if I set it to "Used" it will never show in Utilities tab (or any other tab).

2) Is it possible to set a display unit? (In my case this would be liters).
Or better, is it possible to set a multiplier such as 0.001 and "m3" unit so that it displays cubic meters instead of the raw value? It seems there is an "Options" parameter that I can pass when creating the device, but it is documented nowhere.

Thanks!
galinette
Posts: 68
Joined: Monday 11 December 2017 22:57
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Creating a water counter plugin

Post by galinette »

Hi,

Any feedback on this? I can't find any exhaustive documentation about device types/subtypes when creating a python plugin. Is there no Water Counter type we can use?

Thanks!
Xorfor

Re: Creating a water counter plugin

Post by Xorfor »

Typename: Waterflow?

or

Type: 243
Subtype: 30

Look at https://github.com/Xorfor/Domoticz-Template-Plugin/wiki
For a dzVents example with screendumps: https://ehoco.nl/waterflowmeter-in-domoticz/
galinette
Posts: 68
Joined: Monday 11 December 2017 22:57
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Creating a water counter plugin

Post by galinette »

Thanks, and sorry for the late reply.

It seems that waterflow has flow only, and does not count the usage.
We are missing a generic kind of instant/counter usage device type, which works as the electrical devices, but where we can set custom units.
Post Reply