Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- alias: Garage Door Notification
- description: ''
- trigger:
- - platform: state
- entity_id: input_boolean.test_boolean_1
- from: 'off'
- to: 'on'
- - platform: state
- entity_id: input_boolean.test_boolean_1
- from: 'on'
- to: 'off'
- - platform: event
- event_type: mobile_app_notification_action
- context: {}
- condition: []
- action:
- - choose:
- - conditions:
- - condition: template
- value_template: '{{trigger.event.data.action == ''close''}}'
- sequence:
- - service: input_boolean.turn_off
- target:
- entity_id: input_boolean.test_boolean_1
- - conditions:
- - condition: template
- value_template: '{{trigger.event.data.action == ''disable''}}'
- sequence:
- - service: input_boolean.turn_on
- target:
- entity_id: input_boolean.garage_door_notification_temp_disable
- - service: notify.mobile_app_matt_s_pixel_5
- data:
- message: >-
- Garage Door Notifications have been disabled by
- {{trigger.event.context}}
- data:
- ttl: 0
- priority: high
- default: []
- - repeat:
- while:
- - condition: state
- entity_id: input_boolean.test_boolean_1
- state: 'on'
- - condition: state
- entity_id: input_boolean.garage_door_notification_temp_disable
- state: 'off'
- sequence:
- - delay:
- hours: 0
- minutes: 0
- seconds: 15
- milliseconds: 0
- - service: notify.mobile_app_matt_s_pixel_5
- data:
- message: >-
- The garage door has been open for {{repeat.index*10}} minutes.
- Please shut it.
- data:
- ttl: 0
- priority: high
- actions:
- - action: disable
- title: Disable Notification
- - action: close
- title: Close Garage Door
- - condition: state
- entity_id: input_boolean.test_boolean_1
- state: 'off'
- - service: notify.mobile_app_matt_s_pixel_5
- data:
- message: The garage door has been closed
- data:
- ttl: 0
- priority: high
- - service: input_boolean.turn_off
- target:
- entity_id: input_boolean.garage_door_notification_temp_disable
- mode: restart
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement