Then what happens???
Ha should create a new, automatically / same as it does if it for some reason get corrupted, or are ālockedā by an external-connection
PS: i did asked you several times about your Backup-files ā¦ Do you know where they are, if they are on your SD-card, how much space they take ? etc. ?
hey sorry, i missed that abojt my back up files
i only backed up to my sd card on the pi
pretty new to all thisā¦
anyway i have deleted the database. now to try and make things better!
Anyway, the Back-up files HA does during āUpdatesā would probably only give you a few GB free ā¦ But donāt forget to order that SSD, ā¦ now you have some time, when your DB starts from scratch
i found one actually, just need to format it, thank you sooooo much!
all this is way over my head, but fun and painful lol
Great discussion. This should be required reading for all new users. You need to wrap your mind around the Recorder and backups or youāll shoot yourself in the foot. The recorder, left at the defaults, will quickly consume all the disk space available. Backups are useless if they only reside on the same drive (be it SD, SSD or whatever) as HA.
And then thereās that repack option in the UI. Itās easy to miss the fact that you need to take TWO actions in order to perform that operation:
Anyway, deleting the database and starting over is a good strategy. And of course you need to re-start HA to get the new Recorder exclusions recognized.
The āDays to keepā option, does this purge the Energy data also? I guess that data is something one wants to keep! So one should know what he/she is doing.
No, energy dashboard data if correctly configured are kept despite the number of days configured for recorder purgeā¦
I can confirm that the data are kept even if you donāt correctly configure the energy dashboard. My Statistics table continues to grow without regard to the Recorder purge days. Since I never set up any Energy stuff, I donāt use these data. Deleting old statistics records is one of the steps I perform during my routine database clean-up. Last time I did this, I deleted over 12,000 rows from the Statistics table (this was about a month after the previous clean-up.)
Hi Tom,
yeah you really should try my strategy, its working really well.
I did a lot of reading in forums and redit, and i find this way really efficient.
At 27 december 2021 i lost my db, so i started over, and iām impressed how less space it takes now.
for the back-ups iām using this add-on
It works well, i create daily backups to my nas, and i only need to delete them manually in HASS after a week.
regards
Iām glad youāve got a Recorder exclude strategy and a backup strategy that work for you. I think those are the two most important things to get right for a reliable HA implementation.
A couple of minor points for anyone reading this:
The Samba backup add-on and the Google Drive backup add-on are fantastic tools. Theyāre well written, well documented and well supported. BUTā¦ neither one will create a backup on another platform. Both use the native HA process to create the backup on the media HA is running on, then copy it elsewhere.
This distinction is important if youāre concerned with space (or I/O) on the media, for example, if youāre running HA from an SD card.
Deleting the HA database is something every new user should experience. It sounds scary, but all you lose is a few days of history about when entities changed state. Unless youāre using long-term statistics (which I donāt believe HA is the best tool for anyway) you should be comfortable doing this.
The good news is, once your HA environment starts to mature you shouldnāt need to delete the database. You can keep it lean and efficient, you can back it up, and you can purge and repack it. Again with the exception of long-term statistics, which Iām hoping some day will be added to the Recorder: Purge
service so we wonāt need to off-load the database and manually run SQL against it.
Yes, there are some āRe-fining UIā there needs to be done(in my opinion), for new and average users to feel ācomfortableā in using HA ā¦ I.E āDeveloper Toolsā , im not a Developer(what should i do in there ?) , thou i do have some(quite more than average) IT experience, ā¦ but still for more than few month i hardly looked in there(no descriptions, no guide, no links to guides) , at-least they could rename it to Tools, and then with a āshortā description, and place a few āotherā tools, that you actually find āhere and thereā or link to same
( Call services ?, i havenāt set up any services ā¦ States ? , ok thatās probably just about how the system is doing right now ā¦ Templates, GEE , get me out of here ! , % set json relative state_attrā¦ Events: ??? ā¦ ok at-least there are links there, last 2(if people are not already confused!, or in despair ) Statistics , ok it looks empty, what a relief
I.E Tools could included an āoverviewā of DB-size, filesystem-size logfile-size etc. + List of above āToolsā And other āeasy to useā tools ā¦ i know Add-ons, backups and Supervisor, under Configuration Tab, maybe move Tools in there as well, so itās not taking up āspaceā in the side menu
I am so far out of my comfort zone here, but have you looked at an automation to call recorder.purge_entities
once a day? Or just recorder.purge
?
I have a flow in Node Red that purges my database every seven days using the call-service node and the home-assistant_v2.db
file never goes over 1gB.
Or, I could be on a different planet altogetherā¦
I have my āRecorderā under control, and yes as it is a service, it could be called in various ways, in automation, click on a button, or what ever people like, or feel comfortable with, im not requesting anything, as i adapt to the options available, but yes eventually i might end up in a situation where i also āneedā an automation, at-least for a ārepackā function ā¦ once per month, as it doesnāt seems like ārepackā in sqlite, is a ādefaultā procedure(which it should be in a āin app controlled dbā ) in my opinion (not after every purge of single entities, but weekly/monthly, whatever) ā¦ but your automation example is definitely something to look into, for people who have problems keeping their Recorder/DB under control
There are options to set 7days purge, in HA , calculating DB size is another story, but doable , preferably after a repack ā¦ thou there are no options to āselectā i.e exclude for specific entities( i actually dont know), but that means you have to include t.ex. 597 out of 600 in a script, or an " IF NOT "clause
EDIT:
Seems like im wrong, there is someone that āfixedā this ā¦ havenāt tried thou ( Maybe thatās the āapply_filterā function (with āmissingā examples, and a weird description) for ordinary people to understand )
PS: Just did yet another manual āRepackā , 2 days since last , gained +50MB , just for past 2 days purge(set to keep_30)
Yes, this has crossed my mind several times. In addition to the purge options, the Recorder service has Disable
and Enable
options. I think that means you could stop recording any new data while your automation is doing the purge and/or repack on some schedule.
I havenāt tried it yet, since at the rate HA updates come out, Iām always shutting HA down for maintenance at least once a month, and much more often if Iām making changes. I figure itās safer to do the DB cleanup while Iāve got HA down for some other reason anyway.
Well, i never use purge.
The thing is when i use purge does all my energy data get lost ?
Without purge my db is above the 350mb from 29th december 2021
Be careful with recorder, the energy dashboard data is stored using recorder so if you suspend the recorder and use the energy dahsboard, you could loose data I think. I discovered it because I changed my strategy for recorder data: I moved from a mix of include/exclude to include onlyā¦
So I have in the include:
- all the entities documented in the energy dashboard (if not included, you will have a warning in the energy dashboard configuration)
- all my entities displayed using history or mini-graph cards
- all my entities using the āaverage sensorā add-on
Thatās itā¦ This represents: 32 entity and 6 glob entity (mainly from the energy dashboard where my entities are using the same pattern for naming them)ā¦ pretty simple to maintainā¦ and I have tons of entitiesā¦
Using this, my database size was divided by 4ā¦
Depends on, if your āintegrationā comes from your grid/el-provider, or a ālocalā device thing ā¦ i get my consumption/pries from Electricity provider, when i installed it, i got āeverythingā the Provider has ā¦ it took awhile before Energy Dashboard was showing all , as it was about a years consumption , i can purge or dump_db, whatever i like, itās still there
Thou as Didier mention, if you have added your own sensors, that will go in the bin, when purged
Aah ok, just good that i never used it
Well i need to find a way so i can store the full energy dashboard info on something else.
I donāt want it to delete for atleast a year.
regards
yes, im also in the loop of setting up an external DB, for same reasons, my old āwebbserverā system, is partly manual, where i was(still) sitting and type in consumption and other āBillsā etc( in various āFormsā, to get graphs/statistics )