-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathautomations.yaml
575 lines (575 loc) · 13.7 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
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
- id: '1567289422720'
alias: Turn kitchen lights off when there's no movement
trigger:
- entity_id:
- group.kitchen_motion
for:
hours: 0
minutes: 10
seconds: 0
platform: state
to: 'off'
condition: []
action:
- data: {}
service: homeassistant.turn_off
target:
entity_id:
- light.kitchen_light
- light.kitchen_hue_lightstrip
mode: single
- id: '1567300664723'
alias: Turn on bedroom light when it's off and movement is detected
trigger:
- entity_id: binary_sensor.bedroom_motion_sensor
platform: state
to: 'on'
condition:
- condition: state
entity_id: light.bedroom_lightstrip
state: 'off'
- after: '12:00'
before: '22:00'
condition: time
weekday:
- mon
- tue
- wed
- thu
- fri
action:
- data:
brightness: 255
effects:
rgb_color:
- 255
- 255
- 255
entity_id: light.bedroom_lightstrip
service: light.turn_on
mode: single
- id: '1568550564022'
alias: Open the gate
trigger:
- event_data: {}
event_type: ifttt_webhook_received
platform: event
condition: []
action:
- service: rest_command.open_the_gate
- id: '1570324760268'
alias: Turn off bedroom lightstrip
trigger:
- entity_id: binary_sensor.bedroom_motion_sensor
for: 00:30:00
platform: state
to: 'off'
condition:
- condition: state
entity_id: media_player.bedroom_tv
state: 'off'
action:
- data:
entity_id: light.bedroom_light_strip
service: light.turn_off
- id: '1570328298655'
alias: Clean the bedroom
trigger:
- entity_id: automation.clean_the_bedroom
platform: state
to: 'on'
condition: []
action:
- data:
entity_id: vacuum.xiaomi_vacuum_cleaner
repeats: 1
zone:
- - 19089
- 20790
- 23789
- 23990
service: xiaomi_miio.vacuum_clean_zone
- data:
entity_id: automation.clean_the_bedroom
service: automation.turn_off
- id: '1570358213190'
alias: Clean the small bedroom
trigger:
- entity_id: automation.clean_the_small_bedroom
platform: state
to: 'on'
condition: []
action:
- data:
entity_id: vacuum.xiaomi_vacuum_cleaner
repeats: 1
zone:
- - 18997
- 24020
- 22947
- 26820
service: xiaomi_miio.vacuum_clean_zone
- data:
entity_id: automation.clean_the_small_bedroom
service: automation.turn_off
- id: '1571593269645'
alias: Clean the hallway
description: Clean the hallway
trigger:
- entity_id: automation.clean_the_hallway
platform: state
to: 'on'
condition: []
action:
- data:
entity_id: vacuum.xiaomi_vacuum_cleaner
repeats: 1
zone:
- - 26142
- 24168
- 28092
- 26868
service: xiaomi_miio.vacuum_clean_zone
- data:
entity_id: automation.clean_the_hallway
service: automation.turn_off
- id: '1572226198480'
alias: Clean the air
description: ''
trigger:
- platform: template
value_template: '{{ state_attr(''fan.xiaomi_miio_device'', ''aqi'') > 20 }}'
condition: []
action:
- data:
entity_id: fan.xiaomi_miio_device
service: fan.turn_on
- data:
message: Cleaning the air
title: Air purifier
service: notify.notifier_name
- id: '1572227095028'
alias: Stop cleaning the air
description: ''
trigger:
- platform: template
value_template: '{{ state_attr(''fan.xiaomi_miio_device'', ''aqi'') < 5}}'
condition:
- condition: state
entity_id: fan.xiaomi_miio_device
state: 'on'
action:
- data:
entity_id: fan.xiaomi_miio_device
service: fan.turn_off
- data:
message: Stopped cleaning the air
title: Air purifier
service: notify.notifier_name
mode: single
- id: turn_on_office_lightstrip_with_hue_dimmer
alias: Turn on office lightstrip on 2nd button press
trigger:
- entity_id: sensor.hallway_remote_2
platform: state
to: up-press
condition: []
action:
- data: {}
entity_id:
- light.office_lightstrip
service: light.turn_on
initial_state: true
- id: turn_on_office_lights_with_hue_dimmer
alias: Turn on all office lights on 2nd button hold
trigger:
- entity_id: sensor.hallway_remote_2
platform: state
to: up-hold
condition: []
action:
- data: {}
entity_id:
- light.office_lightstrip
- light.sonoffofficelight
service: light.turn_on
initial_state: true
- id: turn_off_office_lights_with_hue_dimmer
alias: Turn off all office lights on 3rd button press
trigger:
- entity_id: sensor.hallway_remote_2
platform: state
to: down-press
condition: []
action:
- data: {}
entity_id:
- light.office_lightstrip
- light.sonoffofficelight
service: light.turn_off
initial_state: true
- alias: Occupancy On
trigger:
- platform: numeric_state
entity_id: sensor.home_occupancy_confidence
above: 10
action:
- service: input_boolean.turn_on
data:
entity_id: input_boolean.occupancy
id: 52860eac50504ba58772ee37722ef112
- alias: Occupancy Off
trigger:
- platform: numeric_state
entity_id: sensor.home_occupancy_confidence
below: 10
action:
- service: input_boolean.turn_off
data:
entity_id: input_boolean.occupancy
id: 907bf99dbb624815895f6945ec6d1cda
- id: '1585235953471'
alias: Focus session started
trigger:
- event_data:
action: call_service
event_type: ifttt_webhook_received
platform: event
condition: []
action:
- data_template:
entity_id: '{{ trigger.event.data.entity_id }}'
service_template: '{{ trigger.event.data.service }}'
- id: '1585935657242'
alias: Notify when there's high CO2
description: ''
trigger:
- above: '1000'
entity_id: sensor.netatmo_home_weather_indoor_co2
platform: numeric_state
condition: []
action:
- data:
message: The CO2 levels are too high
title: CO2 alert
service: notify.mobile_app_s22ultra
- id: '1590191419164'
alias: Turn off hallway lights when there's no movement
description: ''
trigger:
- entity_id: binary_sensor.hallway_motion_sensor
for: 0:02:00
platform: state
to: 'off'
condition: []
action:
- data: {}
entity_id: group.hallway_lights
service: light.turn_off
- id: '1590191501920'
alias: Turn off living room lights when there's no movement
description: ''
trigger:
- entity_id: binary_sensor.living_room_motion_sensor
for: 0:25:00
platform: state
to: 'off'
condition: []
action:
- data: {}
entity_id: light.living_room_dining_table, light.living_room_couch_light
service: light.turn_off
mode: single
- id: '1591491635756'
alias: Turn on cooling
description: ''
trigger:
- event: sunrise
platform: sun
condition: []
action:
- event: test
event_data: {}
- id: '1591796134613'
alias: Turn on bedroom cooling
description: ''
trigger:
- event: sunrise
platform: sun
condition: []
action:
- event: bedroom-cooling
event_data: {}
- id: '1591796164041'
alias: Turn on living room cooling
description: ''
trigger:
- event: sunrise
platform: sun
condition: []
action:
- event: living-room-cooling
event_data: {}
- id: '1591803178990'
alias: Turn off cooling when temperature is below 23 degrees
description: ''
trigger:
- below: '23'
entity_id: sensor.average_temperature
platform: numeric_state
condition: []
action:
- data: {}
entity_id: climate.living_room_ac, climate.bedroom_ac
service: climate.turn_off
- id: '1591835253097'
alias: Turn off bedroom cooling when temperature is below 23
description: ''
trigger:
- below: '23'
entity_id: sensor.bedroom_temperature
platform: numeric_state
condition:
- condition: state
entity_id: climate.bedroom_ac
state: 'on'
action:
- data: {}
entity_id: climate.bedroom_ac
service: climate.turn_off
- id: '1591998397306'
alias: Bedroom camera motion
description: ''
trigger:
- platform: webhook
webhook_id: bedroom-motion
condition: []
action:
- data:
flash: short
rgb_color:
- 255
- 255
- 255
transition: '1'
entity_id: light.office_lightstrip
service: light.turn_on
- alias: Summary of the day
trigger:
- entity_id: sensor.netatmo_indoor_co2
for: 00:01:00
platform: numeric_state
below: '2000'
action:
- service: script.activate_alexa_actionable_notification
data_template:
text: Good morning Bogdan, do you want a summary of the day?
event_id: actionable_notification_office_summary
alexa_device: media_player.office_echo_dot
id: ffc31db11cf645f5a638f83ecfa555ee
- alias: Turn on lights when CO2 is high
trigger:
platform: event
event_type: alexa_actionable_notification
event_data:
event_id: actionable_notification_office_summary
event_response_type: ResponseYes
action:
- service: light.toggle
entity_id: light.office_lightstrip
id: f8956699007d4f73ace9fc528d868027
- id: '1593180043144'
alias: Turn on cooling when temperature is above 25 degrees
description: ''
trigger:
- above: '25'
entity_id: sensor.average_temperature
platform: numeric_state
condition:
- condition: state
entity_id: group.family
state: not_home
action:
- data: {}
service: script.apartment_cooling_on
- id: '1598910059807'
alias: Turn on energy saving
description: ''
trigger:
- entity_id: group.family
platform: state
to: not_home
- entity_id: input_select.bujdea_family
platform: state
to: Sleeping
condition:
- condition: state
entity_id: input_boolean.guest_mode
state: 'off'
action:
- scene: scene.living_room_power_saving
mode: single
- id: '1598969842878'
alias: Turn off energy saving
description: ''
trigger:
- entity_id: group.family
from: not_home
platform: state
to: home
- entity_id: input_select.bujdea_family
platform: state
to: Home
condition:
- condition: state
entity_id: input_select.bujdea_family
state: Home
action:
- scene: scene.living_room_power_on
mode: single
- id: '1602347565849'
alias: Tag Bedroom cleanup is scanned
description: ''
trigger:
- platform: tag
tag_id: a937d2a9-aa51-47d1-a7e9-44fdfd062764
condition: []
action:
- service: notify.mobile_app_s22ultra
data:
title: bedroom
message:
mode: single
- id: '1602722543718'
alias: Turn off office USB ports
description: ''
trigger:
- platform: time
at: input_datetime.office_switch_turn_off
condition:
- condition: not
conditions:
- condition: state
entity_id: binary_sensor.office_motion_sensor
state: 'on'
action:
- service: switch.turn_off
data: {}
entity_id: switch.office_switch_usb,switch.office_desk_usb_ports
mode: single
- id: '1640296335927'
alias: Open the garage door after 10 minutes
description: ''
trigger:
- platform: state
entity_id: binary_sensor.zigbee_garage_door_sensor_contact
to: 'on'
for:
hours: 0
minutes: 10
seconds: 0
milliseconds: 0
condition:
- condition: state
entity_id: binary_sensor.zigbee_garage_door_sensor_contact
state: 'on'
action:
- service: script.close_garage_door_with_switchbot
mode: restart
- id: '1688236616126'
alias: HA start notification
description: Send notification on Home Assistant start
trigger:
- platform: homeassistant
event: start
condition: []
action:
- service: notify.mobile_app_s22ultra
data:
title: Home Assistant is starting
message: Home Assistant is starting
mode: single
- id: '1688251089569'
alias: Volvo XC60 arrived home
description: ''
trigger:
- platform: state
entity_id:
- device_tracker.volvo_xc60_yv1uzh5v4p1357593_location
to: home
condition: []
action:
- service: notify.mobile_app_s22ultra
data:
message: Volvo XC60 is back home
title: Volvo XC60 is back home
- condition: numeric_state
entity_id: sensor.volvo_xc60_battery_charge_level
below: '50'
- service: notify.mobile_app_s22ultra
data:
title: You should charge the car
message: You should charge the car
mode: single
- id: '1688251137924'
alias: Volvo XC60 left home
description: ''
trigger:
- platform: state
entity_id:
- device_tracker.volvo_xc60_yv1uzh5v4p1357593_location
to: not_home
condition: []
action:
- service: notify.mobile_app_s22ultra
data:
title: Volvo XC60 left home
message: Volvo XC60 left home
mode: single
- id: '1688251228765'
alias: Notify when Volvo XC60 finished charging
description: ''
trigger:
- type: value
platform: device
device_id: 2b06598981dafb417b11af2255143e0a
entity_id: sensor.volvo_xc60_battery_charge_level
domain: sensor
above: 99
condition: []
action:
- service: notify.mobile_app_s22ultra
data:
message: Volvo XC60 finished charging
title: Volvo XC60 finished charging
mode: single
- id: '1688251128764'
alias: Update total electricity consumption
trigger:
- platform: time_pattern
minutes: 59
seconds: 59
action:
- service: var.set
target:
entity_id: var.volvo_electricity_total_consumption
data:
value: '{{ states(''var.volvo_electricity_total_consumption'') | float
+ states(''sensor.um_garage_power_hourly'') | float }}'
mode: single
- id: '1689251128764'
alias: Notify when car is unlocked for more than 2 minutes
trigger:
- platform: state
entity_id: lock.volvo_xc60_yv1uzh5v4p1357593_lock_status # Replace with your car lock entity
to: 'unlocked'
for:
minutes: 2
action:
- service: notify.mobile_app_s22ultra # Replace with your notifier name
data:
message: "Car has been unlocked for more than 2 minutes"
data:
actions:
- action: "LOCK_CAR"
title: "Lock Car"