- Install HACS for Home Assistant
- Navigate to HACS Store
- Search for "Clean up your snapshots"
- Install
- Restart Home Assistant
- Generate a Long Lived Token
- Navigate to your profile page.
- At the bottom of the page you will see a section called Long-Lived Access Tokens.
- Click create.
- In the pop up give your token a name.
- Copy the token from the following pop up This will not be saved anywhere so put it somehwere you can find it again
- Copy resulting token input this in configuration.yaml:
clean_up_snapshots_service:
host: {{the url to access your homeassistant instance}}
token: {{Long-Lived Access token}}
number_of_snapshots_to_keep: 3
- Restart Home Assistant
- Look for the new clean_up_snapshots_service.clean_up Services in services.
You can trigger this service in an automation similarly to the one below.
alias: Daily snapshot clean up
initial_state: 'on'
trigger:
platform: time
at: '03:00:00'
condition:
action:
- service: clean_up_snapshots_service.clean_up
# Data is optional if you have defined the number of snapshots to keep in the configuration.yaml.
# data:
# If this property is passed to the service it will be used regardless of what you have in the configuration.yaml
# number_of_backups_to_keep: 7