All history data flatlines


I’ve upgraded the HA OS to 12.1 (still using HA Core 2024.1.6).

The problem is that all data history is a flat line. Sensors report properly and the automations work fine based on the data provided, but all graphs are a flat line that keeps changing with the sensor reported value like the current value persisted since the upgrade (see example below).

The strange part is also in the logs. E.g. the PIR sensors trigger properly and I see the state change in the logs but only until I refresh the page – as soon as I refresh the page, the PIR reported log disappears…

Any ideas what to do? Thanks

That’s the logbook. A way to represent past data from entries in the database.

Check Settings → System → Logs for database errors.

Thanks, – I found some entries - timestamps are from the backup restore time frame. Nothing from now:

2024-03-17 07:21:38.553 WARNING (Recorder) [homeassistant.components.recorder.util] The system could not validate that the sqlite3 database at //config/home-assistant_v2.db was shutdown cleanly
2024-03-17 07:21:38.593 WARNING (Recorder) [homeassistant.components.recorder.util] Ended unfinished session (id=66 from 2024-02-15 16:11:53.632605)

Your database could be corrupt.

Delete config/home-assistant_v2.db and restart. You will lose all your history data.

If you have data you would like to keep (e.g energy LTS) then search the forum for “database repair” instead.

Thanks! I’ll give the repair a try

Hi, I first attempted to fix the database, but it did not work. Then I deleted the .db file and rebooted the HA. The new .db file was created. Sensors still report the values, but nothing there’s not history info on the graphs. The db file is growing. No errors in the log now. Still no historical values :frowning:
Any other ideas? Thanks!

Do you have default_config: in your configuration.yaml file?

Yes. I’m just poking around with the SQL and this is interesting (in the new DB):

For the record: Layer 8 / human / user error – I have setup the recorder incorrectly. All fixed now. Thanks for attempting to help out, however I was looking in the wrong direction.