-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
automations.yaml
2601 lines (2591 loc) · 74.3 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
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
- id: '1723064000855'
alias: 'System: Wake up Wall Tablet'
description: When someone walks the corridor, wake up the wall mounted tablet
trigger:
- type: occupied
platform: device
device_id: dfcd386fd2e5691c4b0ffa999431e34a
entity_id: 9be113192d401c74720384e7df35caa0
domain: binary_sensor
condition: []
action:
- alias: Wake up Wall Tablet
action: notify.mobile_app_wall_tablet
data:
title: "Прокинься \U0001F971"
message: Сповіщення, щоб планшет прокинувся.
- delay:
hours: 0
minutes: 0
seconds: 15
milliseconds: 0
mode: single
- id: '1723291053432'
alias: 'System: Charging Wall Tablet'
description: Handles charging for Wall Tablet, keeping battery level between 20-80%
trigger:
- platform: numeric_state
entity_id:
- sensor.wall_tablet_battery_level
above: 80
id: charged
- platform: numeric_state
entity_id:
- sensor.wall_tablet_battery_level
below: 20
id: discharged
condition: []
action:
- if:
- condition: trigger
id:
- discharged
then:
- action: switch.turn_on
metadata: {}
data: {}
target:
entity_id: switch.tablet_wall_socket_usb
else:
- action: switch.turn_off
target:
entity_id:
- switch.tablet_wall_socket_usb
data: {}
alias: Toggle USB charging for wall tablet
mode: single
- id: '1723373730592'
alias: 'Alert: Air Siren in Kyiv'
description: Air Alert announcement when we are in Kyiv. Sends critical notifications
and announces on speakers.
trigger:
- platform: state
entity_id:
- binary_sensor.alerts_kyiv_air
- binary_sensor.alerts_kyiv_artillery
- binary_sensor.alerts_kyiv_chemical
- binary_sensor.alerts_kyiv_nuclear
- binary_sensor.alerts_kyiv_urban_fights
to: 'on'
from: 'off'
variables:
title: Повітряна тривога ⚠️
messages:
- Увага! Повітряна тривога у Києві!
- У Києві повітряна тривога!
- Повітряна тривога у Києві!
- У Києві оголошено повітряну тривогу!
alias: Початок тривоги у Києві
- platform: state
entity_id:
- binary_sensor.alerts_kyiv_air
- binary_sensor.alerts_kyiv_artillery
- binary_sensor.alerts_kyiv_chemical
- binary_sensor.alerts_kyiv_nuclear
- binary_sensor.alerts_kyiv_urban_fights
to: 'off'
from: 'on'
variables:
title: "Відбій тривоги \U0001F44C"
messages:
- Відбій повітряної тривоги!
- Відбій тривоги!
- Кінець повітряної тривоги!
- Кінець тривоги!
alias: Відбій тривоги у Києві
condition:
- type: is_present
condition: device
device_id: 858b98accd89b76a9e8ecec9bd21c22f
entity_id: 77cf94b4b1b0da61a47f0d780871b9e7
domain: binary_sensor
action:
- action: media_player.turn_on
metadata: {}
data: {}
target:
entity_id: media_player.living_room_homepod
- data:
title: '{{ title }}'
messages: '{{ messages }}'
force_to_speak: true
notify_data:
group: air-alerts
push:
sound:
name: default
critical: 1
volume: 0.75
alias: Оголосити початок або відбій тривоги
action: script.announcement
mode: single
- id: '1723375129657'
alias: 'Alert: Danger in Kyiv'
description: Danger of missile/drone strike in Kyiv RIGHT NOW. Critical alert to
hide immediately.
trigger:
- platform: state
entity_id:
- binary_sensor.danger_in_war_monitor
- binary_sensor.danger_in_operinform
from: 'off'
to: 'on'
condition:
- condition: state
entity_id: binary_sensor.alerts_kyiv_air
state: 'on'
action:
- alias: Send a critical notification
data:
speak: false
notify: true
title: "Пряма загроза \U0001F4A5"
messages:
- '{{ trigger.to_state.attributes.latest_message }}'
notify_data:
group: air-alerts
push:
sound:
name: default
critical: 1
volume: 1
action: script.announcement
- variables:
messages:
- Увага! Пряма загроза для Києва!
- Увага! Пряма небезпека для Києва!
- Увага! Загроза удару по Києву!
- Увага! Негайно перейдіть до сховку!
- Увага! Пряма загроза! Негайно сховайтесь!
- Увага! Загроза для Києва! Негайно сховайтесь!
- Увага! Атака на Київ! Негайно сховайтесь!
- alias: Day or Night
if:
- condition: time
after: 02:00:00
before: '10:00:00'
then:
- action: media_player.turn_on
metadata: {}
data: {}
target:
entity_id: media_player.bedroom_homepod
- metadata: {}
data:
volume_level: 0.7
target:
entity_id:
- media_player.bedroom_homepod
action: media_player.volume_set
- alias: Speak in Bedroom
data:
speak: true
speaker: media_player.bedroom_homepod
notify: false
force_to_speak: true
messages: '{{ messages }}'
action: script.announcement
- action: media_player.turn_on
metadata: {}
data: {}
target:
entity_id: media_player.bedroom_homepod
else:
- action: media_player.turn_on
metadata: {}
data: {}
target:
entity_id: media_player.living_room_homepod
- metadata: {}
data:
volume_level: 0.6
target:
entity_id:
- media_player.living_room_homepod
action: media_player.volume_set
- alias: Speak in Living Room
data:
speak: true
speaker: media_player.living_room_homepod
notify: false
force_to_speak: true
messages: '{{ messages }}'
action: script.announcement
enabled: true
- delay:
hours: 0
minutes: 10
seconds: 0
milliseconds: 0
mode: single
- id: '1723375913043'
alias: 'Alert: Imminent Attack by Strategic Bombers'
description: Send a notification when Tu-95 strategic bombers take off from Russian
airfields. This means attack by cruise missiles is imminent. Prepare a hideout.
trigger:
- platform: state
entity_id:
- binary_sensor.imminent_attack_in_war_monitor
- binary_sensor.imminent_attack_in_operinform
from: 'off'
to: 'on'
condition: []
action:
- data:
speak: false
notify: true
title: "Зліт бомбардувальників \U0001F6EB"
messages:
- '{{ trigger.to_state.attributes.latest_message }}'
alias: Send a notification
action: script.announcement
mode: single
- id: '1723376382600'
alias: 'Alert: Bad Air Quality'
description: Notify when the air quality is bad
trigger:
- platform: numeric_state
entity_id:
- sensor.lun_misto_air_301_air_quality_index
above: 50
for:
minutes: 10
condition:
- type: is_present
condition: device
device_id: 858b98accd89b76a9e8ecec9bd21c22f
entity_id: 77cf94b4b1b0da61a47f0d780871b9e7
domain: binary_sensor
action:
- data:
title: "Шкідливе повітря \U0001F974"
messages:
- 'Індекс якості повітря завищений: {{ trigger.to_state.state | int(0) }} AQI'
- 'Шкідливе повітря надворі: {{ trigger.to_state.state | int(0) }} AQI'
- 'Індекс якості повітря: {{ trigger.to_state.state | int(0) }} AQI'
notify_data:
url: /lovelace/city
alias: Announce bad air quality
action: script.announcement
- alias: Wait for 3 hours before the next announcement
delay:
hours: 2
minutes: 0
seconds: 0
milliseconds: 0
mode: single
- id: '1723807610308'
alias: 'Alert: Denys left the Office'
description: Notify when Denys is leaving the office
trigger:
- platform: state
entity_id: person.denys
from: Wix
condition:
- condition: state
entity_id: person.maria
state: home
- condition: time
after: '16:00:00'
before: '21:00:00'
- condition: state
entity_id: binary_sensor.workday_sensor
state: 'on'
action:
- action: script.announcement
metadata: {}
data:
speak: false
notify: true
messages:
- Денис вийшов з роботи.
- Денис виїхав з роботи.
- Денис пішов з роботи.
title: "Денис \U0001F3C3"
mode: single
- id: '1723809472546'
alias: 'Alert: Electricity Outage'
description: Notify everyone when there is no electricity at home.
trigger:
- platform: state
entity_id: binary_sensor.electricity
from: 'off'
to: 'on'
- platform: state
entity_id:
- binary_sensor.electricity
from: 'on'
to: 'off'
condition: []
action:
- variables:
next_connectivity: '{{ states(''sensor.yasno_grupa_4_next_connectivity'') |
as_timestamp | timestamp_custom(''%H:%M'') }}'
next_outage: '{{ states(''sensor.yasno_grupa_4_next_outage'') | as_timestamp
| timestamp_custom(''%H:%M'') }}'
next_possible_outage: '{{ states(''sensor.yasno_grupa_4_next_possible_outage'')
| as_timestamp | timestamp_custom(''%H:%M'') }}'
- if:
- condition: state
entity_id: binary_sensor.electricity
state: 'off'
then:
- alias: Notify electricity is off
action: script.announcement
metadata: {}
data:
speak: true
title: Електрика ⚡️
notify_data:
url: /localave/reserve-power
group: electricity
openings:
- Відключення електроенергії.
- Вдома зникло світло.
- Вдома немає електрики.
- Відключення електроенергії вдома.
- Вдома вимкнули світло.
- Вдома вимкнули електрику.
messages:
- Сіра зона о {{ next_possible_outage }}. Увімкрення о {{ next_connectivity
}}.
- Можливе увімкнення о {{ next_possible_outage }}. Гарантовано о {{ next_connectivity
}}.
else:
- alias: Notify electricity if on
metadata: {}
data:
service: notify.all
speak: true
notify: true
title: Електрика ⚡️
notify_data:
url: /localave/reserve-power
group: electricity
openings:
- Вдома зʼявилось світло.
- Вдома зʼявилась електрика.
- Вдома знову є світло.
- Вдома увімкнули світло.
- Вдома увімкнули електрику.
messages:
- Вимкнення світла за планом о {{ next_outage }}.
- Наступне вимкнення о {{ next_outage }}.
- Відключення о {{ next_outage }}.
- О {{ next_outage }} наступне відключення.
action: script.announcement
mode: single
- id: '1723848039024'
alias: 'Curtains: Open Curtains in the morning'
description: Slowly open Bedroom Curtains. Open all curtains when we get up.
triggers:
- at: 08:30:00
enabled: true
trigger: time
conditions:
- condition: state
entity_id: binary_sensor.someone_is_home
state: 'on'
actions:
- action: script.turn_on
metadata: {}
data: {}
target:
entity_id: script.slowly_close_curtains
- delay:
hours: 1
minutes: 0
seconds: 0
milliseconds: 0
- if:
- condition: state
entity_id: script.slowly_close_curtains
state: 'on'
then:
- action: script.turn_off
metadata: {}
data: {}
target:
entity_id: script.slowly_close_curtains
alias: Stop opening curtains, if they are still opening
- delay:
hours: 0
minutes: 30
seconds: 0
milliseconds: 0
- alias: Wait for everyone to wake up
wait_for_trigger:
- entity_id:
- binary_sensor.do_not_disturb_family
from: 'on'
to: 'off'
for:
hours: 0
minutes: 0
seconds: 0
trigger: state
timeout:
hours: 4
minutes: 0
seconds: 0
milliseconds: 0
- alias: Wait to leave Bedroom
wait_for_trigger:
- entity_id:
- binary_sensor.living_room_presence_sensor_sofa
- binary_sensor.living_room_presence_sensor_table
to: 'on'
trigger: state
for:
hours: 0
minutes: 10
seconds: 0
- entity_id:
- binary_sensor.bedroom_motion_occupancy
from: 'on'
to: 'off'
for:
hours: 0
minutes: 10
seconds: 0
trigger: state
timeout:
hours: 3
minutes: 0
seconds: 0
milliseconds: 0
- alias: Open Curtains, if didn't closed them manually
if:
- condition: not
conditions:
- condition: state
entity_id: cover.bedroom_curtains
state: closed
alias: Bedroom Curtains are not closed
then:
- action: cover.open_cover
metadata: {}
data: {}
target:
entity_id:
- cover.bedroom_curtains
- cover.living_room_window_curtain
mode: single
- id: '1724059607884'
alias: 'Mode: Low Power Mode'
description: Minimise electricity consumption during the outage, when on reserve
power supply.
trigger:
- platform: state
entity_id: binary_sensor.electricity
from: 'off'
to: 'on'
- platform: state
entity_id:
- binary_sensor.electricity
from: 'on'
to: 'off'
- platform: homeassistant
event: start
condition: []
action:
- action: script.low_power_mode
metadata: {}
data: {}
mode: restart
- id: '1724060454567'
alias: 'Alert: No Electricity Soon'
description: Notify 30 minutes in advance before the electricity turns off
trigger:
- platform: template
value_template: '{{ now() >= states(''sensor.yasno_grupa_4_next_outage'') | as_datetime
- timedelta(minutes=30) }}'
alias: 30 minutes before outage
condition:
- condition: state
entity_id: binary_sensor.electricity_outages_applied
state: 'on'
action:
- metadata: {}
data:
speak: true
notify: true
notify_data:
url: /localave/reserve-power
group: electricity
messages:
- Планове відключення світла за 30 хвилин.
- За 30 хвилин відключення світла.
- Через півгодини вимкнуть світло.
- Відключення світла за півгодини.
title: Електрика ⚡️
service: notify.all
speaker: media_player.living_room_homepod
action: script.announcement
mode: single
- id: '1724060590677'
alias: 'Alert: Electricity will turn on soon'
description: Notify 1 hours in advance before the electricity turns on
trigger:
- alias: 60 minutes before connectivity
platform: template
value_template: '{{ now() >= states(''sensor.yasno_grupa_4_next_connectivity'')
| as_datetime - timedelta(minutes=60) }}'
condition:
- condition: state
entity_id: binary_sensor.electricity
state: 'off'
action:
- metadata: {}
data:
speak: true
notify: true
notify_data:
url: /localave/reserve-power
group: electricity
messages:
- Світло гарантовано увімкнуть за годину.
- Одна година до увімкнення світла за графіком.
- За графіком через годину увімкнуть світло.
- Планове увімкнення світла за годину.
title: Електрика ⚡️
service: notify.all
speaker: media_player.living_room_homepod
action: script.announcement
mode: single
- id: '1724063626997'
alias: 'Climate: Turn on heaters during heating season'
description: Turn on/off heaters when weather is getting cold/warm
trigger:
- platform: state
entity_id:
- weather.forecast_fayna_town
condition:
- condition: numeric_state
entity_id: weather.forecast_fayna_town
attribute: temperature
below: 10
action:
- action: weather.get_forecasts
metadata: {}
data:
type: daily
target:
entity_id: weather.forecast_fayna_town
response_variable: daily_forecast
- variables:
heating_season: '{% set days = 3 %} {% set threshold = 30 %} {{ daily_forecast[''weather.forecast_fayna_town''].forecast[:days]
| selectattr(''templow'', ''le'', threshold) | list | count }}'
- if:
- condition: template
value_template: '{{ heating_season }}'
alias: Heating season began
- condition: state
entity_id:
- climate.living_room_heater
- climate.bedroom_heater
- climate.cabinet_left_heater
- climate.cabinet_right_heater
state: 'off'
then:
- action: climate.set_hvac_mode
metadata: {}
data:
hvac_mode: auto
target:
entity_id:
- climate.living_room_heater
- climate.bedroom_heater
- climate.cabinet_left_heater
- climate.cabinet_right_heater
- action: script.announcement
metadata: {}
data:
speak: false
notify: true
notify_data:
url: lovelace/home
title: Опалення ♨️
messages:
- Вмикаємо обігрівачі.
- Переводимо обігрівачі у режим обігріву.
- Відкриваємо батареї.
openings:
- Прогнозується похолодання.
- Температура опускається.
- Найближчими днями буде холодно.
else:
- action: climate.set_hvac_mode
metadata: {}
data:
hvac_mode: 'off'
target:
entity_id:
- climate.living_room_heater
- climate.bedroom_heater
- climate.cabinet_left_heater
- climate.cabinet_right_heater
- action: script.announcement
metadata: {}
data:
speak: false
notify: true
notify_data:
url: lovelace/home
title: Опалення ♨️
messages:
- Вимикаємо обігрівачі.
- Закриваємо батареї.
openings:
- Прогнозується потепління.
- Температура піднімається.
- Найближчими днями буде тепло.
- delay:
hours: 12
minutes: 0
seconds: 0
milliseconds: 0
mode: single
- id: '1724064426060'
alias: 'Climate: Suggest turning on AC when it''s hot'
description: When temperature raises over certain level, send an actionable notification
for turning on ACs
trigger:
- platform: numeric_state
entity_id:
- sensor.home_temperature
above: 30
condition:
- condition: state
entity_id: binary_sensor.someone_is_home
state: 'on'
- condition: state
entity_id:
- climate.cabinet_ac
- climate.living_room_ac
state: 'off'
action:
- variables:
turn_on_both: '{{ ''TURN_ON_BOTH'' ~ context.id }}'
turn_on_living_room: '{{ ''TURN_ON_LIVING_ROOM'' ~ context.id }}'
turn_on_cabinet: '{{ ''TURN_ON_HOME_CABINET'' ~ context.id }}'
alias: Define action for notification
- alias: Suggest turning on AC
data:
title: "Кондиціонер \U0001F975"
speak: false
openings:
- Вдома занадто жарко.
- Температура вдома зростає.
- Вдома жарко.
messages:
- Увімкнути кондиціонери?
- Охолодити дім?
- Включити кондиціонери?
- Натисніть, щоб включити кондиціонери.
notify_data:
tag: ac
actions:
- action: '{{ turn_on_both }}'
title: Увімкнути обидва
activationMode: background
authenticationRequired: true
- action: '{{ turn_on_living_room }}'
title: Увімкнути у вітальні
activationMode: background
authenticationRequired: true
- action: '{{ turn_on_cabinet }}'
title: Увімкнути у кабінеті
activationMode: background
authenticationRequired: true
url: /lovelace/living_room
action: script.announcement
- alias: Wait for click on action
wait_for_trigger:
- id: both
platform: event
event_type: mobile_app_notification_action
event_data:
action: '{{ turn_on_both }}'
alias: Turn on both AC
- id: living_room
platform: event
event_type: mobile_app_notification_action
event_data:
action: '{{ turn_on_living_room }}'
alias: Turn on Living Room AC
- id: cabinet
platform: event
event_type: mobile_app_notification_action
event_data:
action: '{{ turn_on_cabinet }}'
alias: Turn on Cabinet AC
timeout:
hours: 3
minutes: 0
seconds: 0
milliseconds: 0
continue_on_timeout: true
- choose:
- conditions:
- alias: Turn on Both ACs
condition: template
value_template: '{{ wait.trigger.id == ''both'' }}'
sequence:
- data:
hvac_mode: cool
target:
entity_id:
- climate.living_room_ac
- climate.cabinet_ac
action: climate.set_hvac_mode
- conditions:
- alias: Turn on Living Room AC
condition: template
value_template: '{{ wait.trigger.id == ''living_room'' }}'
sequence:
- data:
hvac_mode: cool
target:
entity_id:
- climate.living_room_ac
action: climate.set_hvac_mode
- conditions:
- alias: Turn on Cabinet AC
condition: template
value_template: '{{ wait.trigger.id == ''cabinet'' }}'
sequence:
- data:
hvac_mode: cool
target:
entity_id:
- climate.cabinet_ac
action: climate.set_hvac_mode
- data:
message: clear_notification
data:
tag: ac
alias: Clear AC notifications
action: notify.notify
mode: single
- id: '1724065136245'
alias: 'Media: Turn off Samsung TV when PlayStation turns off'
description: Turn off Samsung TV when PS5 goes to sleep mode
trigger:
- platform: state
entity_id:
- sensor.playstation_5_activity
to: none
for:
seconds: 5
condition:
- condition: state
entity_id: media_player.apple_tv
state:
- standby
- 'off'
- condition: state
entity_id: sensor.playstation_5_activity
state: none
action:
- data: {}
action: media_player.turn_off
target:
device_id: ac80d0753177b7ae89f9707e113d3f9d
- id: '1724068550553'
alias: 'Media: Turn on Apple TV when Samsung TV turns on'
description: Turn on Apple TV when Samsung TV turns on and PS5 is off
trigger:
- platform: state
entity_id:
- media_player.samsung_tv
from: 'off'
to: 'on'
for:
hours: 0
minutes: 0
seconds: 5
condition:
- condition: state
entity_id: sensor.playstation_5_activity
state: none
for:
hours: 0
minutes: 1
seconds: 0
- condition: state
entity_id: media_player.apple_tv
state: standby
for:
hours: 0
minutes: 1
seconds: 0
action:
- data: {}
target:
entity_id: media_player.apple_tv
action: media_player.turn_on
mode: single
- id: '1724068930188'
alias: 'System: Home Assistant Start'
description: Notify Denys when Home Assistant starts
trigger:
- platform: homeassistant
event: start
action:
- action: script.announcement
metadata: {}
data:
speak: false
notify: true
title: "Запуск Home Assistant \U0001F3E1"
messages:
- Home Assistant повністю запущено!
- Home Assistant запущено!
- Home Assistant стартував!
- Home Assistant готовий до роботи!
notify_data:
group: system
tag: ha-start
custom_service: notify.denys
- id: '1724069071134'
alias: 'System: Notify when System disk is full'
description: Send a notification when system disk is 90% full.
trigger:
- platform: numeric_state
entity_id:
- sensor.system_monitor_disk_usage
above: 90
for:
hours: 1
condition: []
action:
- data:
title: "Системний пік \U0001F525"
messages:
- Системний диск заповнений на {{ trigger.to_state.state }}%.
- Заповнення системного диску {{ trigger.to_state.state }}%.
speak: false
notify_data:
url: /lovelace/system
group: system
openings: {}
action: script.announcement
- alias: Don't send notification too often
delay:
hours: 1
minutes: 0
seconds: 0
milliseconds: 0
mode: single
- id: '1724069169148'
alias: 'System: Notify about high RAM usage'
description: Notify when RAM usage is high for some time.
trigger:
- platform: numeric_state
entity_id: sensor.system_monitor_memory_usage
above: 75
for:
hours: 0
minutes: 10
seconds: 0
variables:
openings:
- Оперативна пам’ять заповнена на {{ trigger.to_state.state }}%.
- Навантаження на оперативну пам’ять {{ trigger.to_state.state }}%.
- 'RAM: {{ trigger.to_state.state }}%.'
messages:
- Складнощі з виконанням поточного завдання.
- Аномально велике навантаження на процесор.
condition: []
action:
- data:
title: "Системний пік \U0001F525"
messages:
- Оперативна пам’ять заповнена на {{ trigger.to_state.state }}%.
- Навантаження на оперативну пам’ять {{ trigger.to_state.state }}%.
- 'RAM: {{ trigger.to_state.state }}%.'
speak: false
notify_data:
url: /lovelace/system
group: system
action: script.announcement
- delay:
minutes: 10
alias: Don't send notification too often
mode: single
- id: '1724069193706'
alias: 'System: Notify about high CPU usage'
description: Send alert when HA has a high CPU usage
trigger:
- platform: numeric_state
entity_id:
- sensor.system_monitor_processor_use
above: 75
for:
hours: 0
minutes: 10
seconds: 0
condition: []
action:
- data:
title: "Системний пік \U0001F525"
speak: false
notify_data:
url: /lovelace/system
group: system
messages:
- Процесор навантажений на {{ trigger.to_state.state }}%.
- Навантаження на процесор {{ trigger.to_state.state }}%.
action: script.announcement
- alias: Don't send notification too often
delay:
hours: 1
minutes: 0
seconds: 0
milliseconds: 0
mode: single
- id: '1724069235867'
alias: 'System: Notify when Media disk is full'
description: Notify when Media drive is 95% full for some time.
trigger:
- platform: numeric_state
id: media_disk
entity_id:
- sensor.system_monitor_disk_usage_media_media
above: 90
for:
hours: 2
minutes: 0
seconds: 0
action:
- data:
title: "Диск медіа \U0001F4BF"
messages:
- Диск медіа заповнений на {{ trigger.to_state.state }}%.
- Заповнення диску медіа {{ trigger.to_state.state }}%.
speak: false
notify_data:
url: /lovelace/system
group: system
openings: {}
action: script.announcement
- delay:
minutes: 10
alias: Don't send notification too often
- id: '1724069840727'
alias: 'System: Run chores in config folder'
description: Run scripts for generating README, commiting regular updated, etc
trigger:
- platform: time_pattern
hours: /12
condition: []
action:
- metadata: {}
data: {}
action: shell_command.chores
mode: single
- id: '1724070020302'
alias: 'Vacuum: Notify when finished cleaning'
description: Notify when vacuum finished cleaning and we are not home.
trigger:
- platform: state
entity_id: vacuum.roborock
from: cleaning
to: returning
condition:
- condition: state
entity_id: binary_sensor.someone_is_home
state: 'off'
action: