Advertisement
Guest User

Untitled

a guest
Jul 19th, 2019
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 2.61 KB | None | 0 0
  1. - alias: 'Turn off HVAC if window/door is opened'
  2.   trigger:
  3.     - platform: state
  4.       entity_id:
  5.        - binary_sensor.zone_01_front_door_garage_entry_42
  6.         - binary_sensor.zone_3_window_next_to_front_door_30
  7.         - binary_sensor.zone_11_laundry_window_38
  8.         - binary_sensor.zone_12_living_room_patio_door_39
  9.         - binary_sensor.zone_2_both_kitchen_window_29
  10.         - binary_sensor.zone_10_window_next_to_front_door_37
  11.         - binary_sensor.zone_4_living_room_laundry_window_31
  12.         - binary_sensor.zone_8_3_windows_family_room_35
  13.         - binary_sensor.zone_9_kitchen_window_36
  14.       to: 'on'
  15.       from: 'off'
  16.       for:
  17.         minutes: 5
  18.   condition:
  19.     condition: or
  20.     conditions:
  21.       - condition: template
  22.         value_template: "{{ states('climate.downstairs_2') != 'off' }}"
  23.       - condition: template
  24.         value_template: "{{ states('climate.hallway_upstairs_2') != 'off' }}"
  25.   action:
  26.     - service: climate.set_hvac_mode
  27.       data:
  28.         entity_id: climate.downstairs_2
  29.         hvac_mode: 'off'
  30.     - service: climate.set_hvac_mode
  31.       data:
  32.         entity_id: climate.hallway_upstairs_2
  33.         hvac_mode: 'off'
  34.     - service: notify.slack_notify
  35.       data_template:
  36.         message: 'The {{ trigger.to_state.attributes.friendly_name }} has been opened for about 5 minutes.  I will shut down the Air Conditioner so you can enjoy the fresh air.'
  37.     - service: tts.google_say
  38.       entity_id: group.allspeaktome
  39.       data_template:
  40.         message: 'The {{ trigger.to_state.attributes.friendly_name }} has been opened for about 5 minutes.  I will shut down the Air Conditioner so you can enjoy the fresh air.'
  41.     - service: notify.alexa_media_everywhere
  42.       data_template:
  43.         message: 'The {{ trigger.to_state.attributes.friendly_name }} has been opened for about 5 minutes.  I will shut down the Air Conditioner so you can enjoy the fresh air.'
  44.         data:
  45.           type: 'announce'
  46.  
  47. #-------------------------------------------#-------------------------------------------
  48. - alias: 'Turn HVAC back on when all doors/windows are closed.'
  49.   trigger:
  50.     - platform: state
  51.       entity_id:
  52.        - group.ext_entry
  53.       to: 'off'
  54.       from: 'on'
  55.       for:
  56.         minutes: 5
  57.  
  58.   condition:
  59.     - condition: template
  60.       value_template: "{{ states('climate.downstairs_2') == 'off' }}"
  61.  
  62.   action:
  63.     - service: climate.set_hvac_mode
  64.       data:
  65.         entity_id: climate.downstairs_2
  66.         hvac_mode: 'cool'
  67.     - service: climate.set_hvac_mode
  68.       data:
  69.         entity_id: climate.hallway_upstairs_2
  70.         hvac_mode: 'cool'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement