-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
automations.yaml
2629 lines (2623 loc) · 79.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
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: air_siren_kyiv
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
to: 'on'
from: 'off'
variables:
title: Повітряна тривога ⚠️
messages:
- Оголошено повітряну тривогу!
- Увага! Повітряна тривога!
- У Києві повітряна тривога!
- Повітряна тривога у Києві!
- У Києві оголошено повітряну тривогу!
alias: Початок тривоги у Києві
- platform: state
entity_id: binary_sensor.alerts_kyiv_air
to: 'off'
from: 'on'
variables:
title: "Відбій тривоги \U0001F44C"
messages:
- Відбій повітряної тривоги!
- Відбій тривоги!
- Кінець повітряної тривоги!
- Кінець тривоги!
alias: Відбій тривоги у Києві
condition:
- alias: Хтось з сімʼї перебуває у Києві
condition: numeric_state
entity_id: sensor.home_nearest_distance
below: 20000
enabled: true
action:
- service: script.announcement
data:
title: '{{ title }}'
messages: '{{ messages }}'
force_speak: true
notify_data:
group: air-alerts
push:
sound:
name: default
critical: 1
volume: 0.75
alias: Оголосити початок або відбій тривоги
mode: single
- id: alarm_triggering
alias: 'Alarm: Triggering Alarm'
description: ''
trigger:
- platform: state
entity_id:
- binary_sensor.home_occupancy
- binary_sensor.living_room_movement_sensor_occupancy
- binary_sensor.bedroom_movement_sensor_occupancy
- binary_sensor.front_door_sensor_contact
to: 'on'
alias: Коли якийсь з сенсорів помічає рух вдома
condition:
- condition: state
entity_id: alarm_control_panel.home_alarm
state: armed_away
alias: Якщо сигналізація поставлена на охорону
action:
- service: alarm_control_panel.alarm_trigger
target:
entity_id: alarm_control_panel.home_alarm
data: {}
alias: Увімкнути тривогу
- id: alarm_notification
alias: 'Alarm: Notification for Triggered'
description: Make an announcement when Alarm is getting triggered
trigger:
- platform: state
entity_id:
- alarm_control_panel.home_alarm
to: triggered
action:
- service: script.announcement
data:
title: "Сигналізація \U0001F6A8"
messages:
- Вдома спрацювала сигналізація!
- Тривога! Вдома виявлено рух!
- Увага! Спрацювала сигналізація!
notify_data:
group: alarm
entity_id: camera.home_camera
alias: Announce Alarm is triggered
- id: turn_off_tv_with_playstation
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
enabled: true
for:
hours: 0
minutes: 1
seconds: 0
- condition: state
entity_id: media_player.playstation_5
state: none
action:
- service: media_player.turn_off
data: {}
target:
entity_id: media_player.samsung_tv
- id: magic_cube_actions
alias: 'System: Magic Cube Actions'
description: ''
trigger:
- platform: device
domain: mqtt
device_id: 34146f7d251656d2b98875571e46a12c
type: action
subtype: flip90
discovery_id: 0x00158d000421472b action_flip90
id: flip90
- platform: device
domain: mqtt
device_id: 34146f7d251656d2b98875571e46a12c
type: action
subtype: flip180
discovery_id: 0x00158d000421472b action_flip180
id: flip180
- platform: device
domain: mqtt
device_id: 34146f7d251656d2b98875571e46a12c
type: action
subtype: rotate_right
discovery_id: 0x00158d000421472b action_rotate_right
id: rotate_right
- platform: device
domain: mqtt
device_id: 34146f7d251656d2b98875571e46a12c
type: action
subtype: rotate_left
discovery_id: 0x00158d000421472b action_rotate_left
id: rotate_left
- platform: device
domain: mqtt
device_id: 34146f7d251656d2b98875571e46a12c
type: action
subtype: shake
discovery_id: 0x00158d000421472b action_shake
id: shake
- platform: device
domain: mqtt
device_id: 34146f7d251656d2b98875571e46a12c
type: action
subtype: tap
discovery_id: 0x00158d000421472b action_tap
id: tap
action:
- choose:
- conditions:
- condition: trigger
id: flip90
alias: flip90
sequence:
- service: scene.turn_on
data:
entity_id: scene.night_lights
transition: 1
- conditions:
- condition: trigger
id: flip180
alias: '"flip180" action'
sequence:
- service: scene.turn_on
data:
transition: 1
target:
entity_id: scene.evening_lights
- conditions:
- condition: trigger
id: rotate_right
alias: '"rotate_right" action'
sequence:
- service: light.turn_on
data:
transition: 1
target:
entity_id:
- light.living_room_main_light
- conditions:
- condition: trigger
id: rotate_left
alias: '"rotate_left" action'
sequence:
- service: light.turn_off
data:
transition: 1
target:
entity_id:
- light.living_room_main_light
- conditions:
- condition: trigger
id: shake
alias: '"shake" action'
sequence:
- service: scene.turn_on
data:
transition: 1
target:
entity_id: scene.lights_out
- conditions:
- condition: trigger
id: tap
alias: '"tap" action'
sequence:
- service: input_boolean.toggle
data: {}
target:
entity_id: input_boolean.do_not_disturb
- service: script.announcement
data:
speak: false
title: "Не турбувати \U0001F4A4"
messages:
- Режим «Не турбувати» {{ is_state('input_boolean.do_not_disturb', 'on')
| iif('увімкнено', 'вимкнено') }}.
- Режим тиші {{ is_state('input_boolean.do_not_disturb', 'on') | iif('увімкнено',
'вимкнено') }}.
- '{{ is_state(''input_boolean.do_not_disturb'', ''on'') | iif(''Увімкнено'',
''Вимкнено'') }} режим тиші.'
notify_data:
group: system
alias: Perform an action
- id: home_assistant_release_alert
alias: 'System: Home Assistant Release'
description: Notify Denys about new Home Assistant releases
trigger:
- platform: device
type: turned_on
device_id: ef182182c3abe81e0d29b52dc5f4c649
entity_id: 0bd7f8b9585566e058244c17ca00aeca
domain: update
action:
- alias: Notify Denys about new HA release
service: script.announcement
data:
service: notify.denys
title: "Оновлення Home Assistant \U0001F389"
speak: false
messages:
- 'Доступна нова версія Home Assistant: {{ state_attr(''update.home_assistant_core_update'',
''latest_version'') }}.'
- 'Реліз нової версії Home Assistant: {{ state_attr(''update.home_assistant_core_update'',
''latest_version'') }}.'
- Версія Home Assistant {{ state_attr('update.home_assistant_core_update', 'latest_version')
}} вже доступна!
notify_data:
url: /config/dashboard
group: system
actions:
- action: RELEASE_NOTES
title: Переглянути зміни
uri: '{{ state_attr(''update.home_assistant_core_update'', ''release_url'')
}}'
- id: hacs_releases_alert
alias: 'System: Notify about HACS updates'
description: Notify when new HACS components are released
trigger:
- platform: time
at: '21:00:00'
condition:
- condition: numeric_state
entity_id: sensor.hacs
above: 0
alias: There are any updates for hacs
action:
- variables:
hacs_updates: '{% for repo in state_attr(''sensor.hacs'', ''repositories'')
-%} • {{ repo.display_name }}: {{ repo.installed_version }} → {{ repo.available_version
}} {% endfor %}'
- alias: Announce HACS updates for Denys
service: script.announcement
data:
service: notify.denys
title: "Оновлення HACS \U0001F389"
speak: false
messages:
- '{{ hacs_updates }}'
notify_data:
url: /hacs/entry
group: system
tag: hacs-updates
openings:
- 'Доступні оновлення для {{ states(''sensor.hacs'') }} пакетів в HACS:
'
- 'HACS має {{ states(''sensor.hacs'') }} оновлень:
'
- 'Достуно {{ states(''sensor.hacs'') }} оновлень в HACS:
'
- id: home_assistant_start
alias: 'System: Home Assistant Start'
description: Notify Denys when Home Assistant starts
trigger:
- platform: homeassistant
event: start
action:
- service: script.announcement
data:
service: notify.denys
title: "Запуск Home Assistant \U0001F3E1"
speak: false
messages:
- Home Assistant повністю запущено!
- Home Assistant стартував!
- Home Assistant готовий до роботи!
notify_data:
group: system
tag: ha-start
alias: Notify Denys about HA starts
- id: system_peaks
alias: 'System: Notify when Media disk is full'
description: Notify when Media drive is 90% full for some time.
trigger:
- platform: numeric_state
id: media_disk
entity_id:
- sensor.system_monitor_disk_usage_media_media
above: 90
for:
hours: 1
action:
- service: script.announcement
data:
title: "Диск медіа \U0001F4BF"
messages:
- Диск медіа заповнений на {{ trigger.to_state.state }}%.
- Заповнення диску медіа {{ trigger.to_state.state }}%.
speak: false
notify_data:
url: /lovelace/system
group: system
openings: {}
- delay:
minutes: 10
alias: Don't send notification too often
- id: aqi_alert
alias: 'Alert: Bad Air Quality'
description: Notify when the air quality is bad
trigger:
- platform: numeric_state
entity_id:
- sensor.outdoor_aqi
above: 150
for:
minutes: 10
condition:
- condition: numeric_state
entity_id: sensor.home_nearest_distance
below: 20
alias: Someone is in Kyiv
action:
- service: script.announcement
data:
title: "Шкідливе повітря \U0001F974"
openings:
- 'Рівень якості повітря: {{ trigger.to_state.state | int(0) }} AQI'
- 'Шкідливе повітря надворі: {{ trigger.to_state.state | int(0) }} AQI'
- 'Індекс якості повітря: {{ trigger.to_state.state | int(0) }} AQI'
messages: '{{ messages }}'
notify_data:
url: /lovelace/city
alias: Announce bad air quality
- delay:
hours: 3
minutes: 0
seconds: 0
milliseconds: 0
alias: Wait for 3 hours before the next announcement
mode: single
- id: humidifier_no_water
alias: 'Alert: Humidifier No Water'
description: Notify when humidifier's water tank is empty
trigger:
- platform: state
entity_id:
- binary_sensor.air_humidifier_water_tank_empty
to: 'on'
not_from:
- unknown
- unavailable
action:
- service: script.announcement
data:
title: "Зволожувач \U0001F4A6"
messages:
- Наповніть бак зволожувача водою!
- У зволожувачі закінчилась вода — наберіть нову!
- Наберіть нової води у зволожувач!
- Потрібно набрати воду у зволожувач!
- Зволожувач порожній. Наберіть нової води.
- Потрібно наповнити бак зволожувача.
- Бак зволожувача спорожнів.
notify_data:
url: /lovelace/bedroom
alias: Announce Humidifier tank is empty
- id: car_washing_alert
alias: 'Alert: Car Washing'
description: Notify when it’s okay or not okay to wash a car
trigger:
- platform: state
entity_id: binary_sensor.car_wash
to: 'on'
for:
hours: 12
variables:
title: "Миття авто \U0001F698☀️"
openings:
- Найближчими днями очікується хороша погода.
- Хороша погода найближчі 7 днів.
- Прогнозується хороша погода!
- Попереду гарна погода!
messages:
- Доречно помити машину.
- Можна помити авто.
- Варто поїхати на автомийку.
- Вдалий час, щоб помити авто.
alias: When car wash sensor turns on
- platform: state
entity_id: binary_sensor.car_wash
to: 'off'
for:
hours: 12
variables:
title: "Миття авто \U0001F698\U0001F327"
openings:
- Найближчими днями очікується погана погода.
- Погана погода найближчі 7 днів.
- Прогнозується погана погода!
- Попереду дощова погода!
messages:
- Утримайтесь від миття авто.
- Не варто мити авто цими днями.
- Краще залишити авто брудним.
alias: When car wash sensor turns off
action:
- service: script.announcement
data:
speak: false
title: '{{ title }}'
openings: '{{ openings }}'
messages: '{{ messages }}'
notify_data:
url: /lovelace/car
group: car
alias: 'Announce car washing recommendations '
- id: snow_tire_alert
alias: 'Alert: Snow/Winter Tires'
description: Notify when it's time to change car tires
trigger:
- platform: state
entity_id:
- binary_sensor.snowtire
to: 'on'
for:
hours: 12
minutes: 0
seconds: 0
- platform: state
entity_id:
- binary_sensor.snowtire
to: 'off'
for:
hours: 12
minutes: 0
seconds: 0
action:
- choose:
- conditions:
- condition: state
entity_id: binary_sensor.snowtire
state: 'on'
- alias: Only in the fall
condition: template
value_template: '{{ now().month in [9, 10, 11] }}'
sequence:
- service: script.announcement
data:
speak: false
title: "Зимові шини \U0001F6DE❄️"
openings:
- Найближчими днями погіршення погоди.
- Скоро настане зима.
- Зима близько!
- Попереду погіршення погоди!
messages:
- Час перевзути машину на зимові шини.
- Доречно змінити шини на зимові.
- Варто поїхати на шиномонтаж для заміни шин.
notify_data:
url: /lovelace/car
group: car
alias: Announce winter tires
- conditions:
- condition: state
entity_id: binary_sensor.snowtire
state: 'off'
- alias: Only in the spring
condition: template
value_template: '{{ now().month in [3, 4, 5] }}'
sequence:
- service: script.announcement
data:
speak: false
title: "Літні шини \U0001F6DE\U0001F324"
openings:
- Найближчими днями стрімке покращення погоди.
- Літо на носі!
- Нарешті весна!
- Попереду покращення погоди!
messages:
- Час перевзути машину на літні шини.
- Доречно змінити шини на літні.
- Варто поїхати на шиномонтаж для заміни шин.
notify_data:
url: /lovelace/car
group: car
alias: Announce summer tires
alias: Announce winter or summer tires
- id: sync_living_room_trv_temperature
alias: 'Climate: Sync Living Room TRV temperature'
description: ''
use_blueprint:
path: denysdovhan/sync_trv_with_external_sensor.yaml
input:
valve: climate.living_room_heater
temp_sensor: sensor.living_room_temperature
ieee_address: '0x8cf681fffeab0589'
- id: sync_bedroom_trv_temperature
alias: 'Climate: Sync Bedroom TRV temperature'
description: ''
use_blueprint:
path: denysdovhan/sync_trv_with_external_sensor.yaml
input:
valve: climate.bedroom_heater
temp_sensor: sensor.bedroom_temperature
ieee_address: '0x8cf681fffeb0dbd5'
- id: switch_heaters_during_heating_season
alias: 'Climate: Switch Heaters during Heating Season'
description: Turn on/off heaters when Heating Season in on
trigger:
- platform: state
entity_id:
- binary_sensor.heating_season
not_from:
- unknown
- unavailable
for:
hours: 12
minutes: 0
seconds: 0
action:
- if:
- alias: Start of the Heating Season
condition: state
entity_id: binary_sensor.heating_season
state: 'on'
- alias: And heaters are still off
condition: state
entity_id:
- climate.living_room_heater
- climate.bedroom_heater
state: 'off'
then:
- service: climate.set_hvac_mode
data:
entity_id:
- climate.living_room_heater
- climate.bedroom_heater
hvac_mode: auto
alias: Turn Heaters to Auto
else:
- alias: Turn Heaters to Off
service: climate.set_hvac_mode
data:
hvac_mode: 'off'
target:
entity_id:
- climate.living_room_heater
- climate.bedroom_heater
- alias: Notify about the action
service: script.announcement
data:
title: "Опалення \U0001F525"
speak: false
openings:
- Прогнозується {{ iif(is_state('binary_sensor.heating_season', 'on'), 'похолодання',
'потепління') }}.
- Наближається {{ iif(is_state('binary_sensor.heating_season', 'on'), 'холодна',
'тепла') }} погода.
- Найближчі 3 дні очікується температура {{ iif(is_state('binary_sensor.heating_season',
'on'), 'нижче', 'вище') }} 8°C.
- Температура {{ iif(is_state('binary_sensor.heating_season', 'on'), 'опуститься
нижче', 'підніметься вище') }} 8°C.
messages:
- '{{ iif(is_state(''binary_sensor.heating_season'', ''on''), ''Починаємо'',
''Закінчуємо'') }} опалювальний період.'
- '{{ iif(is_state(''binary_sensor.heating_season'', ''on''), ''Початок'', ''Кінець'')
}} опалювального сезону.'
- '{{ iif(is_state(''binary_sensor.heating_season'', ''on''), ''Розпочинаємо'',
''Закінчуємо'') }} опалювальний сезон.'
- '{{ iif(is_state(''binary_sensor.heating_season'', ''on''), ''Вмикаємо'',
''Вимикаємо'') }} опалювання вдома.'
- '{{ iif(is_state(''binary_sensor.heating_season'', ''on''), ''Увімкнено'',
''Вимкнено'') }} опалення.'
notify_data:
actions:
- action: '{{ heat_action }}'
title: Нагріти балкон
url: /lovelace/balcony
- id: turn_on_balcony_heater
alias: 'Climate: Turn on Balcony Heater'
description: Turn on Balcony Heater when it's cold and Desk Lamp or Working Display
are turned on
trigger:
- platform: state
entity_id: binary_sensor.working_display_connected
to: 'on'
- platform: state
entity_id: light.desk_lamp
to: 'on'
- platform: state
entity_id:
- binary_sensor.balcony_comfort_temperature
to: 'off'
condition:
- alias: Turn on only when someone is home
condition: state
entity_id: group.family
state: home
- condition: state
entity_id: binary_sensor.balcony_comfort_temperature
state: 'off'
- condition: state
entity_id: climate.balcony_heater
state: 'off'
- alias: Either Display or Desk Lamp should be on when the temperature is low
condition: or
conditions:
- condition: state
entity_id: binary_sensor.working_display_connected
state: 'on'
- condition: state
entity_id: light.desk_lamp
state: 'on'
action:
- service: climate.turn_on
data: {}
target:
entity_id: climate.balcony_heater
- id: turn_off_balcony_heater
alias: 'Climate: Turn off Balcony Heater'
description: Turn off Balcony Heater when the working display or desk lamp are off
for some time
trigger:
- platform: state
entity_id:
- light.desk_lamp
to: 'off'
for:
hours: 0
minutes: 10
seconds: 0
from: 'on'
- platform: state
entity_id:
- binary_sensor.working_display_connected
to: 'off'
for:
hours: 0
minutes: 10
seconds: 0
from: 'on'
- platform: state
entity_id:
- binary_sensor.balcony_comfort_temperature
to: 'on'
for:
hours: 0
minutes: 10
seconds: 0
condition:
- condition: state
entity_id: climate.balcony_heater
state: heat
- condition: state
entity_id: binary_sensor.balcony_comfort_temperature
state: 'on'
enabled: false
- condition: state
entity_id: binary_sensor.working_display_connected
state: 'off'
action:
- service: climate.turn_off
entity_id: climate.balcony_heater
- if:
- condition: state
entity_id: light.desk_lamp
state: 'on'
then:
- service: light.turn_off
entity_id: light.desk_lamp
- id: preheat_balcony
alias: 'Climate: Preheat Balcony for a Workday'
description: When Denys wakes up, ask if he is going to work on balcony, start heating
and notify when temperature is comfortable.
trigger:
- platform: state
entity_id:
- binary_sensor.denys_iphone_focus
to: 'off'
condition:
- condition: state
entity_id: binary_sensor.balcony_comfort_temperature
state: 'off'
- condition: state
entity_id: binary_sensor.workday_sensor
state: 'on'
- condition: state
entity_id: person.denys
state: home
- condition: time
after: 08:00
before: '15:00'
action:
- alias: Prepare an action variables
variables:
heat_action: '{{ ''HEAT_'' ~ context.id }}'
delay_minutes: '{{ range(1, 30) | random }}'
- alias: Wait for some time after wake up
delay:
minutes: '{{ delay_minutes }}'
- alias: Send an actionable notification
service: script.announcement
data:
service: notify.denys
title: "Робоче місце \U0001F5A5"
speak: false
openings:
- На балконі {{ states('sensor.balcony_conditions_sensor_temperature') | round(1)
}}°C.
- Температура на балконі {{ states('sensor.balcony_conditions_sensor_temperature')
| round(1) }}°C.
- Зараз на балконі {{ states('sensor.balcony_conditions_sensor_temperature')
| round(1) }}°C.
messages:
- Хочете увімкнути обігрів?
- Нагріти балкон для роботи?
- Увімкнути обігрівач?
- Нагріти до комфортної температури?
- Підігріти комфортної температури?
notify_data:
actions:
- action: '{{ heat_action }}'
title: Нагріти балкон
url: /lovelace/balcony
- alias: Wait for notification to be pressed
wait_for_trigger:
- platform: event
event_type: mobile_app_notification_action
event_data:
action: '{{ heat_action }}'
alias: When heat button is pressed in notification
timeout: '12:00:00'
continue_on_timeout: false
- alias: Start heating the balcony
service: climate.turn_on
entity_id: climate.balcony_heater
- alias: Wait to heat up
wait_for_trigger:
- platform: state
entity_id:
- binary_sensor.balcony_comfort_temperature
to: 'on'
timeout: '6:00:00'
continue_on_timeout: false
- alias: Notify about comfort temperature
service: script.announcement
data:
service: notify.denys
title: "Робоче місце \U0001F5A5"
speak: false
openings:
- Можна йти працювати.
- Балкон готовий до роботи.
- Робоче місце нагріте до комфортної темпертарури.
- Робоче місце готове.
messages:
- На балконі {{ states('sensor.balcony_conditions_sensor_temperature') | round(1)
}}°C.
- 'Температура: {{ states(''sensor.balcony_conditions_sensor_temperature'')
| round(1) }}°C.'
- Зараз на балконі {{ states('sensor.balcony_conditions_sensor_temperature')
| round(1) }}°C.
notify_data:
url: /lovelace/balcony
- id: turn_on_lights_on_sunset
alias: 'Light: Turn on lights on Sunset'
description: Turn on lights when sun goes below the horizon
trigger:
- platform: state
entity_id:
- sun.sun
to: below_horizon
condition:
- condition: state
entity_id: group.family
state: home
- condition: state
entity_id: light.living_room_lights
state: 'off'
- condition: state
entity_id: light.bedroom_lights
state: 'off'
action:
- service: scene.turn_on
data:
transition: 5
target:
entity_id: scene.evening_lights
- service: script.announcement
data:
notify: false
openings:
- Вечоріє.
- Вечір надворі.
- Скоро стемніє.
- Сонечко зайшло за обрій.
- Скоро вдома стане темно.
- Сонце опустилось за обрій.
messages:
- Зробимо вдома світліше.
- Нехай буде світло.
- Доречно увімкнути світло.
- Вмикаємо світло.
- Вмикаю світло.
- Час увімкнути світло.
- Вмикаю для вас світло.
- Вмикаю вечірнє світло.
service: notify.all
speak: true
force_speak: false
notify_data:
url: /localave/home
alias: Announce lights
- id: turn_on_lights_on_low_illuminance
alias: 'Light: Turn on lights on low illuminance'
description: Turn on lights on low illuminance
trigger:
- platform: numeric_state
entity_id: sensor.living_room_movement_sensor_illuminance_lux
below: 10
- platform: numeric_state
entity_id: sensor.bedroom_movement_sensor_illuminance_lux
below: 5
condition:
- condition: state
entity_id: group.family
state: home
- condition: state
entity_id: sun.sun
state: above_horizon
- condition: state
entity_id: light.living_room_lights
state: 'off'
- condition: state
entity_id: light.bedroom_lights
state: 'off'
- condition: time
after: '15:00:00'
before: '22:00:00'
alias: Activate only after noon till night
action:
- service: scene.turn_on
data:
transition: 5
target:
entity_id:
- scene.evening_lights
- service: script.announcement
data:
notify: false
openings:
- Здається вдома надто темно.
- Вдома занадто темно.
- Стемніло.
- Сонце сховалось за хмарами.
- Надто темно.
- Вдома за темно.
messages:
- Доречно увімкнути світло.
- Увімкну для вас світло.
- Краще увімкнути світло.
- Не будемо псувати очі.
- Вмикаю для вас світло.
- Вмикаємо світло.
- Вмикаю світло.
- Час увімкнути світло.
service: notify.all
speak: true
force_speak: false
notify_data:
url: /localave/home
alias: Announce low illuminance on speakers
- id: turn_on_corridor_light_when_door_is_open
alias: 'Light: Turn on Corridor Light when Door is open'
description: Turn on Corridor Light when Front Door opens and then turn it off after
a few minutes
trigger:
- platform: state
entity_id:
- binary_sensor.front_door_sensor_contact
to: 'on'
action:
- alias: Turn on Corridor Light
service: light.turn_on
entity_id: light.corridor_light
- alias: Wait for some time
delay:
hours: 0
minutes: 7
seconds: 0
milliseconds: 0
- alias: Turn off Corridor Light
service: light.turn_off
entity_id: light.corridor_light
mode: restart
- id: turn_off_corridor_light_when_door_is_closed
alias: 'Light: Turn off Corridor Light When Door is Closed'
description: Turn off Corridor Light when Front Door closes. If the light is still
on, then send a notification with an action to turn off the light.
trigger:
- platform: state
entity_id:
- light.corridor_light
to: 'on'
action:
- wait_for_trigger:
- platform: state
entity_id: binary_sensor.front_door_sensor_contact
from: 'on'
to: 'off'
timeout:
hours: 0
minutes: 20
seconds: 0
milliseconds: 0
- choose:
- conditions:
- condition: template
value_template: '{{ wait.trigger is not none }}'
alias: When Front Door was closed
sequence:
- delay:
hours: 0
minutes: 1
seconds: 0
milliseconds: 0
- service: light.turn_off
data: {}
target:
entity_id: light.corridor_light
default:
- condition: state
entity_id: light.corridor_light
state: 'on'
- variables:
turn_off_corridor_light: '{{ ''TURN_OFF_CORRIDOR_LIGHT'' ~ context.id }}'
alias: Define action for notification
- service: script.announcement
data:
title: "Світло у коридорі \U0001F4A1"
speak: false
openings:
- Світло у коридорі горить вже 15 хвилин.
- Світло у коридорі досі горить.
- Досі горить світло у коридорі.
messages: