Great stuff guys! Pretty new to hassio as well as the OS’s, HW platforms, and IoT in general, but have really enjoyed the challenges offered by learning new skills. I love Daniel’s add-on, and I have managed to automate my backups as well as the upload to Dropbox. There is something that I have been wondering. What is the best way to automatically determine when a snapshot completes (or alternatively if a snapshot completed). I am assuming it is a challenge as people more experienced than me seem to be putting arbitrary time gaps (30 min, 1 hour, 2 hours) between the snapshot and the upload to dropbox based on how long they expect the snapshot to actually take. Is there no way to initiate the snapshot and then have the upload take place based on the completion of the snapshot process?
If there isn’t a state or something that can be queried, or can we watch the list of local backups for our newly minted one to show up? Can I assume that if the automation is no longer “on” that the snapshot has completed (I assume not)?
This is my log file based on auto-launching the snapshot from an automation (my automation follows). My install is still very small and the snapshots only take a few minutes to complete when manually executed via the GUI.
2018-08-30 23:00:00 INFO (MainThread) [homeassistant.components.automation] Executing Daily Backup at 11 PM
2018-08-30 23:00:00 INFO (MainThread) [homeassistant.core] Bus:Handling <Event logbook_entry[L]: name=Daily Backup at 11 PM, message=has been triggered, domain=automation, entity_id=automation.daily_backup_at_11_pm>
2018-08-30 23:00:00 INFO (MainThread) [homeassistant.helpers.script] Script Daily Backup at 11 PM: Running script
2018-08-30 23:00:00 INFO (MainThread) [homeassistant.helpers.script] Script Daily Backup at 11 PM: Executing step call service
2018-08-30 23:00:00 INFO (MainThread) [homeassistant.core] Bus:Handling <Event call_service[L]: domain=hassio, service=snapshot_full, service_data=name=Automated Backup 2018-08-30>
2018-08-30 23:00:10 INFO (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: entity_id=automation.daily_backup_at_11_pm, old_state=<state automation.daily_backup_at_11_pm=on; last_triggered=2018-08-30T16:28:30.077489-04:00, id=daily_backup_and_cleaning, friendly_name=Daily Backup at 11 PM @ 2018-08-30T16:27:59.728052-04:00>, new_state=<state automation.daily_backup_at_11_pm=on; last_triggered=2018-08-30T23:00:10.633672-04:00, id=daily_backup_and_cleaning, friendly_name=Daily Backup at 11 PM @ 2018-08-30T16:27:59.728052-04:00>>
2018-08-30 23:00:10 DEBUG (MainThread) [homeassistant.components.websocket_api] WS 1914816624: Sending {‘id’: 2, ‘type’: ‘event’, ‘event’: {‘event_type’: ‘state_changed’, ‘data’: {‘entity_id’: ‘automation.daily_backup_at_11_pm’, ‘old_state’: <state automation.daily_backup_at_11_pm=on; last_triggered=2018-08-30T16:28:30.077489-04:00, id=daily_backup_and_cleaning, friendly_name=Daily Backup at 11 PM @ 2018-08-30T16:27:59.728052-04:00>, ‘new_state’: <state automation.daily_backup_at_11_pm=on; last_triggered=2018-08-30T23:00:10.633672-04:00, id=daily_backup_and_cleaning, friendly_name=Daily Backup at 11 PM @ 2018-08-30T16:27:59.728052-04:00>}, ‘origin’: ‘LOCAL’, ‘time_fired’: datetime.datetime(2018, 8, 31, 3, 0, 10, 634646, tzinfo=), ‘context’: {‘id’: ‘12cd39f866ba4d3c8da64eab44e678c8’, ‘user_id’: None}}}
2018-08-30 23:00:10 DEBUG (MainThread) [homeassistant.components.websocket_api] WS 1911756848: Sending {‘id’: 2, ‘type’: ‘event’, ‘event’: {‘event_type’: ‘state_changed’, ‘data’: {‘entity_id’: ‘automation.daily_backup_at_11_pm’, ‘old_state’: <state automation.daily_backup_at_11_pm=on; last_triggered=2018-08-30T16:28:30.077489-04:00, id=daily_backup_and_cleaning, friendly_name=Daily Backup at 11 PM @ 2018-08-30T16:27:59.728052-04:00>, ‘new_state’: <state automation.daily_backup_at_11_pm=on; last_triggered=2018-08-30T23:00:10.633672-04:00, id=daily_backup_and_cleaning, friendly_name=Daily Backup at 11 PM @ 2018-08-30T16:27:59.728052-04:00>}, ‘origin’: ‘LOCAL’, ‘time_fired’: datetime.datetime(2018, 8, 31, 3, 0, 10, 634646, tzinfo=), ‘context’: {‘id’: ‘12cd39f866ba4d3c8da64eab44e678c8’, ‘user_id’: None}}}
Automations.yaml:
id: daily_backup_and_cleaning
alias: Daily Backup at 11 PM
trigger:
platform: time
at: ‘23:00:00’
action:
service: hassio.snapshot_full
data_template:
name: Automated Backup {{ now().strftime(’%Y-%m-%d’) }}