Page 1 of 1

Creating a water counter plugin

Posted: Thursday 04 April 2019 23:20
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!

Re: Creating a water counter plugin

Posted: Tuesday 16 April 2019 18:33
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!

Re: Creating a water counter plugin

Posted: Wednesday 17 April 2019 11:29
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/

Re: Creating a water counter plugin

Posted: Thursday 02 May 2019 17:37
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.