I suggest to add to the documentation the exact functioning of the counterToday value of GAS and COUNTER devices. Typically counter devices are updated incrementally, so the total counter value constantly increases over time. The counterToday value is expected to show the increase during the day.
I already found in previous discussions that counterToday cannot be found in the database but it is a computed variable. It was suggested that it is computed as currentvalue minus value at 00:00 hours, but this seems to be only part of the truth. From this statement one might expect the counterToday is automatically reset at 00:00 and then starts to be computed from that moment on, but ....
From my testing: counterToday continues to show the value of the previous day until the first update of the relevant device in the new day. Only then it is reset and the initial value is the newly added value (so indeed currentvalue minus value at 00:00).
Advantage:
* one can make calculations using previous day total even after 00:00 as long as the device is not updated.
Disadvantage:
* if you expect a reset at 00:00 and therefore initial value is 0, then this is not the case. The initial value will be the value of the first update (which might be zero after all if you force an update with 0 increase immediately at 00:00), but until the update it will show the total increase of the previous day.
Am I correct in this analysis?
suggestion: explain counterToday in documentation
Moderators: leecollings, remb0
- waltervl
- Posts: 5148
- Joined: Monday 28 January 2019 18:48
- Target OS: Linux
- Domoticz version: 2024.7
- Location: NL
- Contact:
Re: suggestion: explain counterToday in documentation
Where in the wiki documentation would you expect an explanation? DzVents? Lua?
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
-
- Posts: 621
- Joined: Saturday 21 September 2019 17:55
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2024.1
- Location: The Netherlands
- Contact:
Re: suggestion: explain counterToday in documentation
DZvents.
That is where I am encountering this behaviour. If the same is valid for Lua, then it could be added there as well.
That is where I am encountering this behaviour. If the same is valid for Lua, then it could be added there as well.
Who is online
Users browsing this forum: No registered users and 1 guest