Creating a water counter plugin
Posted: Thursday 04 April 2019 23:20
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!
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!