Open antonGritsenko opened 1 month ago
Hey there @dmulcahey, @adminiuga, @puddly, @thejulianjes, 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!
(message by CodeOwnersMention)
zha documentation zha source (message by IssueLinks)
home-assistant_zha_2024-10-08T02-24-56.490Z.zip Full log of the communication with the device
The problem is actually with the quirk. We’ll look into it.
The problem
I'm using ZHA about a year and have a very bad experience about adding a device workflow. I did small research and found out that the same problem causes a lot of custom quirks to be developed that actually are not required.
Now about the issue: when you are adding a device it will be found, correctly recognized and attached to the correct quirk, but you have no sensors at all except one (Firmware Update). But device itself works, you can manually query data using Manage Zigbee device dialog and selecting correct cluster and attribute.
After a lot of testing with different devices I think I have found the main reason: this is connected to the expected measure_value and its limitation. I want to show this on the CO2 sensor, but all other devices usually have pretty the same issue.
Expected value for CarbonDioxideConcentration are between 30 and 900 (btw, why 900?) with multiplier 1e-06, its confirmed by the log:
But device could return something like 0,0006659999999999999 instead 0,000666. I was not able to validate what's responsible for it, is it device itself, gateway or ZHA, but it is as it is. There are no logs about the actual value, but if during the initial setup or during reboot of the HA the device return such weird value then you got this in the log:
and sensor not added to the HA. You may need to do several reboots of the HA to catch the correct value and then, by magic, device adding the sensor.
My suggestion will be to try to detect such values and try to convert it to the expected value. Unfortunately, I was not able to find the code that handling this part, so can't says anything more specific. If someone can point me to the right codebase, I will try to prepare some review and maybe PR.
What version of Home Assistant Core has the issue?
core-2024.9.3
What was the last working version of Home Assistant Core?
No response
What type of installation are you running?
Home Assistant OS
Integration causing the issue
ZHA
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?
Additional information
No response