Repository navigation
Keeping Alerts in Version Control
Alert Redux has no YAML configuration: alerts live in Home Assistant's config entries, and are edited in forms. But they can be exported to YAML and imported back, which gives you most of what YAML configuration did: a file to keep in git, review, share, and restore.
Alert definitions are part of Home Assistant's own configuration, so Home Assistant backups include them, along with their states. For disaster recovery, your usual backups are enough. Export is for the other things: history, review, sharing, and copying.
- From the admin card: Export gives every alert and generator as YAML, to copy or download. Each row's Summary button can also show just that alert's YAML.
-
From Developer tools → Actions:
alert_redux.export, with Return response (optionally withentity_idto export only some; a generated alert gives its generator).
action: alert_redux.export
data:
entity_id:
- alert_redux.garage_door_left_open
- alert_redux.water_leakThe file looks like the recipes in this wiki, with two differences: each definition
has an id (its subentry ID), and notifier groups are named. Settings at their
defaults are left out, so a file shows only what you chose. Notifier groups
themselves, and alerts' areas and labels, aren't exported: create groups and labels
by hand on a new instance.
Export, download, and commit the file to a git repository (alongside your
configuration.yaml, if you keep that in git) whenever you've made changes worth
remembering. The diff then shows exactly what changed: a delay, a message, a new
alert.
git add alert-redux.yaml
git commit -m "Garage door: 15-minute delay; add Water Leak"Import the file with overwrite on: alerts that differ go back to the file's version, identical ones are left alone, and alerts the file doesn't mention are untouched (import never deletes). Always Check (dry run) first: it lists what would be created, updated, and left unchanged.
An alert's kind can't be changed by an import. If you changed an alert's kind since the file was made (by deleting and recreating it), delete it again before importing.
Because the file keeps each definition's id, importing it on a second Home
Assistant creates the same alerts there, and importing it again later updates them
rather than making duplicates. Create the notifier groups (with the same names)
first; then change entity IDs that differ, and import.
You can write a file from scratch, as every recipe in this wiki does: leave out
id (a definition then matches the existing alert of the same name, or is new), name
groups by name, and write durations as "HH:MM:SS" or seconds. If anything's wrong,
the import refuses the whole file and lists every problem, so nothing is ever
half-imported.
This is also the quickest way to make many similar alerts that a generator doesn't suit: write one, copy it in the file, change the entity and name, and import them together.
An exported alert is easy to share in a forum post or an issue: it's short, it's readable, and it imports as-is once the reader has changed the entity IDs. If you've made something good, consider adding it to this wiki.
Start here
Recipes
- Security and Doors
- Leaks and Climate
- Appliances and Chores
- Devices and Infrastructure
- Reminders and Household Events
Patterns
- Escalation and Supersession
- Keeping Alerts Until Acknowledged
- Generators: One Alert per Device
- Designing Your Notifications
- Taking Alerts Out of Service
- Voice Control
- Building on Alert Redux
- Reacting to Alerts
Moving and maintaining