No long term statistics shown despite valid state class

Hi, I’m quite stuck. None of my sensors appear to show long term statistics as shown here: History - Home Assistant

My graph just begins 10 days ago without the greyed out long term data.
I checked in developer tools → states and the sensors have state_class: measurement or other valid classes.

For now I have increased the default retention period, but I’d really like to solve this and not inflate my storage indefinitely. I’m sure this worked on other instances of HA I had before.

Thank you for any hints and and please let me know if I can deliver any useful information.

Please provide a specific example, with the sensor state and attributes, and the associated history graph for 10+ days.

Hi Chris,
this is a temperature sensor that has been in use in this installation of HA for more than a year.
It appears to be the same for all sensors.

Thanks!

edit: I’ll add the states screenshot in 4 minutes when I can post again.

Wait, which HA version are you currently on?

The ability to see long term stats in the history was only added a few releases ago.

I am on core 2024.11.2 and operating system 11.5

Are you sure this is new? I would have bet that I was able to look at pretty old data on my last HA setup, even pre 2023. Frankly, I was extremely surprised I only had 10 days of data and thought for sure that I had gone much further back before, also on this install.

But I may simply be mistaken in both cases. Quite unlikely, but I guess it is possible.

I gather there are ways to store data long term efficiently with influx DB and/or victoria metrics, but I haven’t figured that out yet and feel like I am just missing something simple.

Sorry this is wrong, I was looking at the updates available not installed version.
I am on core 2023.10.3 and system 10.5.
Maybe I should update?

2023? If it’s been a year since your last update, then you definitely won’t see the LTS in the UI (but the data will still be there if you restarted HA since you added the state class)

Take a backup, download it somewhere safe & be prepared to read back through 12 months worth of breaking changes, including a dB migration or 2, before you hit the update button

Found it. It was added in 2023.12. Time has flown by this year 2023.12: Welcome home! - Home Assistant

That was it, thank you.
I made a backup, hit update, and fell asleep.
Now it works, even has the old history and everything.

I guess I’d rather be lucky than good :wink:
Time really does fly.

1 Like