-
-
Notifications
You must be signed in to change notification settings - Fork 23
/
automations.yaml
3273 lines (3273 loc) · 85.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
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: minecraft_server_players_online_notification
alias: Ilość graczy na serwerze Minecraft
description: ''
trigger:
- platform: numeric_state
entity_id: sensor.minecraft_server_players_online
above: 0
action:
- service: python_script.notify
data:
title: Gracze na serwerze Minecraft
message: "{% if trigger.to_state.state == 1 %}\n Na serwerze Minecraft gra
obecnie jeden gracz.\n{% else %}\n Na serwerze Minecraft gra obecnie {{ trigger.to_state.state
}} graczy.\n{% endif %}"
tag: minecraft-server
services:
- service: notify.mobile_app_iphone_11
type: ios
- id: ios_turn_on_tv
alias: Włącz telewizję w salonie
description: ''
trigger:
- platform: event
event_type: ios.action_fired
event_data:
actionName: Turn On TV
action:
- action: select.select_option
target:
entity_id: select.harmony_activities
data:
option: telewizja
- id: ios_turn_off_tv
alias: Wyłącz sprzęt RTV w salonie
description: ''
trigger:
- platform: event
event_type: ios.action_fired
event_data:
actionName: Turn Off TV
action:
- action: select.select_option
target:
entity_id: select.harmony_activities
data:
option: power_off
- id: notification_update_platform
alias: Dostępna aktualizacja dla składnika Home Assistant
description: ''
trigger:
- platform: state
entity_id:
- update.home_assistant
- update.home_assistant_operating_system
- update.supervisor
- update.cloudflared
- update.mariadb
- update.mosquitto_broker
- update.vaultwarden_bitwarden
- update.z_wave_js
- update.terminal_ssh
- update.studio_code_server
- update.samba_share
- update.go2rtc
from: 'off'
to: 'on'
action:
- service: python_script.notify
data:
title: Dostępna aktualizacja
message: Dostępna jest aktualizacja do wersji {{ trigger.to_state.attributes.latest_version
| replace('v.', '') | replace('v', '') }} dla {{ device_attr(trigger.entity_id,
"name_by_user") or device_attr(trigger.entity_id, "name") }}.
tag: notification-update-{{ trigger.entity_id }}
group: updates
url: /config/updates
services:
- service: notify.mobile_app_iphone_13
type: ios
mode: queued
max: 10
- id: notification_high_ram_usage
alias: Wysokie użycie pamięci RAM
description: ''
trigger:
- platform: numeric_state
entity_id: sensor.memory_use_percent
above: 70
for:
minutes: 5
action:
- service: python_script.notify
data:
title: Wysokie użycie pamięci RAM
message: Serwer Home Assistant używa obecnie {{ trigger.to_state.state }}% pamięci
RAM.
tag: notification-high-ram-usage
group: other
priority: high
services:
- service: notify.mobile_app_iphone_13
type: ios
- id: notification_ssl_cert_expiry
alias: Wygaśnięcie certyfikatu SSL
description: ''
trigger:
- platform: state
entity_id: sensor.ssl_certificate_expiry
variables:
days: '{{ trigger.to_state.state | as_timestamp(0) - now() | as_timestamp //
86400 }}'
condition:
- condition: template
value_template: '{{ 0 <= days < 14 }}'
action:
- service: python_script.notify
data:
title: Wygasa certyfikat SSL
message: Za {{ days }} dni wygaśnie certyfikat SSL serwera WWW.
tag: notification-ssl
group: other
services:
- service: notify.mobile_app_iphone_13
type: ios
- id: notification_storm_comming
alias: Burza w pobliżu
description: ''
triggers:
- entity_id:
- sensor.dom_dystans_do_blyskawicy
below: 10
trigger: numeric_state
conditions:
- condition: template
value_template: '{{ now().timestamp() - as_timestamp(this.attributes.last_triggered,
0) > 480 }}'
actions:
- parallel:
- if:
- condition: state
entity_id: person.maciek
state: home
then:
data:
title: '{{ notification_title }}'
message: '{{ notification_message }}'
tag: '{{ notification_tag }}'
services:
- service: notify.mobile_app_iphone_13
type: ios
action: python_script.notify
- if:
- condition: state
entity_id: person.edyta
state: home
then:
data:
title: '{{ notification_title }}'
message: '{{ notification_message }}'
tag: '{{ notification_tag }}'
services:
- service: notify.mobile_app_iphone_12
type: ios
action: python_script.notify
variables:
notification_title: Burza w pobliżu domu
notification_message: Wyładowania atmosferyczne występują {{ states('sensor.dom_dystans_do_blyskawicy')
}} km od domu.
notification_tag: notification-storm-comming
- id: notification_dishwasher_end
alias: Koniec zmywania naczyń
description: ''
trigger:
- platform: state
entity_id:
- binary_sensor.dishwasher_kuchnia
from: 'on'
to: 'off'
for:
minutes: 1
action:
- parallel:
- if:
- condition: state
entity_id: person.maciek
state: home
then:
- service: python_script.notify
data:
title: Koniec zmywania
message: Zmywarka zakończyła zmywanie naczyń.
tag: notification-dishwasher
group: other
services:
- service: notify.mobile_app_iphone_13
type: ios
- if:
- condition: state
entity_id: person.edyta
state: home
then:
- service: python_script.notify
data:
title: Koniec zmywania
message: Zmywarka zakończyła zmywanie naczyń.
tag: notification-dishwasher
group: other
services:
- service: notify.mobile_app_iphone_12
type: ios
- id: notification_humidifier_low_water
alias: Mało wody w nawilżaczy w salonie
description: ''
trigger:
- platform: numeric_state
entity_id: sensor.xiaomi_mi_humidifier_ca1_water_level
below: 10
for:
hours: 0
minutes: 3
seconds: 0
- platform: numeric_state
entity_id: sensor.xiaomi_mi_humidifier_ca1_water_level
below: 20
for:
hours: 0
minutes: 3
seconds: 0
condition:
- condition: or
conditions:
- condition: state
entity_id: person.maciek
state: home
- condition: state
entity_id: person.edyta
state: home
- condition: state
entity_id: input_boolean.heating_season
state: 'on'
- condition: template
value_template: '{{ states(''sensor.xiaomi_mi_humidifier_ca1_water_level'') |
int(999) != 0 }}'
action:
- parallel:
- choose:
conditions:
condition: state
entity_id: person.maciek
state: home
sequence:
service: python_script.notify
data:
title: '{{ notification_title }}'
message: '{{ notification_message }}'
tag: '{{ notification_tag }}'
services:
- service: notify.mobile_app_iphone_13
type: ios
- choose:
conditions:
condition: state
entity_id: person.edyta
state: home
sequence:
service: python_script.notify
data:
title: '{{ notification_title }}'
message: '{{ notification_message }}'
tag: '{{ notification_tag }}'
services:
- service: notify.mobile_app_iphone_12
type: ios
variables:
notification_title: Uzupełnij wodę w nawilżaczu
notification_message: W zbiorniku nawilżacza w salonie pozostało {{ states('sensor.xiaomi_mi_humidifier_ca1_water_level')
}}% wody.
notification_tag: notification-humidifier-ca1
- id: notification_salon_co2
alias: Wysokie stężenie dwutlenku węgla w salonie
description: ''
trigger:
- platform: numeric_state
entity_id: sensor.co2_salon
above: 1000
for:
minutes: 5
condition: []
action:
- parallel:
- choose:
conditions:
condition: state
entity_id: person.maciek
state: home
sequence:
service: python_script.notify
data:
title: '{{ notification_title }}'
message: '{{ notification_message }}'
tag: '{{ notification_tag }}'
services:
- service: notify.mobile_app_iphone_13
type: ios
- choose:
conditions:
condition: state
entity_id: person.edyta
state: home
sequence:
service: python_script.notify
data:
title: '{{ notification_title }}'
message: '{{ notification_message }}'
tag: '{{ notification_tag }}'
services:
- service: notify.mobile_app_iphone_12
type: ios
variables:
notification_title: Wysokie stężenie dwutlenku węgla
notification_message: W salonie stężenie dwutlenku węgla wynosi {{ trigger.to_state.state
}} ppm. Należy przewietrzyć pomieszczenie.
notification_tag: notification-high-co2
- id: notification_water_leak_kuchnia
alias: Wyciek wody
description: ''
trigger:
- platform: state
entity_id: binary_sensor.water_leak_kuchnia
from: 'off'
to: 'on'
- platform: state
entity_id: binary_sensor.water_leak_pralnia
from: 'off'
to: 'on'
- platform: state
entity_id: binary_sensor.water_leak_lazienka
from: 'off'
to: 'on'
action:
- service: python_script.notify
data:
title: '{{ notification_title }}'
message: '{{ notification_message }}'
tag: notification-water-leak-{{ area_name(trigger.entity_id) }}
priority: high
services:
- service: notify.mobile_app_iphone_13
type: ios
- service: notify.mobile_app_iphone_12
type: ios
variables:
notification_title: Wykryto wyciek wody
notification_message: 'Wykryto wyciek wody w pomieszczeniu: {{ area_name(trigger.entity_id)
}}.'
- id: notification_relay_overpower
alias: Przeciążenie przekaźnika
description: ''
triggers:
- entity_id:
- binary_sensor.shelly_plus_plug_s_2ffb28_overpower
- binary_sensor.shelly_plus_plug_s_d00c84_overpower
- binary_sensor.shelly_plus_1pm_948ff8_overpower
- binary_sensor.shelly_plus_1pm_b22864_overpower
- binary_sensor.aeotec_zw175_smart_switch_7_026_przeciazenie
- binary_sensor.shelly_1pm_mini_gen3_411170_overpowering
- binary_sensor.shelly_plus_1pm_9d35dc_overpowering
- binary_sensor.shelly_plus_2pm_8d28f4_relay_1_overpower
- binary_sensor.shelly_plus_2pm_8d28f4_relay_2_overpower
- binary_sensor.shelly_plus_2pm_b67728_relay_1_overpower
- binary_sensor.shelly_plus_2pm_b67728_relay_2_overpower
- binary_sensor.shelly_pro_1pm_80e0c0_overpower
- binary_sensor.oswietlenie_pralnia_przeciazenie
- binary_sensor.oswietlenie_gabinet_przeciazenie
- binary_sensor.oswietlenie_toaleta_przeciazenie
- binary_sensor.oswietlenie_antek_przeciazenie
- binary_sensor.ledy_salon_przeciazenie
- binary_sensor.wentylator_i_oswietlenie_salon_przeciazenie
from: 'off'
to: 'on'
for:
minutes: 1
trigger: state
actions:
- data:
title: '{{ notification_title }}'
message: '{{ notification_message }}'
tag: notification-relay-overpower-{{ trigger.entity_id }}
priority: high
services:
- service: notify.mobile_app_iphone_13
type: ios
action: python_script.notify
variables:
notification_title: Zbyt duże obciążenie przekaźnika
notification_message: Przekaźnik urządzenia {{ device_attr(trigger.entity_id,
'name_by_user') or device_attr(trigger.entity_id, "name") }} ma zbyt duże obciążenie
i został wyłączony.
- id: notification_relay_overheating
alias: Przegrzanie przekaźnika
description: ''
triggers:
- entity_id:
- binary_sensor.shelly_plus_plug_s_2ffb28_overtemperature
- binary_sensor.shelly_plus_plug_s_d00c84_overtemperature
- binary_sensor.shelly_plus_1pm_948ff8_overtemperature
- binary_sensor.shelly_plus_1pm_b22864_overtemperature
- binary_sensor.shelly_1pm_mini_gen3_411170_overheating
- binary_sensor.shelly_plus_1pm_9d35dc_overheating
- binary_sensor.shelly_plus_2pm_8d28f4_relay_1_overtemperature
- binary_sensor.shelly_plus_2pm_8d28f4_relay_2_overtemperature
- binary_sensor.shelly_plus_2pm_b67728_relay_1_overtemperature
- binary_sensor.shelly_plus_2pm_b67728_relay_2_overtemperature
- binary_sensor.shelly_pro_1pm_80e0c0_overtemperature
- binary_sensor.oswietlenie_pralnia_przegrzewanie
- binary_sensor.oswietlenie_gabinet_przegrzewanie
- binary_sensor.oswietlenie_toaleta_przegrzewanie
- binary_sensor.oswietlenie_antek_przegrzewanie
- binary_sensor.ledy_salon_przegrzewanie
- binary_sensor.wentylator_i_oswietlenie_salon_przegrzewanie
from: 'off'
to: 'on'
for:
minutes: 1
trigger: state
actions:
- data:
title: '{{ notification_title }}'
message: '{{ notification_message }}'
tag: notification-relay-overheating-{{ trigger.entity_id }}
priority: high
services:
- service: notify.mobile_app_iphone_13
type: ios
action: python_script.notify
variables:
notification_title: Urządzenie się przegrzewa
notification_message: Urządzenie {{ device_attr(trigger.entity_id, 'name_by_user')
or device_attr(trigger.entity_id, "name") }} się przegrzewa.
- id: notification_motion_when_away_mode
alias: Ruch w pustym mieszkaniu
description: ''
trigger:
- platform: state
entity_id:
- binary_sensor.motion_antek
- binary_sensor.motion_antresola
- binary_sensor.motion_gabinet
- binary_sensor.motion_goscinny
- binary_sensor.ruch_korytarz
- binary_sensor.motion_kuchnia
- binary_sensor.motion_lazienka
- binary_sensor.motion_pracownia
- binary_sensor.motion_przedpokoj
- binary_sensor.motion_salon
- binary_sensor.motion_schody
- binary_sensor.motion_sypialnia
- binary_sensor.motion_toaleta
- binary_sensor.motion_pralnia
from: 'off'
to: 'on'
condition:
- condition: state
entity_id: input_boolean.away_mode
state: 'on'
for:
minutes: 10
action:
- variables:
area: '{{ area_name(trigger.entity_id) }}'
snapshot_name: '{{ now().strftime(''%Y%m%d_%H%M%S'') }}.jpg'
snapshot_areas:
- salon
- kuchnia
- przedpokój
- if:
- condition: template
value_template: '{{ area_name(trigger.entity_id) in snapshot_areas }}'
then:
- service: camera.snapshot
data:
filename: /media/snapshots/{{ snapshot_name }}
target:
entity_id: camera.salon
- service: python_script.notify
data:
title: Wykryto ruch w pustym mieszkaniu
message: 'Pomieszczenie: {{ area }}, godzina {{ now().strftime(''%H:%M'') }}.'
tag: notification-motion-{{ area }}
group: motion
priority: high
url: "{% if area in snapshot_areas %}\n /dashboard-living-room/0\n{% endif
%} "
image: "{% if area in snapshot_areas %}\n /media/local/snapshots/{{ snapshot_name
}}\n{% endif %}"
services:
- service: notify.mobile_app_iphone_13
type: ios
- service: notify.mobile_app_iphone_12
type: ios
- id: notification_window_opened_when_away_mode
alias: Otwarcie okna w pustym mieszkaniu
description: ''
trigger:
- platform: state
entity_id:
- binary_sensor.balcony_door_pracownia
- binary_sensor.balcony_door_sypialnia
- binary_sensor.window_antek
- binary_sensor.window_gabinet
- binary_sensor.window_goscinny
- binary_sensor.window_kuchnia
- binary_sensor.window_sypialnia
- binary_sensor.windows_antresola
- binary_sensor.windows_salon
from: 'off'
to: 'on'
condition:
- condition: state
entity_id: input_boolean.away_mode
state: 'on'
for:
minutes: 10
action:
- service: python_script.notify
data:
title: Wykryto otwarcie okna w pustym mieszkaniu
message: 'Pomieszczenie: {{ area_name(trigger.to_state.entity_id) }}, godzina
{{ now().strftime(''%H:%M'') }}.'
tag: notification-window-opened-{{ area_name(trigger.to_state.entity_id) }}
group: windows
priority: high
services:
- service: notify.mobile_app_iphone_13
type: ios
- service: notify.mobile_app_iphone_12
type: ios
- id: notification_balcony_door_pracownia_opened
alias: Drzwi balkonowe w pracowni otwarte
description: ''
trigger:
- platform: state
entity_id: binary_sensor.people_at_home
to: 'off'
condition:
- condition: state
entity_id: binary_sensor.balcony_door_pracownia
state: 'on'
action:
- service: python_script.notify
data:
title: Otwarte drzwi balkonowe
message: Domownicy opuścili mieszkanie, a drzwi balkonowe w pracowni nie są
zamknięte.
tag: notification-balcony-door-pracownia
priority: high
group: windows
services:
- service: notify.mobile_app_iphone_13
type: ios
- service: notify.mobile_app_iphone_12
type: ios
- id: notification_gas_leak_kuchnia
alias: Wyciek gazu w kuchni
description: ''
trigger:
- platform: state
entity_id: binary_sensor.gas_leak_kuchnia
from: 'off'
to: 'on'
action:
- parallel:
- service: python_script.notify
data:
title: Wyciek gazu
message: Uwaga! Wykryto wyciek gazu w kuchni!
tag: notification-gas-leak
priority: high
group: gas
services:
- service: notify.mobile_app_iphone_13
type: ios
- service: notify.mobile_app_iphone_12
type: ios
- service: notify.mobile_app_iphone_11
type: ios
- if:
- condition: state
entity_id: script.devices_away_mode
state: 'off'
then:
- service: xiaomi_aqara.play_ringtone
data:
gw_mac: f0b429cc6f0b
ringtone_id: 2
ringtone_vol: 20
- delay: 00:00:05
- service: xiaomi_aqara.play_ringtone
data:
gw_mac: f0b429cc6f0b
ringtone_id: 2
ringtone_vol: 20
- id: notification_low_battery
alias: Niski poziom naładowania baterii
description: ''
trigger:
- platform: time
at: '18:00:00'
condition:
- condition: template
value_template: "{% macro battery_level() %}\n {% for item in states.sensor if
item.attributes.device_class == 'battery' and item.attributes.unit_of_measurement
== '%' and item.state != \"unavailable\" and item.state | int(-1) < threshold
%}\n {{ item.entity_id }}\n {% endfor %}\n{% endmacro %} {{ battery_level()
| trim != '' }}\n"
action:
- service: python_script.notify
data:
title: Niski poziom naładowania baterii
message: "{% macro battery_level() %}{% for item in states.sensor if item.attributes.device_class
== 'battery' and item.attributes.unit_of_measurement == '%' and item.state
| int(0) < threshold %}\n - {{ device_attr(item.entity_id, 'name_by_user')
}}{% if area_name(item.entity_id) %}, {{ area_name(item.entity_id) }}{% endif
%} [{{ item.state | round(0, default='unknown') }}%]{% endfor %}{% endmacro
%}W następujących urządzeniach jest niski poziom naładowania baterii: {{ battery_level()
}}"
tag: notification-low-battery
group: other
services:
- service: notify.mobile_app_iphone_13
type: ios
variables:
threshold: 20
- id: presence_peoples_away
alias: Domownicy poza domem
description: ''
triggers:
- entity_id: binary_sensor.people_at_home
to: 'off'
trigger: state
actions:
- entity_id: input_boolean.away_mode
action: input_boolean.turn_on
- if:
- condition: state
entity_id: binary_sensor.windows
state: 'on'
- condition: numeric_state
entity_id: sensor.dom_prawdopodobienstwo_opadow
above: 20
then:
- data:
title: Otwarte okna
message: Okna w pustym mieszkaniu nie są zamknięte, a prawdopodobieństwo opadów
wynosi {{ states('sensor.dom_prawdopodobienstwo_opadow') | int }}%.
tag: notification-windows-weather
group: windows
priority: high
services:
- service: notify.mobile_app_iphone_13
type: ios
- service: notify.mobile_app_iphone_12
type: ios
action: python_script.notify
- id: presence_peoples_back
alias: Domownicy w domu
description: ''
triggers:
- entity_id: binary_sensor.people_at_home
to: 'on'
trigger: state
actions:
- entity_id: input_boolean.away_mode
action: input_boolean.turn_off
- if:
- condition: sun
after: sunset
then:
- target:
entity_id: light.leds_schody
data: {}
action: light.turn_on
- id: heating_aeotec_thermostat_calibration
alias: Kalibracja termostatu Aeotec
description: ''
trigger:
- platform: time
at: 00:10:00
condition:
- condition: state
entity_id: input_boolean.heating_season
state: 'on'
- condition: state
entity_id: input_boolean.heating_airing
state: 'off'
action:
- service: climate.set_preset_mode
entity_id: climate.aeotec_zwa021_thermostat_023
data:
preset_mode: Full power
- delay: 00:00:15
- service: climate.turn_off
entity_id: climate.aeotec_zwa021_thermostat_023
- delay: 00:00:15
- service: climate.turn_on
entity_id: climate.aeotec_zwa021_thermostat_023
- id: heating_day
alias: Tryb dzienny ogrzewania
description: ''
trigger:
- platform: state
entity_id:
- schedule.heating
from: 'off'
to: 'on'
condition:
- condition: state
entity_id: input_boolean.heating_season
state: 'on'
- condition: state
entity_id: input_boolean.away_mode
state: 'off'
- condition: state
entity_id: binary_sensor.windows
state: 'off'
action:
- service: script.heating_day
data: {}
- id: heating_night
alias: Tryb nocny ogrzewania
description: ''
trigger:
- platform: state
entity_id:
- schedule.heating
from: 'on'
to: 'off'
condition:
- condition: state
entity_id: input_boolean.heating_season
state: 'on'
- condition: state
entity_id: input_boolean.away_mode
state: 'off'
- condition: state
entity_id: binary_sensor.windows
state: 'off'
action:
- service: script.heating_night
data: {}
- id: turn_off_ceiling_fan_for_night
alias: Wyłącz wentylator w salonie na noc
description: ''
triggers:
- entity_id: light.ceiling_salon
to: 'off'
trigger: state
conditions:
- condition: state
entity_id: fan.ceiling_salon
state: 'on'
- condition: state
entity_id: media_player.philips_65oled707
state: 'off'
actions:
- entity_id: fan.ceiling_salon
action: fan.turn_off
- id: heating_away_mode
alias: Tryb "poza domem" ogrzewania
description: ''
trigger:
- platform: state
entity_id: input_boolean.away_mode
from: 'off'
to: 'on'
for:
minutes: 10
condition:
- condition: state
entity_id: input_boolean.heating_season
state: 'on'
- condition: state
entity_id: input_boolean.heating_airing
state: 'off'
action:
- service: script.heating_away_mode
data: {}
- id: heating_peoples_back
alias: Powrót domowników do domu
description: ''
trigger:
- platform: state
entity_id: input_boolean.away_mode
from: 'on'
to: 'off'
condition:
- condition: state
entity_id: input_boolean.heating_season
state: 'on'
- condition: state
entity_id: input_boolean.heating_airing
state: 'off'
action:
- choose:
- conditions:
- condition: state
entity_id: schedule.heating
state: 'on'
sequence:
service: script.heating_day
data: {}
default:
service: script.heating_night
data: {}
- id: windows_opened
alias: Okna otwarte
description: ''
triggers:
- entity_id:
- binary_sensor.windows
from: 'off'
to: 'on'
for:
hours: 0
minutes: 30
seconds: 0
trigger: state
actions:
- entity_id: fan.xiaomi_mi_air_purifier_3h
action: fan.turn_off
- condition: state
entity_id: input_boolean.heating_season
state: 'on'
- entity_id: input_boolean.heating_airing
action: input_boolean.turn_on
- id: windows_closed
alias: Okna zamknięte
description: ''
triggers:
- entity_id: binary_sensor.windows
from: 'on'
to: 'off'
for:
minutes: 5
trigger: state
actions:
- condition: state
entity_id: input_boolean.heating_season
state: 'on'
- entity_id: input_boolean.heating_airing
action: input_boolean.turn_off
- id: air_quality_turn_on_air_purifier
alias: Rozpoczęcie oczyszczania powietrza w salonie
description: ''
trigger:
- platform: numeric_state
entity_id: sensor.pm25_salon
above: 50
for:
minutes: 2
condition:
- condition: state
entity_id: binary_sensor.windows
state: 'off'
action:
- service: fan.turn_on
entity_id: fan.xiaomi_mi_air_purifier_3h
data:
percentage: "{% if states('sensor.pm25_salon') | int(0) > 100 %}\n 66\n{% else
%}\n 33\n{% endif %}"
- id: air_quality_turn_off_air_purifier
alias: Zakończenie oczyszczania powietrza w salonie
description: ''
trigger:
- platform: numeric_state
entity_id: sensor.pm25_salon
below: 50
for:
minutes: 2
action:
- service: fan.turn_off
entity_id: fan.xiaomi_mi_air_purifier_3h
- id: air_quality_air_purifier_switch_fan_level_to_2
alias: Zmiana prędkości oczyszczacza na 2
description: ''
trigger:
- platform: numeric_state
entity_id: sensor.pm25_salon
above: 100
for:
minutes: 2
condition:
- condition: state
entity_id: fan.xiaomi_mi_air_purifier_3h
state: 'on'
- condition: numeric_state
entity_id: number.xiaomi_mi_air_purifier_3h_fan_level
below: 2
action:
- service: number.set_value
entity_id: number.xiaomi_mi_air_purifier_3h_fan_level
data:
value: 2
- id: air_quality_air_purifier_switch_fan_level_to_1
alias: Zmiana prędkości oczyszczacza na 1
description: ''
trigger:
- platform: numeric_state
entity_id: sensor.pm25_salon
below: 100
for:
minutes: 2
condition:
- condition: state
entity_id: fan.xiaomi_mi_air_purifier_3h
state: 'on'
- condition: numeric_state
entity_id: number.xiaomi_mi_air_purifier_3h_fan_level
above: 1
action:
- service: number.set_value
entity_id: number.xiaomi_mi_air_purifier_3h_fan_level
data:
value: 1
- id: heating_airing_begin
alias: Początek przewietrzania
description: ''
trigger:
- platform: state
entity_id: input_boolean.heating_airing
from: 'off'
to: 'on'
condition:
- condition: state
entity_id: input_boolean.heating_season
state: 'on'
action:
- service: script.heating_airing_begin
data: {}
- id: heating_airing_end
alias: Koniec przewietrzania
description: ''
triggers:
- entity_id: input_boolean.heating_airing
from: 'on'
to: 'off'
trigger: state
conditions:
- condition: state
entity_id: input_boolean.heating_season
state: 'on'
actions:
- action: climate.turn_on
metadata: {}
data: {}
target:
entity_id:
- climate.grzejnik_gabinet
- climate.grzejnik_lazienka
- climate.grzejnik_goscinny
- choose:
- conditions:
- condition: state
entity_id: schedule.heating
state: 'on'
sequence:
data: {}
action: script.heating_day
default:
data: {}
action: script.heating_night
- condition: state
entity_id: binary_sensor.windows
state: 'on'
- data:
title: Koniec przewietrzania
message: Wyłączono tryb przewietrzania. Proszę zamknąć okna!
tag: notification-airing-end
group: heating
priority: high
services:
- service: notify.mobile_app_iphone_13
type: ios
- service: notify.mobile_app_iphone_12
type: ios
action: python_script.notify
- id: heating_season_begin
alias: Początek sezonu grzewczego
description: ''
trigger:
- platform: state
entity_id: input_boolean.heating_season
from: 'off'
to: 'on'
action:
- choose:
- conditions:
- condition: state
entity_id: schedule.heating
state: 'on'