A Home Assistant Custom Component that provides an on-demand backup service for key configuration files. Trigger the ha_backupper.backup_now service to create a timestamped zip archive containing your configuration, automation, and script definitions.
- Copy the
custom_components/ha_backupperfolder to your Home Assistantcustom_componentsdirectory (or install through HACS once published). - Restart Home Assistant.
Add an entry to your configuration.yaml file (optional):
ha_backupper:
backup_directory: backups
sources:
- configuration.yaml
- automations.yaml
- scripts.yaml
- blueprints
max_backups: 10backup_directory– Relative path within the Home Assistant configuration directory where backups are stored. Defaults tobackups.sources– List of files or directories (relative to the configuration directory) to include when creating backups. Defaults to core configuration files and folders.max_backups– Optional number of most recent backups to retain. Older archives beyond this limit are removed.
Call the ha_backupper.backup_now service from the Developer Tools or automations. Optionally override the paths for a single backup by passing a paths list in the service data.
Each backup is created as a zip archive named ha_backup_YYYYMMDD_HHMMSS.zip and stored in the configured backup directory.
The integration keeps every archive in the configured backup directory so they are immediately available on the Home Assistant host. Additional helper services are provided to move, import, and restore backups when needed:
ha_backupper.download_backup– Copy a backup from the integration's backup directory to another location on the local filesystem (for example a mounted USB drive or shared folder). Provide the backup name (the.zipextension is optional) and the destination path. Setoverwrite: trueto replace an existing file at the destination.ha_backupper.upload_backup– Import an existing archive into the backup directory. Supply the source path, optionally override the stored filename withbackup_name, and setoverwrite: trueto replace an existing archive with the same name.ha_backupper.restore_backup– Restore files from a stored archive back into the Home Assistant configuration directory. Use the optionaltargetslist to limit restoration to specific files or directories. Enableoverwriteto replace existing files.