Advertisement
McNutty195

Garage Door Notification

Mar 24th, 2021
214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.41 KB | None | 0 0
  1. alias: Garage Door Notification
  2. description: ''
  3. trigger:
  4. - platform: state
  5. entity_id: input_boolean.test_boolean_1
  6. from: 'off'
  7. to: 'on'
  8. - platform: state
  9. entity_id: input_boolean.test_boolean_1
  10. from: 'on'
  11. to: 'off'
  12. - platform: event
  13. event_type: mobile_app_notification_action
  14. context: {}
  15. condition: []
  16. action:
  17. - choose:
  18. - conditions:
  19. - condition: template
  20. value_template: '{{trigger.event.data.action == ''close''}}'
  21. sequence:
  22. - service: input_boolean.turn_off
  23. target:
  24. entity_id: input_boolean.test_boolean_1
  25. - conditions:
  26. - condition: template
  27. value_template: '{{trigger.event.data.action == ''disable''}}'
  28. sequence:
  29. - service: input_boolean.turn_on
  30. target:
  31. entity_id: input_boolean.garage_door_notification_temp_disable
  32. - service: notify.mobile_app_matt_s_pixel_5
  33. data:
  34. message: >-
  35. Garage Door Notifications have been disabled by
  36. {{trigger.event.context}}
  37. data:
  38. ttl: 0
  39. priority: high
  40. default: []
  41. - repeat:
  42. while:
  43. - condition: state
  44. entity_id: input_boolean.test_boolean_1
  45. state: 'on'
  46. - condition: state
  47. entity_id: input_boolean.garage_door_notification_temp_disable
  48. state: 'off'
  49. sequence:
  50. - delay:
  51. hours: 0
  52. minutes: 0
  53. seconds: 15
  54. milliseconds: 0
  55. - service: notify.mobile_app_matt_s_pixel_5
  56. data:
  57. message: >-
  58. The garage door has been open for {{repeat.index*10}} minutes.
  59. Please shut it.
  60. data:
  61. ttl: 0
  62. priority: high
  63. actions:
  64. - action: disable
  65. title: Disable Notification
  66. - action: close
  67. title: Close Garage Door
  68. - condition: state
  69. entity_id: input_boolean.test_boolean_1
  70. state: 'off'
  71. - service: notify.mobile_app_matt_s_pixel_5
  72. data:
  73. message: The garage door has been closed
  74. data:
  75. ttl: 0
  76. priority: high
  77. - service: input_boolean.turn_off
  78. target:
  79. entity_id: input_boolean.garage_door_notification_temp_disable
  80. mode: restart
  81.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement