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.63k stars 30.78k forks source link

History Stats Sensor creates wrong data #128458

Open Loader23 opened 4 weeks ago

Loader23 commented 4 weeks ago

The problem

Hi, my history stats sensor is not working correctly. Iam having this Issue since 2 Years and could work around it with an old custom integration of history stats. Now the HA Log says: _TIME_HOURS was used from historystats, this is a deprecated constant which will be removed in HA Core 2025.1 So I thought it would have been fixed by now, but thats not the case:

History

As soon as I activate the Switch it goes from 0 to over 400.000.

What version of Home Assistant Core has the issue?

2024.10.2

What was the last working version of Home Assistant Core?

June, 2022

What type of installation are you running?

Home Assistant Container

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

sensor:
  - platform: history_stats
    name: Test History
    entity_id: switch.stecker_1
    state: 'on'
    type: time
    start: '{{ 0 }}'
    end: '{{ now() }}'

Anything in the logs that might be useful for us?

No response

Additional information

No response

home-assistant[bot] commented 4 weeks ago

history_stats documentation history_stats source

turbobas commented 3 weeks ago

I have the same problem after upgrading to 2024.10.2