I currently have data retention set to around 2000 days, without an external database. (Weather data)
I went today to export a few years of values, and found that the data now only goes back two years in history.
Is there something I’ve missed in the data cleanup setup?
I’m aware that I should have arranged an external database, I just hadn’t got around to it.
You will find out either when it’s so slow that it would be quicker to get up and turn the light on rather than voice it, or it crashes and the data base corrupts proving you system was slower than it should have been and you were annoyed for years and got nothing out of it.
Trying to be a bit of a therapist here, I find it very therapeutic to delete my database about once a year. If you delete it it will build nice and fresh and be quick again. It’s VERY liberating, trust me. It’s a personal opinion, but I highly recommend it.
I appreciate the insight! Those are indeed sage words.
I think my plan now is to get it dumped down, and move on.
Or at least look into pruning old data to longer intervals (which I think HA brought in a while ago, but I never got around to looking at it).
home-assistant_v2.db
Yup, that is your database.
I usually rename it, then I restart and it rebuilds.
when I’m certain all is working again, I delete it.
Graphs and things will start from that moment in time
I don’t have any, but if you have automation’s that look at history they may be confused for a while.
Make sure you have a backup and know how to restore it…
Anyone who’s been on here a while knows what I’m going to say…
You mention wanting years’ worth of temperature readings to use outside of HA.
So, why not just save them directly to a flat .csv or .txt file instead of trying to pull them out of the Recorder database?
HA is great at handling real-time data. But IMHO the Recorder database isn’t really optimized for long-term or archival data. And HA is not the most robust data analysis tool out there.
I run some automations which append one line of data to a given file each time the state of an entity changes, and others which append one line daily or monthly. These files are copied to my NAS as part of my regular HA backup strategy, and I can reference them from any device on my network to analyze, review or otherwise make use of the data, using the proper tools for whatever job I want them for.