how to read "electric" values from smartplug

Xiaomi, Ikea TRÅDFRI, Philips Hue and more.

Moderator: leecollings

Post Reply
manjh
Posts: 731
Joined: Saturday 27 February 2016 12:49
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: NL
Contact:

how to read "electric" values from smartplug

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

Re: how to read "electric" values from smartplug

Post 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.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
manjh
Posts: 731
Joined: Saturday 27 February 2016 12:49
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: NL
Contact:

Re: how to read "electric" values from smartplug

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

Re: how to read "electric" values from smartplug

Post by waltervl »

Search in the dzvents subforum for WhToday and you find loads of examples like viewtopic.php?p=184677&hilit=Whtoday#p184677
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
HvdW
Posts: 539
Joined: Sunday 01 November 2015 22:45
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.2
Location: Twente
Contact:

Re: how to read "electric" values from smartplug

Post by HvdW »

What about domoticz.devices('nameOfYourDevice').dump()
It will show everything you can extract in the log.
Bugs bug me.
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests