Xiaomi Zigbee Power Socket - incorrect wattage reported + voltage missing
The problem
Upon updating to 2022.10.5, I have found my Xiaomi Zigbee power sockets are over-reading by a factor of 10x (i.e. if it’s got a 200w load, the Electrical_measurement entity reports a 2000w load). I checked the update history/logbook, and this started immediately after the update:

I posted about this issue on the HASS forum, where another user with the same issue has mentioned that the Analog_Input entity is reporting the correct load.
https://community.home-assistant.io/t/resolved-xiaomi-zigbee-power-socket-readings-off-by-a-factor-of-10-since-2022-10-5/479901

Please let me know what log(s) I can supply to help diagnose this - it appears nothing is actually broken, just the values are messed up - so no "errors" to speak of. A few values (per my screenshot above) are showing zero or unknown, but as far as I know these have never worked so not too concerned with them.
What version of Home Assistant Core has the issue?
2022.10.5
What was the last working version of Home Assistant Core?
2022.10.4
What type of installation are you running?
Home Assistant OS
Integration causing the issue
Zigbee Home Automation
Link to integration documentation on our website
https://www.home-assistant.io/integrations/zha/
Diagnostics information
No response
Example YAML snippet
No response
Anything in the logs that might be useful for us?
No response
Additional information
No response
Hey there @dmulcahey, @adminiuga, @puddly, mind taking a look at this issue as it has been labeled with an integration (zha) you are listed as a code owner for? Thanks!
Code owner commands
Code owners of zha can trigger bot actions by commenting:
-
@home-assistant closeCloses the issue. -
@home-assistant rename Awesome new titleChange the title of the issue. -
@home-assistant unassign zhaRemoves the current integration label and assignees on the issue, add the integration domain after the command.
(message by CodeOwnersMention)
zha documentation zha source (message by IssueLinks)
Please provide the diagnostic file for the device
Here we go:
zha-46fe7b31ea62ed5e098dba718dd938f4-LUMI lumi.plug-102d28dee141a9638a847279e0acba83.json.txt
Potentially related to: https://github.com/zigpy/zha-device-handlers/pull/1656
@amit-nz can you go to the device page and reconfigure the device please?
FYI, if reconfiguring doesn't work (it should), you can either read the ac_power_divisor attribute on the ElectricalMeasurement cluster (and new reports will be correct again):

Or re-pair the plug to fix the issue. That should also add the voltage measurement and the total energy consumption now (which integrates with the HA energy dashboard).
@dmulcahey no go on reconfigure, but @TheJulianJES's solution to read the ac_power_divisor attribute has worked, wattage now reported correctly, but no voltage. That is not a big deal for me. I will re-pair them later on as I'd like to get them integrated into HA's energy dashboard, but for now this is sufficient. Thanks for your assistance.
Ok I’ll look at the reconfigure part.
Fixed by rejoining the device. Enhancements may be made in the future to prevent this.