Smanar / Domoticz-deCONZ

deCONZ plugin for Domoticz (Zigbee application)
GNU General Public License v3.0
36 stars 27 forks source link

kWh not measured for existing counters #131

Closed jgaalen closed 2 years ago

jgaalen commented 2 years ago

I have a bunch of kWh/power plugs and after the update of 8 January, the kWh counter isn't updated properly anymore (updated to 0). I've looked at the code and it has to do with the check that if also power value is received along with consumption, it tried to update sValue as POWER;COUNTER. But before my devices were already added as type 113/counter and those devices doesn't accept POWER;COUNTER. Perhaps make a check that if the existing domoticz device is of older device type, just set the kwh counter in the sValue instead of both values.

I have Blitzwolf plugs which adds the power (watt) value to consumption json but it always 0, so the power value is invalid anyway

Smanar commented 2 years ago

Ha yes, I remember this step. If I m right the more commun widget is the same than you, the 113/counter The other one is enabled only for the model "ZHEMI101"

And after that the code check for "power" and "consumption" presence to update the widget.

So I m seing 3 way.

I think the first method will be the better, unfortunately every time the json is corrected, the widget need to change, and you will loose all your previous values stored in database.

jgaalen commented 2 years ago

With 'widget' you mean 'domoticz device'? At least for this specific case, for the Blitzwolf SHP-15, there are 2 websocket messages received after each other, 1 with power (watt) and one with consumption + power, but power is always 0 so looks like a deconz issue in this case.

I would say, once it's already created it shouldn't recreate it later, because you will loose historical data and idx will be different too. In my opinion, best way would be to match sValues with the existing domoticz device. then it's up to the user to delete the existing device to let a new one be created (it will recreate it immediately as soon as new data comes in or not?)

Smanar commented 2 years ago

With 'widget' you mean 'domoticz device'?

Yep

so looks like a deconz issue in this case

Yep, its WIP, in fact the device display the value, but this one stay at 0, can be removed from the json.

because you will loose historical data and idx will be different too.

Yep, bigger problem for me.

For the moment, I m using the third solution (a second whitelist), as there is only 1 device that have the both values on the same cluster.

You can try the beta branch to see if it's better for you ?


git pull
git checkout beta
git pull
jgaalen commented 2 years ago

Works as expected, great. With the latest beta version the sValue only contains the counter value (with my device). Thanks a lot