Backup
The Backup integrationIntegrations connect and integrate Home Assistant with your devices, services, and more. [Learn more] creates and restores backups across all installation types.
To learn how to create and restore a backup, refer to the backup section under common tasks.
You no longer need to create your own automation to make backups. You can set up an automatic backup from the UI instead. If you do want to trigger a backup yourself, the integration provides actions for it.
List of actions
The Backup integrationIntegrations connect and integrate Home Assistant with your devices, services, and more. [Learn more] provides the following actions. Each link below opens a dedicated page with examples, parameters, and a step-by-step UI walkthrough.
-
Create backup (
backup.create) Creates a basic local backup of your Home Assistant instance. -
Create automatic backup (
backup.create_automatic) Creates a backup using your configured automatic backup settings.
For an overview of every action across all integrations, see the actions reference.
Restoring a backup
To restore a backup, follow the steps described in Restoring a backup.
Event entity
The Backup integrationIntegrations connect and integrate Home Assistant with your devices, services, and more. [Learn more] provides an Event entityEvents are signals that are emitted when something happens, for example, when a user presses a physical button like a doorbell or when a button on a remote control is pressed. [Learn more] that represents the state of the last automatic backup (completed, in progress, or failed). It also provides several event attributes you can use in automations.
| Attribute | Description |
|---|---|
event_type |
The translated state of the last automatic backup task (possible states: completed, in progress, failed). |
backup_stage |
The current automatic backup stage (is None when event_type is not in progress). |
failed_reason |
The reason for a failed automatic backup (is None when event_type is completed or in progress). |
Usage examples
Send a notification to the mobile app when an automatic backup fails:
alias: "Backup failed"
triggers:
- trigger: state
entity_id:
- event.backup_automatic_backup
conditions:
- condition: state
entity_id: event.backup_automatic_backup
attribute: event_type
state: failed
actions:
- action: notify.send_message
target:
entity_id: notify.my_device
data:
title: "Automatic backup failed"
message: >-
The last automatic backup failed due to
{{ state_attr('event.backup_automatic_backup', 'failed_reason') }}
Sensors
The Backup integrationIntegrations connect and integrate Home Assistant with your devices, services, and more. [Learn more] provides several sensors.
Backup manager state
The current state of the backup system. Possible states are:
- Idle
- Creating a backup
- Receiving a backup
- Restoring a backup
Next scheduled automatic backup
The timestamp of the next scheduled automatic backup.
Last attempted automatic backup
The timestamp of the last attempted automatic backup.
Last successful automatic backup
The timestamp of the last successful automatic backup.