Wait for hassio.backup

How can I detect when a backup completes?

  backup:
    sequence:
    - service: hassio.backup_full
      data_template:
        name: Full Backup {{ now().strftime('%Y-%m-%d') }}

I want to know it has completed before the next step. Is it possible to know ?
Configuration tab
  Add-ons, Backups & Supervisor
    Backups

Here’s a copy of my automation for weekly backups.

  alias: HASSIO Weekly Snapshot
  trigger:
  - platform: time
    at: 03:00:00
  condition:
    condition: time
    weekday:
    - sun
  action:
  - service: hassio.backup_full
    data:
      name: Full Backup {{ now().strftime('%Y-%m-%d') }}

@philb My automation is virtually identical. That is not my issue.

I want to know when the backup completes.

Eg to be able to report how long it took, or to copy the backup file to another location…

That was my second post. Refer to my first post about where to find the HA backups.

Configurations

Add-ons, Backups, Supervisor

Backup (Different on phone than PC but, the option that says backup or looks like the icon here.)



Perhaps this will make it clearer.

I want the first script call to wait until the backup completes before returning and allowing the next step.

It does not, it just initiates the backup and exits.

It’s not the “wait for a triggered event solution” but, there is always the delay.

backup:
  sequence:
    - service: script.do_full_backup
    - delay: "00:10:00"
    - service: script.copy_backup_to_dropbox
    - service: notify.pushover
      data:
        title: 0z HA-250G
        message: HA Clone back-up done
    mode: single

Edit:
Apparently, this has been a request sense 2018. Trigger a event when snapshot creation is finished

Here is a 2020 request. Feature Request: Snapshot complete event

But I was not able to find it on the official Feature Requests sight.

That has been my inelegant solution to date.

There must be a way to know a hassio service has finished.

@philb thanks for that bit of research. I have created a feature request.

1 Like

In theory hassio suports this now Notify HA Core when backup is being executed by agners · Pull Request #3305 · home-assistant/supervisor · GitHub

Not sure if it has been implemented on the core-side though.

EDIT: not really, this is valid only for backups that include home-assistant only

Has this been solved somehow? I have the exact same issue, trying to do further processing when a HA backup is done and finished - but since the service call doesn’t wait for it to actually finish, I’m stuck.

Not a fix, but a workaround for anyone who runns across this thread in the future, the Google Drive Add-On exposes sensor.backup_state, which has the attributes last_backup and last_uploaded