How to keep your recorder database size under control

Same boat here. DB is 75GB and growing. Running Recorder: Purge (7 days) doesn’t seems to work. I’ve excluded several entities/domains that were heavy hitters, but still can’t bring down the DB size. Thoughts?

image

Exclude more entities and events.

I think you have to restart HA for the excludes to get picked up.

The best option is to actually look at the data to see which entities are spamming the database. There are some SQL statements above which will help with that, although you could also just eyeball it in SQLite DB Browser or whatever.

Although not for everyone, another way to minimize the DB size is to limit what’s saved in the long-term statistics tables. Once you’ve identified entities you don’t want to save LTS for, you can exclude them by changing their state_class in customize.yaml:

sensor.1st_floor_temperature_2:
  state_class: none

Read more about state_class for sensor entities here:

I have, but it’s the purge action that doesn’t seem to work.