Home automation / smartness: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
mNo edit summary |
||
Line 1: | Line 1: | ||
Line 5: | Line 7: | ||
===Reducing HA database size=== | |||
<!-- | |||
Most of that comes from the recorder service. | |||
So '''don't record so much'''. | |||
'''You can disable recording some things some config''' | |||
: because if you leave that on, it will just grow again later), and you can remove it from the database | |||
: people on limited hardware may prefer minimizing this | |||
and/or | |||
'''You can tell it to clean up regularly''' | |||
You can put HA's recorder.purge_entities service on a regular timer. | |||
It lets you keep different lengths of history | |||
from different domains (e.g. few care about long term record from device_tracker (), sun (sunrise and sunset times), weather) | |||
and/or from different specific entitiesg. care a more about it's more entity-specific. | |||
"but what's actually using that space?" | |||
If you're comfy with shells, you can find and open the database {{inlinecode|sqlite3 home-assistant_v2.db}} and do a query like {{inlinecode|<nowiki>SELECT states_meta.entity_id as Entity, count(states.metadata_id) as Count FROM states INNER JOIN states_meta ON states.metadata_id = states_meta.metadata_id GROUP BY states.metadata_id ORDER BY count(states.metadata_id) DESC LIMIT 40;</nowiki>}} | |||
(doing a {{inlinecode|.mode column}} first makes it a little more readable) | |||
--> | |||
Latest revision as of 15:43, 26 February 2024