elradix

Package Snapshot

Oct 22nd, 2020
657
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ---
  2. sensor:
  3.   - platform: template
  4.     sensors:
  5.       last_backup:
  6.         friendly_name: "Last Backup"
  7.         value_template: "{{state_attr('sensor.snapshot_backup', 'last_snapshot')}}"
  8.  
  9. automation:
  10. - alias: Snapshot made notification
  11.   initial_state: 'on'
  12.   trigger:
  13.     - platform: state
  14.       entity_id: sensor.last_backup
  15.   condition:
  16.     - condition: numeric_state
  17.       entity_id: sensor.hass_uptime
  18.       above: 3
  19.   action:
  20.     - service: persistent_notification.create
  21.       data_template:
  22.         title: Snapshot made
  23.         message: >-
  24.           {{ states.sensor.snapshot_backup.attributes.snapshots[3].name }}
  25.           Snapshots on Drive: {{ states.sensor.snapshot_backup.attributes.snapshots_in_google_drive }}
  26.           Snapshots stored locally: {{ states.sensor.snapshot_backup.attributes.snapshots_in_hassio }}
  27.     - service: notify.dageraad
  28.       data_template:
  29.         title: Snapshot Update
  30.         message: |
  31.          {{ states.sensor.snapshot_backup.attributes.snapshots[3].name }}
  32.           Snapshots on Drive: {{ states.sensor.snapshot_backup.attributes.snapshots_in_google_drive }}
  33.           Snapshots stored locally: {{ states.sensor.snapshot_backup.attributes.snapshots_in_hassio }}
  34.          
RAW Paste Data