Page 1 of 1

Incremental counter - daily usage via LUA

Posted: Sunday 07 November 2021 14:49
by lamama1234
Hi,

I have an incremental counter for water usage and I wish to add automation for total amount of daily water usage. The Domoticz utility widget shows both the total amount of water used + daily:
WaterMain.jpg
WaterMain.jpg (18.59 KiB) Viewed 768 times
But when I use LUA's

print(otherdevices_svalues['Water Main'])

I only get this crazy number that even using my water counter divider (450000), doesn't make any sense:

2021-11-07 15:47:00.228 Status: LUA: 18446744073694285637

Is there a way to get via LUA the current daily water usage of my incremental counter?

Using Domoticz 2020.1 stable.

Thanks

Re: Incremental counter - daily usage via LUA

Posted: Thursday 11 November 2021 17:38
by waltervl
Seems not possible in LUA unless like in dzVents you call the datadump Json and get the data out of there. (with /json.htm?type=devices&rid=IDX)

dzVents gets the .counterToday value from the JSON somehow. It is somewhere here https://github.com/domoticz/domoticz/tr ... ts/runtime