What the recorder does
Every state change and event goes into the recorder database. That's SQLite, home-assistant_v2.db in the config directory, unless you configure another database. Defaults:
| Setting | Default |
|---|---|
purge_keep_days |
10 days |
auto_purge |
on, every night at 04:12 |
commit_interval |
5 s |
Home Assistant's own docs warn that the write load can hurt responsiveness and the life of the storage medium (SD card).
Symptoms
- Database file of several GB, slow history graphs, long backups.
- Sluggish UI on a Raspberry Pi; SD card failures after months.
Fix
Exclude what you never look at: power meters updating every second, signal strength, uptime counters, "last seen" sensors.
recorder:
purge_keep_days: 10
commit_interval: 30 # fewer, larger writes
exclude:
entity_globs:
- sensor.*_signal_strength
- sensor.*_uptime
entities:
- sensor.power_meter_raw
- Excluded entities no longer have history. Long-term statistics (the energy dashboard, statistics graphs) are separate, so check what you still need.
- Raising
commit_intervalmeans the last seconds of data can be lost on a crash; that's usually acceptable. - Old data only disappears after a purge. Run the
recorder.purgeaction once after changing exclusions if you want space back sooner.
Storage
On a Raspberry Pi, move Home Assistant to an SSD instead of an SD card (see the Raspberry Pi SD-card corruption item). A good power supply matters just as much.