Add backup.create service (#22407)

* Add backup.create service

* Tweak

Co-authored-by: H. Kamran <hkamran@unisontech.org>

Co-authored-by: H. Kamran <hkamran@unisontech.org>
This commit is contained in:
Franck Nijhof 2022-04-20 08:57:20 +02:00 committed by GitHub
parent 8072d1fb6a
commit 4ece5bfa96
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -31,3 +31,38 @@ You need to restart Home Assistant after you add this configuration.
When it has started up again you will find a new "Backup" entry in the main menu (**Configuration** -> **Backup**).
The backup files are stored in a new "backups" subdirectory in the root of your configuration directory.
## Services
The backup integration exposes a service that can be used to automate the backup
process.
### Service {% my developer_call_service service="backup.create" %}
The {% my developer_call_service service="backup.create" %} service can be used
to create a backup for your Home Assistant instance.
The service has no additional options or parameters.
Example service call:
```yaml
service: backup.create
```
## Example: Backing up every night at 3:00 AM
This is a YAML example for an automation that initiate a backup every night
at 3 AM:
```yaml
automation:
- alias: "Backup Home Assistant every night at 3 AM"
trigger:
platform: time
at: "03:00:00"
action:
alias: "Create backup now"
service: backup.create
```