Page 1 of 1
how to read "electric" values from smartplug
Posted: Sunday 12 January 2025 17:43
by manjh
I have a number of Zigbee smartplugs with energy metering function. They work OK, but I am having a bit of trouble trying to extract values.
When I look at the Domoticz device,, it shows: "Today: 0.310 kWh".
But when I extract the values in a LUA script (using otherdevices), I get "0.0;1280".
What should I do to extract all available info from this device?
Re: how to read "electric" values from smartplug
Posted: Sunday 12 January 2025 21:19
by waltervl
I am not using Lua but dzvents but it seems the 1280 is the total value. With dzvents you can get the today value directly. With Lua I have no idea how to do that, but probably it can be calculated.
Re: how to read "electric" values from smartplug
Posted: Sunday 12 January 2025 22:49
by manjh
waltervl wrote: ↑Sunday 12 January 2025 21:19
I am not using Lua but dzvents but it seems the 1280 is the total value. With dzvents you can get the today value directly. With Lua I have no idea how to do that, but probably it can be calculated.
Ah, that looks promising.
Would you be willing to post the dzvents script to pull the information? Thanks in advance!
Re: how to read "electric" values from smartplug
Posted: Monday 13 January 2025 1:26
by waltervl
Search in the dzvents subforum for WhToday and you find loads of examples like
viewtopic.php?p=184677&hilit=Whtoday#p184677
Re: how to read "electric" values from smartplug
Posted: Monday 13 January 2025 9:59
by HvdW
What about domoticz.devices('nameOfYourDevice').dump()
It will show everything you can extract in the log.