Add alarm
This commit is contained in:
parent
dfc1f6e64c
commit
851102d52a
65
automations/files/alarm.yaml
Normal file
65
automations/files/alarm.yaml
Normal file
@ -0,0 +1,65 @@
|
||||
- id: alarm-away
|
||||
alias: '[Alarm] Trigger alarm when not at home'
|
||||
trigger:
|
||||
# Use all motion sensors
|
||||
- platform: state
|
||||
entity_id: binary_sensor.bathroom_motion_sensor
|
||||
to: 'on'
|
||||
- platform: state
|
||||
entity_id: binary_sensor.bedroom_motion_on_off
|
||||
to: 'on'
|
||||
- platform: state
|
||||
entity_id: binary_sensor.hallway_motion_sensor
|
||||
to: 'on'
|
||||
- platform: state
|
||||
entity_id: binary_sensor.kitchen_motion_sensor
|
||||
to: 'on'
|
||||
- platform: state
|
||||
entity_id: binary_sensor.shower_motion
|
||||
to: 'on'
|
||||
- platform: state
|
||||
entity_id: binary_sensor.front_door_open_close
|
||||
to: 'open'
|
||||
condition:
|
||||
- condition: state
|
||||
entity_id: alarm_control_panel.ha_alarm
|
||||
state: armed_away
|
||||
action:
|
||||
- service: alarm_control_panel.alarm_trigger
|
||||
entity_id: alarm_control_panel.ha_alarm
|
||||
|
||||
- id: alarm-night
|
||||
alias: '[Alarm] Trigger alarm at night'
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id: binary_sensor.front_door_open_close
|
||||
to: 'open'
|
||||
condition:
|
||||
- condition: state
|
||||
entity_id: alarm_control_panel.ha_alarm
|
||||
state: armed_away
|
||||
action:
|
||||
- service: alarm_control_panel.alarm_trigger
|
||||
entity_id: alarm_control_panel.ha_alarm
|
||||
|
||||
- id: alarm-arm-away
|
||||
alias: '[Alarm] Arm away'
|
||||
trigger:
|
||||
- platform: zone
|
||||
entity_id: device_tracker.sm_g965f
|
||||
zone: zone.home
|
||||
event: leave
|
||||
action:
|
||||
- service: alarm_control_panel.alarm_arm_away
|
||||
entity_id: alarm_control_panel.ha_alarm
|
||||
|
||||
- id: alarm-triggered
|
||||
alias: '[Alarm] Send notification when alarm triggered'
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id: alarm_control_panel.ha_alarm
|
||||
to: 'triggered'
|
||||
action:
|
||||
- service: notify.notify
|
||||
data:
|
||||
message: "ALARM! The alarm has been triggered"
|
Loading…
Reference in New Issue
Block a user