Page 1 of 1

Get Kwh value from computed energy counter

Posted: Thursday 08 December 2022 15:19
by pjsgsy
Hi,

In Lua, I am trying to retrieve the KwH number for a simple cost calculation, but I just can't figure out how to!
chrome_yUe0grMjIo.jpg
chrome_yUe0grMjIo.jpg (15.54 KiB) Viewed 739 times
If I look at otherdevices_svalues["NormalTariff"], I get 2 values. 1 is the current energy usage, the other is a number that seems to bear no relation to kwh used.

Can someone point me in the right direction? I am assuming I am looking in the wrong place, or the kwh is somehow derived from that second value?

Thanks.

Re: Get Kwh value from computed energy counter

Posted: Thursday 08 December 2022 17:12
by roblom
2 is probably total energy consumption while you expect total energy consumption of today.

Maybe you can try using DzEvents.

https://www.domoticz.com/wiki/DzVents:_ ... counter.29

Re: Get Kwh value from computed energy counter

Posted: Thursday 08 December 2022 21:32
by pjsgsy
Thanks. The simple lua script did some other things too, but I managed to re-code it in dzvents and retrieve the value with .WhToday