home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
69.71k stars 28.87k forks source link

HomeKit Noise Sensor is not updated (Netatmo Healthy Home Coach) #119617

Open FinemechanicPub opened 2 weeks ago

FinemechanicPub commented 2 weeks ago

The problem

HomeKit Noise sensor is never updated. The support for the noise sensor was added with PR 80889, but apparently it was not a complete solution. The displayed value is never updated, although data is received as seen in diagnostic data and also in debug logs (iid 21):

2024-06-13 16:35:31.007 DEBUG (MainThread) [aiohomekit.controller.ip.connection] 192.168.1.45: raw response: bytearray(b'{"characteristics":[{"aid":1,"iid":8,"value":1},{"aid":1,"iid":12,"value":517.0},{"aid":1,"iid":15,"value":60.0},{"aid":1,"iid":18,"value":25.3},{"aid":1,"iid":21,"value":55}]}')

What version of Home Assistant Core has the issue?

core-2024.6.2

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

HomeKit Device

Link to integration documentation on our website

https://www.home-assistant.io/integrations/homekit_controller/

Diagnostics information

homekit_controller-bfb1e350325a0cf94ae1f386dc129555-Healthy Home Coach-3bb2f696b7b5d4a9de202a4d6266e6f6(2).json

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

home-assistant[bot] commented 2 weeks ago

Hey there @jc2k, @bdraco, mind taking a look at this issue as it has been labeled with an integration (homekit_controller) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `homekit_controller` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign homekit_controller` Removes the current integration label and assignees on the issue, add the integration domain after the command. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


homekit_controller documentation homekit_controller source (message by IssueLinks)

Jc2k commented 2 weeks ago

Which iid is the noise in that log entry? Can you show log entries of it changing?

FinemechanicPub commented 2 weeks ago

The iid is 21. Here is the log (after I turned off TV):

2024-06-13 17:47:31.292 DEBUG (MainThread) [aiohomekit.controller.ip.connection] 192.168.1.45: raw response: bytearray(b'{"characteristics":[{"aid":1,"iid":8,"value":1},{"aid":1,"iid":12,"value":498.0},{"aid":1,"iid":15,"value":59.0},{"aid":1,"iid":18,"value":25.0},{"aid":1,"iid":21,"value":32}]}')

Please also check the attached diagnostic file. I'm not sure, but I think in the lines 354 ("value": 56,) and 501 ("state": "37",) value and state should match.

Jc2k commented 2 weeks ago

How often do you see that iid? Does it ever change?

Jc2k commented 2 weeks ago

Those 2 values should not generally match, thought might by coincidence. We only update the schema data at pairing or on certain events like firmware updates. Some values are incidentally captured then, but they will be stale.

FinemechanicPub commented 2 weeks ago

How often do you see that iid? Does it ever change?

I'm not sure I understand the question. I quoted two log entries (one in the issue description and one in the comment above); both have iid 21 and the value definitely changed. The value in the user interface have never changed since the start of the integration.

What shall I do to collect additional data?

Jc2k commented 2 weeks ago

Sorry I'm on my phone so partial log fragments over multiple messages are a bit hard to piece back together.

So far I think I've only seen poll results. Was expecting to see push notifications. Can you post a more complete log, rather than just one line at a time.

FinemechanicPub commented 2 weeks ago

Here is the log taken after two debug sessions. ha_log.txt

FinemechanicPub commented 2 weeks ago

@Jc2k I have restarted HA and the problem has gone. I still don't understand why I had the problem with the noise sensor while other sensors on the same HHC device worked perfectly from the start. Anyway, thank you for cooperation.

Jc2k commented 2 weeks ago

Is it responding to noise in near real time now?

FinemechanicPub commented 2 weeks ago

Is it responding to noise in near real time now?

It has a delay of about 3 minutes. I'm attaching another log. It starts at the moment I switched on a noise source. I noticed that there are new log entries "[aiohomekit.controller.abstract] callback ev" which I didn't see previously. May it be so, that all other sensors are updated with request-response (polling), and there is a bug preventing noise sensor to do the same (it only updates when the callback is triggered)? ha_log2.txt