Incremental counter - daily usage via LUA

Moderator: leecollings

Post Reply
lamama1234
Posts: 14
Joined: Tuesday 17 October 2017 9:02
Target OS: Windows
Domoticz version:
Contact:

Incremental counter - daily usage via LUA

Post 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 716 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
User avatar
waltervl
Posts: 5720
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Incremental counter - daily usage via LUA

Post 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
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 1 guest