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.03k stars 29.69k forks source link

Hive not recording long term statistics #122228

Open tristanjthompson opened 1 month ago

tristanjthompson commented 1 month ago

The problem

The Hive integration sensors aren't being recorded in long-term statistics

According to the developer long-term Statistics documentation, the sensor must have a state_class of measurement, total or total_increasing.

When I go into Developer Tools > States and check the attributes available on my Hive sensors, they are missing the state_class so I'm sure this is the issue.

What version of Home Assistant Core has the issue?

core-2024.7.3

What was the last working version of Home Assistant Core?

core-2024.7.3

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Hive

Link to integration documentation on our website

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

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

home-assistant[bot] commented 1 month ago

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

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


hive documentation hive source (message by IssueLinks)

tristanjthompson commented 1 month ago

Any update on this?

I tried adding a state_class of measurement by customizing the climate entities in the configuration.yaml to see if that helped, but it didn't.

e.g.

homeassistant:
  customize:
    climate.hallway:
      state_class: measurement
    sensor.hallway_battery_level:
      state_class: measurement

I'm wondering if it's because the climate entity has several measurements on it which would need to have the state_class added to it? Maybe I can't compensate for it with the above config? Or am I being overly simplistic in how I'm checking this and the state_class needs to be 'properly' added in code for the LTS to pick them up.