-
Notifications
You must be signed in to change notification settings - Fork 0
/
automations.yaml
424 lines (421 loc) · 10.9 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
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
- id: '1611491912935'
alias: ' 03 [NOTIFY] Mobile call'
description: ''
trigger:
- platform: state
entity_id: sensor.huawei_p30_pro_sostoianie_telefona
from: idle
to: ringing
condition:
- condition: state
entity_id: person.dima2
state: home
action:
- service: notify.mobile_app_macbook_pro
data:
message: Звонок на мобильный
mode: single
- id: '1611492768317'
alias: 03 [NOTIFY] Low battery Huawei
description: ''
trigger:
- platform: state
entity_id: sensor.huawei_p30_pro_uroven_zariada_akkumuliatora
condition:
- condition: numeric_state
entity_id: sensor.huawei_p30_pro_uroven_zariada_akkumuliatora
below: '30'
- condition: and
conditions:
- condition: state
entity_id: person.dima2
state: home
- condition: and
conditions:
- condition: state
entity_id: input_boolean.mode_do_not_disturb
state: 'false'
action:
- service: notify.mobile_app_macbook_pro
data:
message: Низкий уровень аккумулятора Huawei
- service: notify.lgtv
data:
message: Низкий уровень заряда Huawei
mode: single
- id: '1611493805597'
alias: 02 Disable few automations on do not disturb
description: ''
trigger:
- platform: state
entity_id: input_boolean.mode_do_not_disturb
condition: []
action:
- choose:
- conditions:
- condition: state
entity_id: input_boolean.mode_do_not_disturb
state: 'on'
sequence:
- service: automation.turn_off
data: {}
entity_id: automation.notify_low_battery_huawei
- service: automation.turn_off
data: {}
entity_id: automation.notify_mobile_call
- conditions:
- condition: state
entity_id: input_boolean.mode_do_not_disturb
state: 'off'
sequence:
- service: automation.turn_on
data: {}
entity_id: automation.notify_low_battery_huawei
- service: automation.turn_on
data: {}
entity_id: automation.notify_mobile_call
default: []
mode: single
- id: '1611641982867'
alias: Test battery
description: ''
trigger:
- platform: state
entity_id: sensor.huawei_p30_pro_uroven_zariada_akkumuliatora
condition: []
action:
- service: notify.mobile_app_macbook_pro
data:
message: Huawei Battery Change
mode: single
- id: '1611845196215'
alias: 03 [NOTIFY] Entrance opened
description: ''
trigger:
- platform: state
entity_id: binary_sensor.entrance
from: 'off'
to: 'on'
condition: []
action:
- service: notify.mobile_app_macbook_pro
data:
message: Входная дверь открыта!
mode: single
- id: '1611945280719'
alias: Test TTS
description: ''
trigger:
- platform: state
entity_id: binary_sensor.macbook_pro_active
from: 'off'
to: 'on'
condition:
- condition: state
entity_id: calendar.due_today
state: 'on'
- condition: and
conditions:
- condition: time
before: '22:00:00'
after: '10:00:00'
weekday:
- mon
- tue
- wed
- thu
- fri
- sat
- sun
action:
- service: tts.yandextts_say
data:
entity_id: media_player.komnata_2_display
message: '{% for task in state_attr(''calendar.due_today'', ''all_tasks'') %}
{{ task }} {% endfor %}
'
mode: single
- id: '1612013258405'
alias: 05 Turn Display Off
description: ''
trigger:
- platform: time_pattern
minutes: /10
- platform: state
entity_id: binary_sensor.macbook_pro_active
from: 'on'
to: 'off'
condition:
- condition: state
entity_id: binary_sensor.macbook_pro_active
state: 'off'
- condition: time
after: '23:00:00'
before: 09:00:00
- condition: state
entity_id: binary_sensor.desktop_vika
state: 'off'
action:
- type: turn_off
device_id: 7f98bc1e1e4d592c02833e9f12e1ef31
entity_id: switch.z2m_power_xiaomi
domain: switch
mode: single
- id: '1612013541759'
alias: 05 Turn Display On
description: ''
trigger:
- platform: state
entity_id: binary_sensor.macbook_pro_active
from: 'off'
to: 'on'
- platform: time
at: '10:00'
condition: []
action:
- type: turn_on
device_id: 7f98bc1e1e4d592c02833e9f12e1ef31
entity_id: switch.z2m_power_xiaomi
domain: switch
mode: single
- id: '1612020824302'
alias: 04 Water Leak Alarm
description: ''
trigger:
- platform: state
from: 'off'
to: 'on'
entity_id: group.leak_sensors
condition: []
action:
- service: notify.mobile_app_macbook_pro
data:
message: 'Протечка {% for entity_id in states.group.leak_sensors.attributes.entity_id
%} {% if states(entity_id) == ''on'' %} {{ states[entity_id].name }} {% endif
%} {% endfor %}
'
- service: timer.start
data: {}
entity_id: timer.alarm
mode: single
- id: '1612108313218'
alias: 04 On Leak Alarm Timer
description: ''
trigger:
- platform: event
event_type: timer.finished
event_data:
entity_id: timer.alarm
condition:
- condition: state
entity_id: group.leak_sensors
state: 'on'
action:
- service: timer.start
data: {}
entity_id: timer.alarm
- service: notify.mobile_app_macbook_pro
data:
message: 'Протечка {% for entity_id in states.group.leak_sensors.attributes.entity_id
%} {% if states(entity_id) == ''on'' %} {{ states[entity_id].name }} {% endif
%} {% endfor %}
'
mode: single
- id: '1612113635544'
alias: 01 [TION] Switch off breeser when smoke is detected
description: ''
trigger:
- platform: numeric_state
entity_id: sensor.xiaomi_miio_pm25sensor
above: '10'
condition:
- condition: and
conditions:
- condition: not
conditions:
- condition: state
entity_id: climate.tion_breezer_3s_1
state: 'off'
action:
- service: climate.set_fan_mode
data:
fan_mode: 0
entity_id: climate.tion_breezer_3s_1
- service: timer.start
data: {}
entity_id: timer.tion
- service: notify.mobile_app_macbook_pro
data:
message: Соседи курят, выключаю вентиляцию
- service: notify.lgtv
data:
message: Соседи курят, выключаю вентиляцию
- service: notify.dima_telegram
data:
message: Smoke detected, shut down breeser for 10 munutes
mode: single
- id: '1612115080353'
alias: 01 [TION] Switch on breeser after timeout
description: ''
trigger:
- platform: event
event_type: timer.finished
event_data:
entity_id: timer.tion
condition: []
action:
- service: climate.set_fan_mode
data:
fan_mode: 1
entity_id: climate.tion_breezer_3s_1
- service: notify.mobile_app_macbook_pro
data:
message: Включаю вентиляцию
- service: notify.lgtv
data:
message: Включаю вентиляцию
- service: notify.dima_telegram
data:
message: Breeser switched on after 10 minute smoke shutdown
mode: single
- id: '1612117682978'
alias: 01 [TION] Notify when PM25 stopped updates
description: ''
trigger:
- platform: template
value_template: '{{as_timestamp(now()) - as_timestamp(states.sensor.xiaomi_miio_pm25sensor.last_updated)>600}}'
condition: []
action:
- service: notify.mobile_app_macbook_pro
data:
message: 'Error: PM2.5 does not update its state after 10 minutes'
- service: notify.dima_telegram
data:
message: 'Error: PM2.5 does not update its state after 10 minutes'
mode: single
- id: '1612123425054'
alias: 03 [NOTIFY] New supervisor version
description: ''
trigger:
- platform: state
entity_id: sensor.supervisor_version
condition: []
action:
- service: notify.dima_telegram
data:
message: Supervisor updated from {{ trigger.from_state.state }} to {{ trigger.to_state.state
}}
mode: single
- id: '1612169271675'
alias: 01 [TION] Switch on breeser after a sudden outage
description: Detect breeser speed and restart breeser if it was suddenly switched
off
trigger:
- platform: template
value_template: '{{states.sensor.tion_breezer_3s_1_speed.state|int == 0 and (as_timestamp(now())
- as_timestamp(states.sensor.tion_breezer_3s_1_speed.last_updated)>900)}}'
condition: []
action:
- service: climate.set_fan_mode
data:
fan_mode: 1
gate: 2
entity_id: climate.tion_breezer_3s_1
- service: notify.dima_telegram
data:
message: Breeser was restarted due to a sudden outage
mode: single
- id: '1612603099082'
alias: 01 [TION] set offline status when not updated
description: ''
trigger:
- platform: template
value_template: '{{as_timestamp(now()) - as_timestamp(states.sensor.magicair_co2.last_updated)>300}}'
condition: []
action:
- service: input_select.select_option
data:
option: offline
entity_id: input_select.tion_3s_status_dropdown
mode: single
- id: '1612603168948'
alias: 01 [TION] Set online status when updated
description: ''
trigger:
- platform: state
entity_id: sensor.magicair_co2
- platform: state
entity_id: sensor.tion_breezer_3s_1_speed
- platform: state
entity_id: sensor.tion_breezer_3s_1_temp
condition: []
action:
- service: input_select.select_option
data:
entity_id: input_select.tion_3s_status_dropdown
option: online
mode: single
- id: '1612619819428'
alias: 01 [TION] Notify when tion went offline
description: ''
trigger:
- platform: state
entity_id: input_select.tion_3s_status_dropdown
to: offline
from: online
condition: []
action:
- service: notify.dima_telegram
data:
message: Tion breeser went offline
mode: single
- id: '1612629251447'
alias: 02 Do not disturb
description: Activate DnD mode during night hours or when a children's door is closed
trigger:
- platform: time_pattern
minutes: /1
- platform: state
entity_id: binary_sensor.door_masha
condition: []
action:
- choose:
- conditions:
- condition: state
entity_id: binary_sensor.door_masha
state: 'off'
sequence:
- service: input_boolean.turn_on
data: {}
entity_id: input_boolean.mode_do_not_disturb
- conditions:
- condition: time
after: '23:00:00'
before: 09:00:00
sequence:
- service: input_boolean.turn_on
data: {}
entity_id: input_boolean.mode_do_not_disturb
- conditions:
- condition: time
after: 09:00
before: '23:00'
sequence:
- service: input_boolean.turn_off
data: {}
entity_id: input_boolean.mode_do_not_disturb
default: []
mode: single
- id: '1612705194340'
alias: 03 [NOTIFY] Masha door
description: ''
trigger:
- platform: state
entity_id: binary_sensor.door_masha
to: 'on'
condition: []
action:
- service: notify.lgtv
data:
message: Дверь у Маши открыта!
mode: single