/
alarm_panel.yaml
87 lines (82 loc) · 2.78 KB
/
alarm_panel.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
alarm_control_panel:
- platform: manual
name: Home Alarm
code: !secret alarm_panel_code
pending_time: 30
delay_time: 20
trigger_time: 4
disarmed:
trigger_time: 0
armed_home:
pending_time: 0
delay_time: 0
automation:
- alias: Turn on alarm when nobody is present
trigger:
- platform: state
entity_id: group.everybody_tracker
to: 'not_home'
for:
minutes: 10
condition:
- condition: state
entity_id: alarm_control_panel.home_alarm
state: disarmed
action:
- service: alarm_control_panel.alarm_arm_away
entity_id: alarm_control_panel.home_alarm
- alias: Turn off alarm when somebody is present
trigger:
- platform: state
entity_id: group.everybody_tracker
to: 'home'
condition:
- condition: state
entity_id: alarm_control_panel.home_alarm
state: 'armed_away'
action:
- service: alarm_control_panel.alarm_disarm
entity_id: alarm_control_panel.home_alarm
- alias: 'Trigger alarm while armed away' # the one which should hold all your sensors (triggers)
trigger:
- platform: state
entity_id: switch.voordeur_switch
to: 'on'
- platform: state
entity_id: binary_sensor.voordeur_keuken
to: 'on'
condition:
- condition: state
entity_id: alarm_control_panel.home_alarm
state: armed_away
action:
- service: alarm_control_panel.alarm_trigger
entity_id: alarm_control_panel.home_alarm
- alias: 'Alert to disable alarm' # i don't trigger on the states of my sensor i trigger on the alarm. Important difference
trigger:
- platform: state
entity_id: alarm_control_panel.home_alarm
from: 'armed_away'
to: 'pending'
for:
seconds: 5
action:
- service: mqtt.publish
data_template:
topic: 'homeassistant/wallpanel/command'
payload: "{'speak':'Je hebt nog een kleine minuut om het alarm er af te halen'}"
# TODO: add a method that shows the alarm panel tab only when entering
- alias: 'Alarm went off, lets make sure we alert/notify/whatever'
trigger:
- platform: state
entity_id: alarm_control_panel.home_alarm
to: 'triggered'
action:
- service: notify.ios_ierik
data_template:
title: "Alarm is afgegaan!"
message: "Ik zou maar even kijken, deze is afgegaan {{ trigger.from_state.attributes.friendly_name }} "
- service: mqtt.publish
data_template:
topic: 'homeassistant/wallpanel/command'
payload: "{'speak':'Alarm is afgegaan, ik hoop dat je snel weg bent want het feest gaat nu echt beginnen'}"