Advertisement
Guest User

Untitled

a guest
Mar 31st, 2020
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 5.00 KB | None | 0 0
  1. #
  2. #
  3. # Alarm Related Packages
  4. #
  5. #
  6.  
  7. homeassistant:
  8.  #----------------CUSTOMIZE---------------------------
  9.   customize:
  10.     group.entry_points:
  11.       friendly_name: Alarm Entry Points
  12.  
  13. #----------------GROUP---------------------------
  14. group:
  15.   entry_points:
  16.     entities:
  17.      - binary_sensor.garage_to_back_door
  18.       - binary_sensor.front_door
  19.       - binary_sensor.wyzesense_77892FDD
  20.       - binary_sensor.garage_to_house_test_door
  21.       - binary_sensor.wyzesense_7784E101
  22.       - binary_sensor.dining_1_state
  23.       - binary_sensor.dining_2_state
  24.       - binary_sensor.wyzesense_778f1252
  25.       - binary_sensor.wyzesense_778f12e9
  26.       - binary_sensor.wyzesense_77892E83
  27.  
  28. #----------------AUTOMATIONS---------------------------
  29. automation:
  30.   - alias: "Trigger alarm if system armed and door or window opened"
  31.     trigger:
  32.       - platform: state
  33.         entity_id: group.entry_points
  34.         to: "on"
  35.     condition:
  36.       condition: or
  37.       conditions:
  38.         - condition: state
  39.           entity_id: alarm_control_panel.home_alarm
  40.           state: "armed_home"
  41.         - condition: state
  42.           entity_id: alarm_control_panel.home_alarm
  43.           state: "armed_away"
  44.         - condition: state
  45.           entity_id: alarm_control_panel.home_alarm
  46.           state: "armed_night"
  47.     action:
  48.       - service: alarm_control_panel.alarm_trigger
  49.         entity_id: alarm_control_panel.home_alarm
  50.  
  51.   - alias: "Turn on siren if alarm is triggered"
  52.     trigger:
  53.       - platform: state
  54.         entity_id: alarm_control_panel.home_alarm
  55.         to: "triggered"
  56.     action:
  57.       - service: switch.turn_on
  58.         entity_id: switch.upstairs_alarm
  59.       - service: switch.turn_on
  60.         entity_id: switch.deck_light
  61.       - service: notify.all_phones
  62.         data:
  63.           title: "Smart Home Alerts"
  64.           message: "ALARM SYSTEM TRIGGERED"
  65.           data:
  66.             push:
  67.               critical: 1
  68.       - service: light.turn_on
  69.         entity_id: group.hue_bulbs
  70.       - service: script.turn_on
  71.         entity_id: script.alexa_alarm
  72.  
  73.   - alias: "Update input boolean of arm status"
  74.     trigger:
  75.       - platform: state
  76.         entity_id: alarm_control_panel.home_alarm
  77.         to: "armed_home"
  78.       - platform: state
  79.         entity_id: alarm_control_panel.home_alarm
  80.         to: "armed_away"
  81.       - platform: state
  82.         entity_id: alarm_control_panel.home_alarm
  83.         to: "armed_night"
  84.     action:
  85.       service: input_boolean.turn_on
  86.       entity_id: input_boolean.system_armed
  87.  
  88.   - alias: "Update input boolean of disarm status"
  89.     trigger:
  90.       - platform: state
  91.         entity_id: alarm_control_panel.home_alarm
  92.         to: "disarmed"
  93.     action:
  94.       service: input_boolean.turn_off
  95.       entity_id: input_boolean.system_armed
  96.  
  97.   - alias: "Arm system if no one home"
  98.     trigger:
  99.       - platform: state
  100.         entity_id: binary_sensor.aaron_location
  101.         to: "off"
  102.     condition:
  103.       - condition: state
  104.         entity_id: binary_sensor.kendra_location
  105.         state: "off"
  106.     action:
  107.       - service: alarm_control_panel.alarm_arm_away
  108.         data:
  109.           entity_id: alarm_control_panel.home_alarm
  110.           code: !secret alarm_panel_code
  111.  
  112.   - alias: "Turn off siren and deck and other light if system disarmed"
  113.     trigger:
  114.       - platform: state
  115.         entity_id: alarm_control_panel.home_alarm
  116.         to: "disarmed"
  117.     action:
  118.       - service: switch.turn_off
  119.         entity_id: switch.upstairs_alarm
  120.       - service: switch.turn_off
  121.         entity_id: switch.deck_light
  122.       - service: light.turn_off
  123.         entity_id: group.hue_bulbs
  124.  
  125. #----------------SCRIPTS---------------------------
  126. script:
  127.   alexa_alarm:
  128.     sequence:
  129.       - service: notify.alexa_media
  130.         data:
  131.           target:
  132.            - group.alexa
  133.           data:
  134.             type: tts
  135.           message: >
  136.            "The police have been called."
  137.       - service: script.turn_on
  138.         entity_id: script.alexa_loop
  139.  
  140.   alexa_loop:
  141.     sequence:
  142.       - delay:
  143.           seconds: 5
  144.       - condition: or
  145.         conditions:
  146.           - condition: state
  147.             entity_id: alarm_control_panel.home_alarm
  148.             state: "armed_home"
  149.           - condition: state
  150.             entity_id: alarm_control_panel.home_alarm
  151.             state: "armed_away"
  152.           - condition: state
  153.             entity_id: alarm_control_panel.home_alarm
  154.             state: "armed_night"
  155.           - condition: state
  156.             entity_id: alarm_control_panel.home_alarm
  157.             state: "triggered"
  158.       - service: script.turn_on
  159.         entity_id: script.alexa_alarm
  160.  
  161.   disarm_alarm:
  162.     sequence:
  163.       - service: alarm_control_panel.alarm_disarm
  164.         data:
  165.           entity_id: alarm_control_panel.home_alarm
  166.           code: !secret alarm_panel_code
  167.  
  168. #----------------TIMERS---------------------------
  169.  
  170. #----------------INPUT BOOLEANs---------------------------
  171. input_boolean:
  172.   system_armed:
  173.     name: Status of alarm system
  174.     initial: off
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement