-
Notifications
You must be signed in to change notification settings - Fork 2
/
automations.yaml
343 lines (321 loc) · 11.4 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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
- id: '6661873869246'
alias: Annoy Stephen when he's been on his XBox too long
trigger:
- platform: state
entity_id: device_tracker.stephens_xboxone_wireless
to: 'home'
for:
hours: 4
action:
- service: notify.email_residents
data:
title: 'STEPHEN! GO TO WORK!'
message: 'Seriously dude, you have been on that fucking XBox for four goddamn hours. Get up off your lazy fucking ass and GO THE FUCK TO WORK!!!'
- id: '7751679368942'
alias: disarm alarm and unlock front door when someone gets home
trigger:
- platform: state
entity_id: group.people
to: 'home'
action:
- service: lock.unlock
data:
entity_id: lock.locked
- service: alarm_control_panel.alarm_disarm
data:
entity_id: alarm_control_panel.alarm
code: !secret alarm_code
- id: '6773927677025'
alias: arm alarm and lock doors when everyone has left
trigger:
- platform: state
entity_id: group.people
to: 'not_home'
action:
- service: lock.lock
data:
entity_id: group.locks
- service: alarm_control_panel.alarm_arm_home
data:
entity_id: alarm_control_panel.alarm
code: !secret alarm_code
- id: '4576734257853'
alias: Send notification when less than 7 days until filter change
trigger:
- platform: numeric_state
entity_id: sensor.days_until_filter_change
below: 7
action:
- service: notify.email_residents
data:
title: "HVAC filter will need to be changed soon"
message: "This is an automated message from Home Assistant. The furnace filter will need to be replaced in the next week or so. Please ensure that there is a 12x24x1 MERV 11 replacement filter on hand. If there isn't, please go purchase one soon. Thank you!"
- id: '4564234567532'
alias: Send notification when HVAC filter has reached EOL
trigger:
platform: numeric_state
entity_id: sensor.hvac_filter_time_used
above: 300
action:
- service: notify.email_residents
data:
title: "HVAC filter needs to be changed"
message: "This is an automated message from Home Assistant. The furnace filter has reached end-of-life and needs to be changed. Please replace it with a new 12x24x1 MERV 11 filter today. Thank you!"
- id: '3785739476833'
alias: Send notification when a sensor battery is low
trigger:
- platform: numeric_state
entity_id: sensor.gunsafebattery
below: 20
- platform: numeric_state
entity_id: sensor.frontdoorbattery
below: 20
- platform: numeric_state
entity_id: sensor.frontdoorlockbattery
below: 20
- platform: numeric_state
entity_id: sensor.sidedoorbattery
below: 20
- platform: numeric_state
entity_id: sensor.hallbathmultisensorbattery
below: 20
- platform: numeric_state
entity_id: sensor.sirenbattery
below: 20
- platform: numeric_state
entity_id: sensor.hallsmokebattery
below: 20
action:
- service: notify.email_residents
data_template:
title: "A sensor battery is low and needs to be replaced"
message: "The {{ trigger.to_state.attributes.friendly_name | lower }} is low. Please replace it today."
- id: '2549662193742'
alias: Download throughput monitoring
trigger:
platform: state
entity_id: sensor.router_wan_in
action:
- service: input_number.set_value
data_template:
entity_id: input_number.internet_traffic_delta_in
value: '{{ ((trigger.to_state.state | int - trigger.from_state.state | int) * 8 ) / ( as_timestamp(trigger.to_state.last_updated) - as_timestamp(trigger.from_state.last_updated) ) }}'
- id: '2549662193942'
alias: Upload throughput monitoring
trigger:
platform: state
entity_id: sensor.router_wan_out
action:
- service: input_number.set_value
data_template:
entity_id: input_number.internet_traffic_delta_out
value: '{{ ((trigger.to_state.state | int - trigger.from_state.state | int) * 8 ) / ( as_timestamp(trigger.to_state.last_updated) - as_timestamp(trigger.from_state.last_updated) ) }}'
- id: '1504390477853'
alias: Porch light on at sunset
trigger:
event: sunset
platform: sun
action:
- service: switch.turn_on
entity_id: switch.ge_45609_onoff_relay_switch_switch_2
- id: '1530208234790'
alias: Outside lights off at sunrise
trigger:
- event: sunrise
platform: sun
action:
service: switch.turn_off
entity_id:
- switch.ge_45609_onoff_relay_switch_switch_2
- switch.ge_45609_onoff_relay_switch_switch
- id: '1533452705906'
alias: Trash Notifier
trigger:
- at: '14:00'
platform: time
condition:
condition: time
weekday:
- mon
action:
- service: notify.email_residents
data:
title: Trash Day
message: This is an automated message from Home Assistant to remind you to please take the trash out to the curb today. Thank you!
- id: '1533452705343'
alias: Recycling Notifier
trigger:
- at: '14:00'
platform: time
condition:
condition: time
weekday:
- thu
action:
- service: notify.email_residents
data:
title: Recycling Day
message: This is an automated message from Home Assistant to remind you to please take the recycling out to the curb today. Thank you!
- id: '4313245674785'
alias: Trigger alarm while armed away
trigger:
- platform: template
value_template: '{% if is_state("binary_sensor.fdstatus", "on") %}true{% endif %}'
- platform: template
value_template: '{% if is_state("binary_sensor.sdstatus", "on") %}true{% endif %}'
- platform: template
value_template: '{% if is_state("binary_sensor.gunsafetamper", "on") %}true{% endif %}'
- platform: template
value_template: '{% if is_state("binary_sensor.hallbathmultisensortamper", "on") %}true{% endif %}'
- platform: template
value_template: '{% if is_state("binary_sensor.gunsafestatus", "on") %}true{% endif %}'
- platform: template
value_template: '{% if is_state("binary_sensor.hallbath_motion", "on") %}true{% endif %}'
- platform: template
value_template: '{% if is_state("binary_sensor.frontdoortamper", "on") %}true{% endif %}'
- platform: template
value_template: '{% if is_state("binary_sensor.sidedoortamper", "on") %}true{% endif %}'
- platform: template
value_template: '{% if is_state("binary_sensor.centralite_3320l_1099e14b_1_1280", "on") %}true{% endif %}'
- platform: template
value_template: '{% if is_state("binary_sensor.centralite_3326l_106cf116_1_1280", "on") %}true{% endif %}'
condition:
- condition: state
entity_id: alarm_control_panel.alarm
state: armed_away
action:
- entity_id: alarm_control_panel.alarm
service: alarm_control_panel.alarm_trigger
- id: '4313245674786'
alias: Trigger alarm while armed home
trigger:
- platform: template
value_template: '{% if is_state("binary_sensor.fdstatus", "on") %}true{% endif %}'
- platform: template
value_template: '{% if is_state("binary_sensor.sdstatus", "on") %}true{% endif %}'
- platform: template
value_template: '{% if is_state("binary_sensor.gunsafetamper", "on") %}true{% endif %}'
- platform: template
value_template: '{% if is_state("binary_sensor.hallbathmultisensortamper", "on") %}true{% endif %}'
- platform: template
value_template: '{% if is_state("binary_sensor.frontdoortamper", "on") %}true{% endif %}'
- platform: template
value_template: '{% if is_state("binary_sensor.sidedoortamper", "on") %}true{% endif %}'
condition:
- condition: state
entity_id: alarm_control_panel.alarm
state: armed_home
action:
- entity_id: alarm_control_panel.alarm
service: alarm_control_panel.alarm_trigger
- id: '1324567846345'
alias: Send notification when alarm triggered
trigger:
- platform: state
entity_id: alarm_control_panel.alarm
to: triggered
action:
# -service: camera.snapshot
# data:
# entity_id: camera.living_room
# filename: "/home/homeassistant/.homeassistant/snapshots/lr1.jpg"
- service: shell_command.getsnaps
- service: notify.email_residents
data:
title: ALARM SYSTEM TRIGGERED
message: ATTENTION!! The alarm system has been triggered.
data:
images:
- /home/homeassistant/.homeassistant/www/snapshots/driveway.jpg
- /home/homeassistant/.homeassistant/www/snapshots/livingroom.jpg
- /home/homeassistant/.homeassistant/www/snapshots/sidedoor.jpg
- id: '1533860122074'
alias: Disarm alarm when deadbolt unlocked
trigger:
- platform: state
entity_id: sensor.kwikset_touchpad_electronic_deadbolt_alarm_type
to: '22'
action:
- service: alarm_control_panel.alarm_disarm
data:
entity_id: alarm_control_panel.alarm
code: !secret alarm_code
- id: '1589429602672'
alias: Silence sirens when alarm is disarmed or rearmed
trigger:
- platform: state
entity_id: alarm_control_panel.alarm
to: disarmed
- platform: state
entity_id: alarm_control_panel.alarm
to: armed_home
- platform: state
entity_id: alarm_control_panel.alarm
to: armed_away
action:
- service: homeassistant.turn_off
entity_id: switch.everspring_se812_siren_switch
- id: '7926165970272'
alias: Sound sirens when alarm is triggered
trigger:
- platform: state
entity_id: alarm_control_panel.alarm
to: triggered
action:
- service: homeassistant.turn_on
entity_id: switch.everspring_se812_siren_switch
- id: '4685773456356'
alias: Auto bathroom fan shutoff
trigger:
- platform: numeric_state
entity_id: sensor.vision_zp3111_multisensor_4in1_relative_humidity
below: 60
- platform: state
entity_id: switch.ge_45609_onoff_relay_switch_switch_3
to: 'on'
for:
minutes: 5
condition:
- condition: numeric_state
entity_id: sensor.vision_zp3111_multisensor_4in1_relative_humidity
below: 60
- condition: state
entity_id: switch.ge_45609_onoff_relay_switch_switch_3
state: 'on'
for:
minutes: 5
action:
- service: homeassistant.turn_off
entity_id: switch.ge_45609_onoff_relay_switch_switch_3
- service: homeassistant.turn_off
entity_id: switch.ge_45609_onoff_relay_switch_switch_3
- service: homeassistant.turn_off
entity_id: switch.ge_45609_onoff_relay_switch_switch_3
- id: '2345677453356'
alias: Auto bathroom fan
trigger:
- platform: numeric_state
entity_id: sensor.vision_zp3111_multisensor_4in1_relative_humidity
above: 65
action:
- service: homeassistant.turn_on
entity_id: switch.ge_45609_onoff_relay_switch_switch_3
- service: homeassistant.turn_on
entity_id: switch.ge_45609_onoff_relay_switch_switch_3
- service: homeassistant.turn_on
entity_id: switch.ge_45609_onoff_relay_switch_switch_3
- id: '3265923752362'
alias: Reset HVAC Filter Last Changed
trigger:
- platform: state
entity_id: input_boolean.hvac_filter
to: 'on'
action:
- service: input_datetime.set_datetime
data_template:
entity_id: input_datetime.hvac_filter_last_changed
time: '{{ (as_timestamp(now()) | timestamp_custom("%H:%M:%S", true)) }}'
date: '{{ (as_timestamp(now()) | timestamp_custom("%Y-%m-%d", true)) }}'
- service: input_boolean.turn_off
data:
entity_id: input_boolean.hvac_filter