I have no recorder specified because the way it is described in the docs is enough for my purposes:
The history is stored in a SQLite database home-assistant_v2.db within your configuration directory unless the recorder integration is set up differently.
Yet now everything gets recorded and the home-assistant_v2.db file is swelling to unhealthy proportions. Even with purging every 6 hours my pi really doesnāt like that. Is there anything iām missing/interpreting wrong? Do i need to specify i recorder entry? Or do i need to include domains first and then include from them? I really only want those two sensors available for a chart card.
Itās on my list to figure some of this out also, I took the other approach and excluded many things, but I have had no luck getting my database to repacked.
You might look first here (notably the query that shows which entities are in there the most) and see if the configuration is actually omitting the other entities. Note that page mentions vacuum which makes deleted rows useful, but the ārepackā that will make it smaller is described here. I have not been able to get it to do anything (no errors, just no repack after I deleted many, many rows). Iād be curious if it works for you.
Thanks, iām not sure if playing around with the db file is helping but i now can 100% confirm that everything is saved. I tried playing around on a backup db file with VACUUM and repack but it didnāt yield anything above saving some kb, though. I think i need to configure the recorder: component to match up with what history does. The docs donāt tell what happens if you do not configure it, i was assuming it just records what i specify in history.
From the recorder docs you linked i think it might be the other way around:
The recorder integration is responsible for storing details in a database, which then are handled by the history integration.
I will check by just adding recorder with my above include settings.
Sorry, I should have noticed that up front. āhistoryā is about graphs, ārecorderā is about what is saved, so put the include/exclude in the recorder.
vacuum does nothing unless items are deleted or purged. And even then it does nothing visible ā it rearranges the internal part of the database so the purged space can be reused, it does NOT change the file size. Repack (a service on recorder) is supposed to change the field size, and give the space vacuum recovered back to the O/S.
If you have entities in the database you do not need you can wait for them to be purged, or use sqlite3 directly to delete them (examples in the recorder documentation).
After delete or purge, vacuum to make the space available to the database.
Then, after vacuum ā if desired but not necessary ā use repack to take the space from the database and give it back to the O/S.
And as I mentioned ā Iāve had no luck getting repack to work, so if you do try it Iād be curious of your experience.
Oh, i didnāt quite understand then about the vacuum/repack. I just deleted the file and let hassio rebuild it. So i think iām outside of the use case for a vacuum and repack. As I just delete the db file if i change something - i guess - you are looking to delete parts (and keep the rest) of db contents. But thanks for the help, i never used sqlite on the cli before and found what i was missing out that way. Teach a man to fishā¦ and stuff