Get Kwh value from computed energy counter

Moderator: leecollings

Post Reply
pjsgsy
Posts: 26
Joined: Thursday 28 December 2017 20:51
Target OS: Windows
Domoticz version: 3.8153
Contact:

Get Kwh value from computed energy counter

Post 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 737 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.
roblom
Posts: 408
Joined: Wednesday 26 February 2014 15:28
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: the Netherlands
Contact:

Re: Get Kwh value from computed energy counter

Post 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
pjsgsy
Posts: 26
Joined: Thursday 28 December 2017 20:51
Target OS: Windows
Domoticz version: 3.8153
Contact:

Re: Get Kwh value from computed energy counter

Post 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
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest