Size of Home Assistant Database and Predbat

3 comments started 2024-10-25 last 2024-10-26
Home AutomationHome Assistant
L
#1 Leeshore

At the moment my home assistant database is 1.4GB. I have started using recorder in configuration.yaml and increased commit_interval to 30. Purge_keep_days is 9. I have started to exclude some domains and entities etc. Which of the predbat entities is it safe to exclude from recorder as they seem to be taking up quite a bit of the database? I have so far excluded the following domains: automation, binary sensor, input number, select, switch, update with no issues. Can you exclude the 'predbat' domain? I presume if you leave just the sensor domain then that will keep the PV info.

G
#2 geoffreycoan

Leeshore

I have an answer to your question, but it is a really long answer that I have been working on for weeks as I've been through all the givtcp and predbat sensors and learnt a lot about how they fill the database! Unfortunately I'm not quite ready to publish it yet, sorry!

In short, reducing your purge_keep_days to something sensible is the first key step. I have mine set to 14 days but I have then a rich set of recorder excludes, sensors being disabled, sensor rewrites (to store less state data) and sensor purges.

If you exclude the entire predbat domain then some of the graphs and some of the cumulative sensors will stop working, so I'd advise not doing that.

Just to whet your appetite, I've managed to get my HA database down from 2.7Gb to 400Mb. I haven't quite finished so I want to hang off publishing what I've done until I get to the end.