-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathautomations.yaml
823 lines (820 loc) · 20.8 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
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
- id: '1612949304955'
alias: Notification - Internet lost
description: ''
trigger:
- platform: state
to: 'off'
entity_id: binary_sensor.internet_connection
from: 'on'
condition: []
action:
- service: notify.mobile_app_sm_g9860
data:
message: Internet connection was lost for a while
mode: single
- id: '1604939660805'
alias: Automate - Mute media on phone call
description: ''
trigger:
- platform: state
entity_id: sensor.sm_g9860_phone_state
to: ringing
id: in_call
from: idle
- platform: state
entity_id: sensor.sm_g9860_phone_state
to: offhook
id: in_call
from: idle
- platform: state
entity_id: sensor.sm_g9860_phone_state
to: idle
id: idle
- platform: state
entity_id:
- sensor.sm_g9860_audio_mode
from: normal
to: ringing
id: in_call
- platform: state
entity_id:
- sensor.sm_g9860_audio_mode
to: normal
from: in_call
id: idle
condition:
- condition: state
entity_id: person.oleksandr
state: home
action:
- choose:
- conditions:
- condition: trigger
id: in_call
sequence:
- service: media_player.media_pause
target:
entity_id:
- media_player.kitchen_speaker
- media_player.sony_bravia_tv
- media_player.soundbar
data: {}
- service: media_player.volume_mute
data:
is_volume_muted: true
target:
entity_id: media_player.unnamed_device
- conditions:
- condition: trigger
id: idle
sequence:
- service: media_player.volume_mute
data:
is_volume_muted: false
target:
entity_id:
- media_player.unnamed_device
- service: media_player.media_play
target:
entity_id:
- media_player.sony_bravia_tv
- media_player.soundbar
- media_player.kitchen_speaker
data: {}
default: []
mode: single
- id: '1613122825694'
alias: Light - Tambur
description: ''
trigger:
- type: motion
platform: device
device_id: fbd4f134ea563fe78c23306dac509515
entity_id: binary_sensor.tambur_motion
domain: binary_sensor
condition: []
action:
- type: turn_on
device_id: ed7f99e54ea492c992961028be5b150f
entity_id: light.tambur
domain: light
- wait_for_trigger:
- type: no_motion
platform: device
device_id: fbd4f134ea563fe78c23306dac509515
entity_id: binary_sensor.tambur_motion
domain: binary_sensor
for:
hours: 0
minutes: 2
seconds: 0
milliseconds: 0
- type: turn_off
device_id: ed7f99e54ea492c992961028be5b150f
entity_id: light.tambur
domain: light
mode: restart
- id: '1613123012403'
alias: Light - Corridor
description: ''
trigger:
- type: opened
platform: device
device_id: 36882a38eec93e2f395226698077e7b1
entity_id: binary_sensor.lumi_lumi_sensor_magnet_aq2_on_off
domain: binary_sensor
condition: []
action:
- choose:
- conditions:
- type: is_occupied
condition: device
device_id: fbd4f134ea563fe78c23306dac509515
entity_id: binary_sensor.tambur_occupancy
domain: binary_sensor
sequence:
- type: turn_on
device_id: 4ea55371c191f9a8c3fa6299ab0962e5
entity_id: light.corridor
domain: light
- wait_for_trigger:
- type: not_opened
platform: device
device_id: 36882a38eec93e2f395226698077e7b1
entity_id: binary_sensor.lumi_lumi_sensor_magnet_aq2_on_off
domain: binary_sensor
for:
hours: 0
minutes: 2
seconds: 0
milliseconds: 0
continue_on_timeout: false
- type: turn_off
device_id: 4ea55371c191f9a8c3fa6299ab0962e5
entity_id: light.corridor
domain: light
default:
- wait_for_trigger:
- type: not_opened
platform: device
device_id: 36882a38eec93e2f395226698077e7b1
entity_id: binary_sensor.lumi_lumi_sensor_magnet_aq2_on_off
domain: binary_sensor
for:
hours: 0
minutes: 2
seconds: 0
milliseconds: 0
continue_on_timeout: false
- type: turn_off
device_id: 4ea55371c191f9a8c3fa6299ab0962e5
entity_id: light.corridor
domain: light
mode: restart
- id: '1613123951160'
alias: 'Announce - Twitch '
description: Twitch stream announces on speaker
trigger:
- platform: state
entity_id: sensor.twitch_guit88man, sensor.twitch_cahchec, sensor.twitch_unclebjorn,
sensor.twitch_silvername, sensor.twitch_lenagol0vach, sensor.twitch_verni_shavermy
to: streaming
for: 0:00:30
condition:
- condition: and
conditions:
- condition: device
device_id: d086754273f9ac4fe74073de26ecd1db
domain: alarm_control_panel
entity_id: alarm_control_panel.alarmo
type: is_disarmed
- condition: state
entity_id: input_boolean.mode_guests
state: 'off'
- condition: state
entity_id: person.oleksandr
state: home
action:
- service: notify.announce
data:
message: "Hey! {% if (trigger.to_state.attributes.pronunciation != Null) -%}\n
\ {{ trigger.to_state.attributes.pronunciation }} \n{%- else -%}\n {{ trigger.to_state.attributes.friendly_name
}}\n{%- endif %} has started streaming {{ trigger.to_state.attributes.game
}} on twitch tv"
mode: single
- id: '1613124857885'
alias: Notification - Utility Meters Reminder
description: ''
trigger:
- platform: state
entity_id: calendar.alexkas2_gmail_com
to: 'on'
condition: []
action:
- choose:
- conditions:
- condition: template
value_template: '{{ trigger.to_state.attributes.description == "gas_meter"
}}'
sequence:
- service: notify.telegram
data:
title: "\U0001F525 Utility Meters Reminder"
message: Do not forget to report Gas meter value - {{ states('sensor.total_used_gas')
}}
- conditions:
- condition: template
value_template: '"{{ now().day == 15}}"'
sequence:
- service: notify.telegram
data:
title: "\U0001F4A7 Utility Meters Reminder"
message: Do not forget to report Water meters value
default: []
mode: single
- id: '1613125278142'
alias: Notification - Washing
description: ''
trigger:
- type: power
platform: device
device_id: e10bdfca6d169338d8cfabbcbb0cd91b
entity_id: sensor.plug_toilet_electrical_measurement
domain: sensor
id: washing_started
above: 5
- platform: numeric_state
entity_id: counter.washes
above: '15'
id: cleaning
condition: []
action:
- choose:
- conditions:
- condition: trigger
id: washing_started
sequence:
- service: input_boolean.turn_on
data: {}
entity_id: input_boolean.washing
- wait_for_trigger:
- type: power
platform: device
device_id: e10bdfca6d169338d8cfabbcbb0cd91b
entity_id: sensor.plug_toilet_electrical_measurement
domain: sensor
below: 5
for:
hours: 0
minutes: 0
seconds: 30
milliseconds: 0
timeout: 03:00:00
- service: input_boolean.turn_off
data: {}
entity_id: input_boolean.washing
- service: notify.telegram
data:
message: Washing has been finished!
title: Washing Machine
- service: counter.increment
target:
entity_id: counter.washes
- conditions:
- condition: trigger
id: cleaning
sequence:
- service: notify.telegram
data:
title: Washing Machine
message: Cleaning is required, turn on Samsung Eco Tub Clean program.
default: []
mode: single
- id: '1613163512382'
alias: Automate - Livingroom Computer
description: ''
trigger:
- platform: state
entity_id: switch.pc
id: 'on'
from: 'off'
to: 'on'
- platform: state
entity_id: switch.livingroom_pc_wol
id: 'off'
from: 'on'
to: 'off'
condition: []
action:
- choose:
- conditions:
- condition: trigger
id: 'on'
sequence:
- if:
- condition: device
device_id: 745d26659dbaf63767790c478ea6288d
domain: media_player
entity_id: media_player.sony_bravia_tv
type: is_off
then:
- type: turn_on
device_id: 745d26659dbaf63767790c478ea6288d
entity_id: remote.sony_bravia_tv
domain: remote
- wait_for_trigger:
- platform: device
device_id: 745d26659dbaf63767790c478ea6288d
domain: media_player
entity_id: media_player.sony_bravia_tv
type: turned_on
for:
hours: 0
minutes: 0
seconds: 30
- service: media_player.select_source
target:
device_id: 745d26659dbaf63767790c478ea6288d
data:
source: HDMI 3/ARC
- repeat:
count: 2
sequence:
- service: media_player.select_source
data:
source: HDMI
target:
entity_id:
- media_player.lg_soundbar_4d27e0b6_59a5_46fc_b94e_372f35e6eb81
- service: media_player.select_sound_mode
data:
sound_mode: Standard
target:
entity_id:
- media_player.lg_soundbar_4d27e0b6_59a5_46fc_b94e_372f35e6eb81
- conditions:
- condition: trigger
id: 'off'
sequence:
- service: media_player.select_source
data:
source: Optical/HDMI ARC
target:
entity_id:
- media_player.lg_soundbar_4d27e0b6_59a5_46fc_b94e_372f35e6eb81
- wait_for_trigger:
- type: power
platform: device
device_id: 62e3dc51c8003849b745749a5717e4c4
entity_id: sensor.plug_livingroom_electrical_measurement
domain: sensor
below: 10
continue_on_timeout: true
timeout: 00:05:00
- type: turn_off
device_id: 62e3dc51c8003849b745749a5717e4c4
entity_id: switch.plug_livingroom_on_off
domain: switch
default: []
mode: restart
- id: '1615888678577'
alias: Alert - Unsufficient space on Nuc drive
description: ''
trigger:
- platform: numeric_state
entity_id: sensor.nuc_used_percent
above: '90'
for:
hours: 0
minutes: 1
seconds: 0
milliseconds: 0
condition: []
action:
- service: notify.mobile_app_sm_g9860
data:
title: ⚠️ Warning!
message: Unsofficient space left on Nuc dive.
data:
channel: Alerts
importance: max
color: red
- service: notify.telegram
data:
title: ⚠️ Warning!
message: Unsofficient space left on Nuc dive.
mode: single
- id: '1625646004211'
alias: Light - WLED TV
description: ''
trigger:
- platform: state
entity_id: light.livingroom_tv
condition: []
action:
- choose:
- conditions:
- condition: device
type: is_off
device_id: 7ecc2fb00b7df9abf5a754e10b4f7488
entity_id: light.livingroom_tv
domain: light
- condition: device
type: is_on
device_id: de7fc2bbbf74f16d2d2d84ad41e7f03e
entity_id: light.wled
domain: light
sequence:
- type: turn_off
device_id: de7fc2bbbf74f16d2d2d84ad41e7f03e
entity_id: light.wled
domain: light
- conditions:
- condition: device
type: is_on
device_id: 7ecc2fb00b7df9abf5a754e10b4f7488
entity_id: light.livingroom_tv
domain: light
- condition: device
type: is_off
device_id: de7fc2bbbf74f16d2d2d84ad41e7f03e
entity_id: light.wled
domain: light
sequence:
- type: turn_on
device_id: de7fc2bbbf74f16d2d2d84ad41e7f03e
entity_id: light.wled
domain: light
default: []
mode: single
- id: '1627630032807'
alias: Notification - New Wi-Fi device in network
trigger:
- platform: event
event_type: entity_registry_updated
event_data:
action: create
condition:
- condition: template
value_template: '{{trigger.event.data.entity_id.startswith(''device_tracker'')}}
'
action:
- variables:
entity:
'[object Object]':
- service: persistent_notification.create
data:
title: 'New device registered: {{state_attr(entity,''friendly_name'')}}'
message: 'Entity: {{entity}} Host: {{state_attr(entity,''host_name'')}} Ip:
{{state_attr(entity,''ip'')}} Mac-address: {{state_attr(entity,''mac'')}}
Full data: {{trigger.event.data}}
'
- service: notify.telegram
data_template:
message: 'Host: {{state_attr(entity,''host_name'')}} Ip: {{state_attr(entity,''ip'')}}
'
title: "\U0001F4F1 New device connected to Wi-Fi network!"
mode: queued
max: 10
- id: '1628081966719'
alias: Service - Push config to Github
description: ''
trigger:
- platform: time
at: '23:59:00'
condition:
- condition: time
weekday:
- sat
action:
- service: shell_command.push_to_github
data: {}
- wait_for_trigger:
- platform: state
entity_id:
- binary_sensor.push_to_github_failed
to: 'on'
timeout: 00:02:00
continue_on_timeout: false
- service: notify.persistent_notification
data:
message: Github push failed!
mode: single
- id: '1631273652133'
alias: Light - Toilet
description: ''
trigger:
- type: motion
platform: device
device_id: 228913f20d4a81b754aafc522d776c5e
entity_id: binary_sensor.toilet_ias_zone
domain: binary_sensor
condition:
- condition: not
conditions:
- condition: device
device_id: d086754273f9ac4fe74073de26ecd1db
domain: alarm_control_panel
entity_id: alarm_control_panel.alarmo
type: is_armed_night
action:
- type: turn_on
device_id: 095f00f37cf8b0d04ac9893668ac504b
entity_id: light.toilet_light
domain: light
- wait_for_trigger:
- type: no_motion
platform: device
device_id: 228913f20d4a81b754aafc522d776c5e
entity_id: binary_sensor.toilet_ias_zone
domain: binary_sensor
for:
hours: 0
minutes: 2
seconds: 0
milliseconds: 0
- type: turn_off
device_id: 095f00f37cf8b0d04ac9893668ac504b
entity_id: light.toilet_light
domain: light
mode: restart
- id: '1631274616469'
alias: Light - Kitchen
description: ''
trigger:
- type: no_motion
platform: device
device_id: 9cde2b2446ba215221b0e9805d7902c0
entity_id: binary_sensor.lumi_lumi_sensor_motion_aq2_ias_zone
domain: binary_sensor
for:
hours: 0
minutes: 3
seconds: 0
milliseconds: 0
id: clear
- type: motion
platform: device
device_id: 9cde2b2446ba215221b0e9805d7902c0
entity_id: binary_sensor.lumi_lumi_sensor_motion_aq2_ias_zone
domain: binary_sensor
id: motion
condition: []
action:
- choose:
- conditions:
- condition: trigger
id: clear
sequence:
- service: light.turn_off
target:
area_id: kukhnia
- conditions:
- condition: trigger
id: motion
- condition: sun
after: sunset
sequence:
- service: light.turn_on
target:
entity_id: light.kitchen
default: []
mode: restart
- id: '1631868006395'
alias: Automate - Shades
description: ''
trigger:
- platform: sun
event: sunrise
id: sunrise
- platform: sun
event: sunset
id: sunset
condition: []
action:
- choose:
- conditions:
- condition: trigger
id: sunrise
- condition: device
device_id: 6e892c6dd3ea17853207ee0d3872f892
domain: cover
entity_id: cover.kitchen_shades_right
type: is_closed
sequence:
- service: cover.open_cover
target:
device_id:
- 6e892c6dd3ea17853207ee0d3872f892
- conditions:
- condition: trigger
id: sunset
- condition: device
device_id: 6e892c6dd3ea17853207ee0d3872f892
domain: cover
entity_id: cover.kitchen_shades_right
type: is_open
sequence:
- service: cover.close_cover
target:
device_id:
- 6e892c6dd3ea17853207ee0d3872f892
default: []
mode: single
- id: '1633446553886'
alias: Announce - Sunset
description: ''
trigger:
- platform: sun
event: sunset
condition: []
action:
- service: media_player.play_media
target:
device_id: a3af181ce3e9d1acb3dffaad60232da3
data:
media_content_id: /media/local/serious-strike-533.mp3
media_content_type: music
mode: single
- id: '1636105729076'
alias: Notification - Unexpected Shutdown
description: ''
trigger:
- platform: homeassistant
event: start
id: start
- platform: homeassistant
event: shutdown
id: stop
condition: []
action:
- choose:
- conditions:
- condition: trigger
id: stop
sequence:
- service: input_boolean.turn_off
target:
entity_id: input_boolean.unexpected_shutdown
- conditions:
- condition: trigger
id: start
- condition: state
entity_id: input_boolean.unexpected_shutdown
state: 'on'
sequence:
- service: notify.telegram
data:
message: ⚡ Unexpected Home Assistant shutdown detected!
title: Warning!
default:
- service: input_boolean.turn_on
target:
entity_id: input_boolean.unexpected_shutdown
mode: single
- id: '1637317509321'
alias: Automate - NFC tags
description: ''
trigger:
- platform: tag
tag_id: dfb7b66d-e498-4f5f-8deb-d7aefb9d493f
id: toilet_light
condition: []
action:
- choose:
- conditions:
- condition: trigger
id: toilet_light
sequence:
- service: automation.toggle
target:
entity_id: automation.light_toilet
data: {}
default: []
mode: single
- id: '1640355945570'
alias: Check and Reload Tuya Integration
trigger:
- platform: event
event_type: system_log_event
event_data:
level: ERROR
name: tuya_iot
condition:
- condition: template
value_template: '{{ "error while get mqtt config" in trigger.event.data.message[0]
}}'
action:
- service: homeassistant.reload_config_entry
data: {}
target:
entity_id: sensor.wifi_smart_meter_phase_a_current
- id: '1641822766128'
alias: Automate - Update duckdns IP
description: ''
trigger:
- platform: state
entity_id: sensor.publicip
condition:
- condition: not
conditions:
- condition: state
entity_id: sensor.publicip
state: Unknown
action:
- service: shell_command.update_duckdns_ip
data:
domains: ddns_domains
mode: restart
- id: '1652775385405'
alias: Alarm
description: ''
trigger:
- platform: state
entity_id:
- alarm_control_panel.alarmo
from: armed_away
to: disarmed
id: back_home
- platform: tag
tag_id: 9f6c5b4b-8043-4039-bf94-9137afcde918
id: disarm
condition: []
action:
- choose:
- conditions:
- condition: trigger
id: back_home
- condition: sun
after: sunset
sequence:
- service: light.turn_on
data: {}
target:
entity_id:
- light.livingroom_tv
- light.wled
- conditions:
- condition: trigger
id: disarm
sequence:
- device_id: d086754273f9ac4fe74073de26ecd1db
domain: alarm_control_panel
entity_id: alarm_control_panel.alarmo
type: disarm
default: []
mode: single
- id: '1654622464571'
alias: Send ip
description: ''
trigger:
- platform: state
entity_id:
- sensor.publicip
condition: []
action:
- service: notify.telegram
data:
message: '{{ states.sensor.publicip.state }}'
mode: single
- id: '1657138273474'
alias: Light - Bedroom
description: ''
trigger:
- platform: device
type: turned_on
device_id: 5989dacae735a89e727cb741694f36ac
entity_id: light.light_bedroom_main
domain: light
for:
hours: 0
minutes: 10
seconds: 0
- platform: device
type: turned_on
device_id: 5989dacae735a89e727cb741694f36ac
entity_id: light.light_bedroom_spotlight
domain: light
for:
hours: 0
minutes: 10
seconds: 0
condition:
- condition: state
entity_id: input_boolean.mode_guests
state: 'off'
- type: is_no_motion
condition: device
device_id: d200b3ca3a4c78c0c78a317b8fa18051
entity_id: binary_sensor.ble_motion_nightlight
domain: binary_sensor
for:
hours: 0
minutes: 5
seconds: 0
action:
- service: light.turn_off
data: {}
target:
device_id: 5989dacae735a89e727cb741694f36ac
mode: restart