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
71.58k stars 29.91k forks source link

History_Stats Log Warning State class 'measurement' #86741

Closed S-Przybylski closed 1 year ago

S-Przybylski commented 1 year ago

The problem

Warning thrown: State class 'measurement' which is impossible considering device class ('duration') it is using. Used Type: Time Is a manual configuration variable available, or is it simply a bug?

What version of Home Assistant Core has the issue?

Home Assistant 2023.2.0b1

What was the last working version of Home Assistant Core?

Home Assistant 2023.1.x

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

2023-01-26 19:35:09.182 WARNING (MainThread) [homeassistant.components.sensor] Entity sensor.heizung_warmwasser_hst_runtime_per_day (<class 'homeassistant.components.history_stats.sensor.HistoryStatsSensor'>) is using state class 'measurement' which is impossible considering device class ('duration') it is using; Please update your configuration if your entity is manually configured, otherwise create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+history_stats%22

Example YAML snippet

- platform: history_stats
  name: heizung_warmwasser_hst_runtime_per_day
  entity_id: binary_sensor.heizung_warmwasser
  state: 'on'
  type: time
  end: '{{ now().replace(hour=0).replace(minute=0).replace(second=0) }}'
  duration:
    hours: 24

Anything in the logs that might be useful for us?

No response

Additional information

No response

home-assistant[bot] commented 1 year ago

history_stats documentation history_stats source

RobertD502 commented 1 year ago

This has been fixed in #86727, but wasn't part of the 2023.2b1 release.

frenck commented 1 year ago

Good catch, this is indeed fixed by that PR (missed it while cleaning up issues).

Closing this one as it is fixed.

../Frenck