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
73.64k stars 30.79k forks source link

Hardware and Template sensors get stuck and don't update #129316

Open basslet opened 2 weeks ago

basslet commented 2 weeks ago

The problem

Since updating from 2024.4.4 to 2024.10.3, I'm experiencing stuck sensors, both for hardware (ZHA integration) and template sensors.

Two examples:

For ZHA, a workaround is to restart the integration. For the template sensor I need to restart HA.

I enabled the ZHA debug log and ran the profiler, none of which indicated any issues. HA is running on a Pi 4.

What version of Home Assistant Core has the issue?

2024.10.3

What was the last working version of Home Assistant Core?

2024.4.4

What type of installation are you running?

Home Assistant Supervised

Integration causing the issue

Sensors

Link to integration documentation on our website

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

Diagnostics information

home-assistant_zha_2024-10-28T09-24-51.332Z.log IMG_0292 IMG_0293

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 @home-assistant/core, mind taking a look at this issue as it has been labeled with an integration (binary_sensor) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `binary_sensor` 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 binary_sensor` 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)


binary_sensor documentation binary_sensor source (message by IssueLinks)

basslet commented 4 days ago

The problem might be in the ZHA Integration. In earlier versions (2024.4), when a state got stuck, e.g. due to a restart or crash, then ZHA would periodically update HA to the correct state. This is no longer happening.

When a ZHA sensor has an incorrect state, it will remain incorrect and not update to the actual state of the hardware.