Statistics and history do not work

Statistics stopped working on my Hamston server. Everything works well but the statistics always show empty. I don’t know when this happened because the server is working well and I didn’t go there. server. Everything works well but the statistics always show empty. I don’t know when this happened because the server is working well and I didn’t go there.


Would start with ’ show more’ and select bigger period. Then probably pinpoint when it started. If nothing show, your db might be gone/corrupted. If there is a point where it still was available, there might be recorder changes happened

No data

Try restart core

Can you see any current entity values e.g. under the dev tools > states view?

Home Assistant uses its database for history and stats, but can run fine without a recorder config section (but there always will be a DB).

You said you didn’t access the server, but check whether you see a DB file (if you use the default SQLite DB) and have a recorder section in your config.

Yes, the state of all sensors shows correctly (see photo) I use a recorder and MARIA DB. Everything is fine there too (see photos) I will be grateful for any clues




I read the date base written in the file home- “assistant _ v2.db”
In this file I have a mistake!
But I don’t understand what to do with it
Help me

After cleaning the file from the error, it remains clean. But there should be SQLite entries here?

That is a binary file, you can’t edit it like that. If you want your history back, you’ll need to restore that file from a backup. Otherwise delete the file, restart HA and it’ll create a new empty one.

If you edited your .db with a text editor, your f*ed up. Try to restore your backup.

2 Likes

I recovered from the backup. But how do I solve my underlying problem. History is not written in any way? MARIA DB server works well. Here’s a photo. The RECORDER line too " recorder:
db_url: mysql://vad:rex330@core-mariadb/homeassistant?charset=utf8mb4 "


In statistics, he writes that my RECORD is disabled. But this is not the case. The configuration file says "recorder:
db_url: mysql://vad:rex330@core-mariadb/homeassistant?charset=utf8mb4

I thank everyone who helped. Problem solved! I prescribed all inclusions and dependencies in the recorder. The whole story worked. I can’t understand why it didn’t work without these include ?