No matter what I do, I cannot get the system to purge old data from the database.
As per other threads I’ve seen, I’ve placed this in the configuration.yaml file
recorder:
purge_keep_days: 14
purge_interval: 1
And I’ve also placed this in the automations.yaml file
- id: db_purge
alias: Database Purge
trigger:
platform: time
at: ‘1:00:00’
action:
- service: recorder.purge
data:
keep_days: 14
repack: true
I expect the DB to purge daily. I also have a purge DB button available on the UI I can push. But nothing happens. the DB doesn’t get purged and slowly grows till the VM is full an the whole system crashes beyond recovery. A stupid design.
I’m using Hassio and the only way I’ve found is to go in and physically delete the home-assistant_v2.db file which totally clears all history.
Anyway, what am I missing? Even better, is there a way to tell home assistant to keep the DB under a given size rather than a fixed number of days?