core: History Stats doesn't work
The problem
Since the update to 2022.5 the history stats integration doesn’t work properly. The first day it counted up time constantly regardless of the state of the entity_id. After midnight it stopped counting completely. When I restart HA it is updated the first minutes. Then it stops again.
What version of Home Assistant Core has the issue?
2022.5.3
What was the last working version of Home Assistant Core?
2022.4.x
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: heatpump_compressor_today
entity_id: binary_sensor.heatpump_compressor_state
state: "on"
type: time
start: "{{ now().replace(hour=0, minute=0, second=0, microsecond=0) }}"
end: "{{ now().replace(microsecond=0) }}"
Anything in the logs that might be useful for us?
Nothing in the logs
Additional information
No response
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 21 (10 by maintainers)
Commits related to this issue
- Prevent history_stats from rejecting states when microseconds differ - history_stats ignores microseconds but it was not doing it for state_changed events Fixes #71593 — committed to bdraco/home-assistant by bdraco 2 years ago
- Fix history stats not comparing all times in UTC While its been like this for a long time https://github.com/home-assistant/core/blob/5df747276f3a1b787c24b3225c457ca55bb5c84d/homeassistant/components... — committed to bdraco/home-assistant by bdraco 2 years ago
@unwasted Its in 2022.6.2 via https://github.com/home-assistant/core/pull/73040