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
74.15k stars 31.13k forks source link

Utility Meter may suffer from a race condition during startup #132004

Open noseshimself opened 1 day ago

noseshimself commented 1 day ago

The problem

Depending on the hardware the Home Assistant installation is running I find a number of Utility Meters that are dependant on ESPHome devices in this state:

image

These devices take rather long to come up after a HA reboot (about 30 seconds longer than the gas meter device also connected via ESPhome).

With the sensors in this state all I can do is modify the helper to point to a different input sensor, update it and change it back to the original input sensor. After that procedure for every single utility meter that is not working things are back to normal.

The logs don't show anything regarding the helpers.

What version of Home Assistant Core has the issue?

core-2024.11.1

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

utilty_meter

Link to integration documentation on our website

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

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

I guess I will need some instruction for logging and monitoring Utility Meter during startup.

home-assistant[bot] commented 1 day ago

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

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


utility_meter documentation utility_meter source (message by IssueLinks)

dgomes commented 1 day ago

Utility Meter depends exclusively of the source sensor, there is nothing running in parallel

Most certainly the issue lies on your esphome source that is not updating often, therefore the utility meter will stay unavailable until the source updates.