-
Notifications
You must be signed in to change notification settings - Fork 0
/
automations.yaml
executable file
·161 lines (148 loc) · 4.01 KB
/
automations.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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
#### NOTIFICATIONS #############
- alias: Smoke Alarm
trigger:
platform: numeric_state
entity_id: sensor.airquality_smoke
above: 0
action:
service: notify.notify
data_template:
title: "Smoke Detected!"
message: "Smoke detected at {{ states.sensor.airquality_smoke.state }} ppm"
- alias: Alarm Triggered
trigger:
platform: state
entity_id: alarm_control_panel.mqtt_alarm
to: 'triggered'
action:
- service: script.turn_on
entity_id: script.do_alarm
#### UNATTENDED ##################
- alias: Alarm Disarmed
trigger:
platform: state
entity_id: alarm_control_panel.mqtt_alarm
to: 'disarmed'
action:
- service: script.turn_off
entity_id: script.trigger_alarm
- service: homeassistant.turn_on
entity_id: switch.alarm_screen
- service: homeassistant.turn_off
entity_id: switch.floodlights
- service: light.turn_on
data:
entity_id:
- light.office_rgb_light
color_name: 'blueviolet'
- service: light.turn_on
data:
entity_id:
- light.mainlightrgb
color_name: 'green'
brightness_pct: 100
- delay: '00:00:02'
- service: light.turn_on
data:
entity_id:
- light.mainlightrgb
color_name: 'white'
- delay: '00:00:09'
- service: light.turn_off
entity_id: light.mainlightrgb
- alias: Alarm Activated
trigger:
platform: state
entity_id: alarm_control_panel.mqtt_alarm
to: 'armed_away'
action:
- service: light.turn_off
data:
entity_id: group.all_lights
- service: homeassistant.turn_off
entity_id: switch.alarm_screen
- alias: Motion Detected when Away
trigger:
platform: state
entity_id: binary_sensor.motion
from: 'off'
to: 'on'
condition:
condition: or
conditions:
- condition: state
entity_id: 'alarm_control_panel.mqtt_alarm'
state: 'armed_home'
- condition: state
entity_id: 'alarm_control_panel.mqtt_alarm'
state: 'armed_away'
action:
- service: homeassistant.turn_on
entity_id: switch.floodlights
- service: script.turn_on
entity_id: script.trigger_alarm
- alias: Lights On when Away
trigger:
platform: numeric_state
entity_id: sensor.light_level
above: 15
for:
seconds: 3
condition:
condition: or
conditions:
- condition: state
entity_id: 'alarm_control_panel.mqtt_alarm'
state: 'armed_home'
- condition: state
entity_id: 'alarm_control_panel.mqtt_alarm'
state: 'armed_away'
action:
- service: script.turn_on
entity_id: script.do_alarm
- alias: Rain Light - On
trigger:
platform: numeric_state
entity_id: sensor.dark_sky_precip_probability
above: 20.0
action:
- service: homeassistant.turn_on
entity_id: switch.sensor_light
- alias: Rain Light - Off
trigger:
platform: numeric_state
entity_id: sensor.dark_sky_precip_probability
below: 19.9
action:
- service: homeassistant.turn_off
entity_id: switch.sensor_light
- alias: Alarm Screen Off @ Night
trigger:
platform: time
at: '00:00:00'
action:
- service: homeassistant.turn_off
entity_id: switch.alarm_screen
- alias: Alarm Screen On @ Morning
trigger:
platform: time
at: '06:55:00'
action:
- service: homeassistant.turn_on
entity_id: switch.alarm_screen
- alias: Alarm Screen @ Motion
trigger:
platform: state
entity_id: binary_sensor.motion
from: 'off'
to: 'on'
condition:
condition: time
after: '00:00:01'
before: '06:54:20'
action:
- service: homeassistant.turn_on
entity_id: switch.alarm_screen
- delay: '00:00:30'
- service: homeassistant.turn_off
entity_id: switch.alarm_screen