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.02k stars 31.05k forks source link

`history_stats` sensor not updating in core-2024.1.0 #107241

Closed danps1 closed 6 months ago

danps1 commented 10 months ago

The problem

Since updating to core-2024.1.0 my history_stats sensors do not seem to be updating correctly.

I have several that have worked for (literally) years. One example is a sensor that tracks usage of my pool Chlorinator, so that it can automatically be turned off once a threshold is reached. Here is the YAML for the sensor...

- platform: history_stats
  name: Chlorinator time today
  entity_id: binary_sensor.chlorinator_running
  state: "on"
  type: time
  start: "{{ now().replace(hour=0).replace(minute=0).replace(second=0) }}"
  end: "{{ now() }}"

And here is a graph showing the incorrect behaviour...

977C5059-B1E9-4830-B839-76CA0865B23F_4_5005_c

I first noticed this morning after the chlorinator had been running for approx. 2hrs that the sensor was show 0, so I restarted HA, and it seemed to come good (as you can see in the graph). Later in the afternoon I checked it and the value was "frozen" again, so another restart, and it then came good again.

Not other change to these sensors other than the core update.

What version of Home Assistant Core has the issue?

core-2024.1.0

What was the last working version of Home Assistant Core?

core-2023.12.5

What type of installation are you running?

Home Assistant OS

Integration causing the issue

history_stats

Link to integration documentation on our website

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

Diagnostics information

No response

Example YAML snippet

- platform: history_stats
  name: Chlorinator time today
  entity_id: binary_sensor.chlorinator_running
  state: "on"
  type: time
  start: "{{ now().replace(hour=0).replace(minute=0).replace(second=0) }}"
  end: "{{ now() }}"

Anything in the logs that might be useful for us?

No response

Additional information

No response

home-assistant[bot] commented 10 months ago

history_stats documentation history_stats source

RedNo7 commented 9 months ago

This may be a different symptom of #110620

issue-triage-workflows[bot] commented 6 months ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.