-
Notifications
You must be signed in to change notification settings - Fork 0
/
automations.yaml
2045 lines (1861 loc) · 58.6 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
##################################################### Zigbee
- id: enable_zigbee_join
alias: Enable Zigbee joining
trigger:
platform: state
entity_id: input_boolean.zigbee_permit_join
to: 'on'
action:
- service: mqtt.publish
data:
topic: zigbee2mqtt/bridge/config/permit_join
payload: 'true'
- service: timer.start
data:
entity_id: timer.zigbee_permit_join
- id: disable_zigbee_join
alias: Disable Zigbee joining
trigger:
- entity_id: input_boolean.zigbee_permit_join
platform: state
to: 'off'
action:
- data:
payload: 'false'
topic: zigbee2mqtt/bridge/config/permit_join
service: mqtt.publish
- data:
entity_id: timer.zigbee_permit_join
service: timer.cancel
- id: disable_zigbee_join_timer
alias: Disable Zigbee joining by timer
trigger:
- platform: event
event_type: timer.finished
event_data:
entity_id: timer.zigbee_permit_join
action:
- service: mqtt.publish
data:
topic: zigbee2mqtt/bridge/config/permit_join
payload: 'false'
- service: input_boolean.turn_off
data:
entity_id: input_boolean.zigbee_permit_join
##################################################### Led Pasik Kuchyna
- id: Kuchyna - Zapni led pasik pri pohybe a 90Lux - Noc
alias: Kuchyna - Zapni led pasik pri pohybe a 90Lux - Noc
trigger:
- platform: state
entity_id: binary_sensor.0x54ef4410005a9493_occupancy
to: 'on'
condition:
- condition: numeric_state
entity_id: sensor.0x54ef4410005a9493_illuminance
below: 90
- condition: time
after: "23:30:00"
before: "07:00:00"
- condition: state
entity_id: group.kuchyna
state: 'off'
action:
- service: yeelight.set_color_scene
data:
entity_id: light.kuchyna_pasik
rgb_color: [255,255,255]
brightness: '10'
- id: Kuchyna - Zapni led pasik pri pohybe a 90Lux - Den
alias: Kuchyna - Zapni led pasik pri pohybe a 90Lux - Den
trigger:
- platform: state
entity_id: binary_sensor.0x54ef4410005a9493_occupancy
to: 'on'
condition:
- condition: numeric_state
entity_id: sensor.0x54ef4410005a9493_illuminance
below: 90
- condition: time
after: "07:01:00"
before: "23:29:58"
- condition: state
entity_id: group.kuchyna
state: 'off'
action:
- service: yeelight.set_color_scene
data:
entity_id: light.kuchyna_pasik
rgb_color: [255,255,255]
brightness: '100'
- id: Kuchyna - Vypni led pasik bez pohybu
alias: Kuchyna - Vypni led pasik bez pohybu
trigger:
- platform: state
entity_id: binary_sensor.0x54ef4410005a9493_occupancy
to: 'off'
for:
seconds: 6
action:
- service: light.turn_off
entity_id: light.kuchyna_pasik
######################################################################### Vypinace
##################################################### Vypinac Spalna
- id: Vypinac Spalna Prave tlacidlo
alias: Vypinac Spalna Prave tlacidlo zapina/vypina svetlo
trigger:
- platform: mqtt
topic: zigbee2mqtt/0x00158d0002b45642
condition:
condition: template
value_template: '{{ ''right'' == trigger.payload_json.click }}'
action:
service: homeassistant.toggle
entity_id: light.spalna_hlavne_svetlo
- id: Vypinac Spalna Lave tlacidlo
alias: Vypinac Spalna Lave tlacidlo zapina/vypina svetlo
trigger:
- platform: mqtt
topic: zigbee2mqtt/0x00158d0002b45642
condition:
condition: template
value_template: '{{ ''left'' == trigger.payload_json.click }}'
action:
service: homeassistant.toggle
entity_id: light.postel_led_pasik_2
##################################################### Vypinac Obyvacka
- id: Vypinac Obyvacka Prave tlacidlo
alias: Vypinac Obyvacka Prave tlacidlo zapina/vypina svetlo
trigger:
- platform: mqtt
topic: zigbee2mqtt/0x00158d0002afe6a9
condition:
condition: template
value_template: '{{ ''right'' == trigger.payload_json.click }}'
action:
service: homeassistant.toggle
entity_id: light.obyvacka_hlavne_svetlo
- id: Vypinac Obyvacka Lave tlacidlo
alias: Vypinac Obyvacka Lave tlacidlo zapina/vypina svetlo
trigger:
- platform: mqtt
topic: zigbee2mqtt/0x00158d0002afe6a9
condition:
condition: template
value_template: '{{ ''left'' == trigger.payload_json.click }}'
action:
service: homeassistant.toggle
entity_id:
- light.vstupna_chodba_bodovka_1
- light.vstupna_chodba_bodovka_2
- light.vstupna_chodba_bodovka_3
##################################################### Vypinac Pracovna
- id: Vypinac Pracovna Prave tlacidlo
alias: Vypinac Pracovna Prave tlacidlo zapina/vypina svetlo
trigger:
- platform: mqtt
topic: zigbee2mqtt/0x00158d000650329f
condition:
condition: template
value_template: '{{ ''right'' == trigger.payload_json.action }}'
action:
service: homeassistant.toggle
entity_id: light.pracovna_hlavne_svetlo
# - id: Vypinac Pracovna Lave tlacidlo
# alias: Vypinac Pracovna Lave tlacidlo zapina/vypina svetlo
# trigger:
# - platform: mqtt
# topic: zigbee2mqtt/0x00158d000650329f
# condition:
# condition: template
# value_template: '{{ ''left'' == trigger.payload_json.action }}'
# action:
# service: homeassistant.toggle
# entity_id: switch.pracovna
##################################################### Chodba
- id: Chodba Svetlo 8:00 - 22:00
alias: Chodba Svetlo 8:00 - 22:00
mode: restart
trigger:
- device_id: 16a0bb44063547848bdb9d695ff93fa5
domain: binary_sensor
entity_id: binary_sensor.0x00158d0004494467_occupancy
platform: device
type: motion
condition:
- condition: time
after: "08:00:00"
before: '22:00:00'
action:
- data:
scene: '1'
entity_id:
- light.chodba_bodovka_1
- light.chodba_bodovka_2
- light.chodba_bodovka_3
service: xiaomi_miio.light_set_scene
- id: Chodba Svetlo 22:00 - 08:00
alias: Chodba Svetlo 22:00 - 08:00
mode: restart
trigger:
- device_id: 16a0bb44063547848bdb9d695ff93fa5
domain: binary_sensor
entity_id: binary_sensor.0x00158d0004494467_occupancy
platform: device
type: motion
condition:
- condition: time
after: "22:00:02"
before: '07:59:59'
action:
- data:
scene: '4'
entity_id:
- light.chodba_bodovka_1
- light.chodba_bodovka_2
- light.chodba_bodovka_3
service: xiaomi_miio.light_set_scene
- id: Chodba vypnutie svetla
alias: Chodba vypnutie svetla
trigger:
- platform: state
entity_id: binary_sensor.0x00158d0004494467_occupancy
to: 'off'
for:
seconds: 21
action:
- service: light.turn_off
entity_id:
- light.chodba_bodovka_1
- light.chodba_bodovka_2
- light.chodba_bodovka_3
##################################################### Vstupna Chodba
- id: Vstupna Chodba Svetlo 8:00 - 22:00
alias: Vstupna Chodba Svetlo 8:00 - 22:00
mode: restart
trigger:
- device_id: 50c0132a39e7429b94ff69348bb0d911
domain: binary_sensor
entity_id: binary_sensor.0x00158d0002753dcc_occupancy
platform: device
type: motion
condition:
- condition: time
after: "08:00:00"
before: '22:00:00'
action:
- data:
scene: '1'
entity_id:
- light.vstupna_chodba_bodovka_1
- light.vstupna_chodba_bodovka_2
- light.vstupna_chodba_bodovka_3
service: xiaomi_miio.light_set_scene
- id: Vstupna Chodba Svetlo 22:00 - 08:00
alias: Vstupna Chodba Svetlo 22:00 - 08:00
mode: restart
trigger:
- device_id: 50c0132a39e7429b94ff69348bb0d911
domain: binary_sensor
entity_id: binary_sensor.0x00158d0002753dcc_occupancy
platform: device
type: motion
condition:
- condition: time
after: "22:00:02"
before: '07:59:59'
action:
- data:
scene: '4'
entity_id:
- light.vstupna_chodba_bodovka_1
- light.vstupna_chodba_bodovka_2
- light.vstupna_chodba_bodovka_3
service: xiaomi_miio.light_set_scene
- id: Vstupna Chodba vypnutie svetla
alias: Vstupna Chodba vypnutie svetla
trigger:
- platform: state
entity_id: binary_sensor.0x00158d0002753dcc_occupancy
to: 'off'
for:
seconds: 21
action:
- service: light.turn_off
entity_id:
- light.vstupna_chodba_bodovka_1
- light.vstupna_chodba_bodovka_2
- light.vstupna_chodba_bodovka_3
##################################################### Kupelna
- id: Kupelna Odsavanie Vlhkosti nad 80 percent
alias: Kupelna Odsavanie Vlhkosti
trigger:
- entity_id: sensor.0x00158d0002d4786c_humidity
platform: numeric_state
above: '80'
condition:
- condition: state
entity_id: switch.kupelna_ventilacka
state: 'off'
action:
- service: switch.turn_on
entity_id: switch.kupelna_ventilacka
- service: notify.mobile_app_samsung_s21
data:
message: "Odsavanie sa zaplo o {{ now().strftime('%H:%M:%S %A %d %B %Y') }} Aktualna vlhkost je {{state_attr('sensor.0x00158d0002d4786c_humidity', 'humidity')}} %. "
data:
ttl: 0
priority: high
- id: Kupelna Vypnutie odsavanie Vlhkosti - 75 percent
alias: Kupelna Vypnutie odsavanie Vlhkosti - 75 percent
trigger:
- entity_id: sensor.0x00158d0002d4786c_humidity
platform: numeric_state
below: '75'
condition:
- condition: state
entity_id: switch.kupelna_ventilacka
state: 'on'
action:
- service: switch.turn_off
entity_id: switch.kupelna_ventilacka
- service: notify.mobile_app_samsung_s21
data:
message: "Odsavanie sa vyplo o {{ now().strftime('%H:%M:%S %A %d %B %Y') }}. Aktualna vlhkost je {{state_attr('sensor.0x00158d0002d4786c_humidity', 'humidity')}} %. "
data:
ttl: 0
priority: high
######## Svetlo
- id: Kupelna Svetlo vypnutie po 60 min
alias: Kupelna Svetlo vypnutie po 60 min
mode: restart
trigger:
- platform: state
entity_id: switch.kupelna_svetlo
to: 'on'
for:
minutes: 60
action:
- service: switch.turn_off
entity_id: switch.kupelna_svetlo
##################################################### TV Mode
- id: TV Mode Light
alias: TV Mode Light
trigger:
- platform: sun
event: 'sunset'
offset: '-00:30:00'
condition:
- condition: device
device_id: 1cb152c0e364422bb003be4ab140daa6
domain: media_player
entity_id: media_player.samsung_ue55f9000
type: is_on
action:
# - service: switch.turn_on
# entity_id: switch.obyvacka_predlzovacka
# - delay: 00:01:00
- service: light.turn_on
entity_id: light.obyvacka_lampa
- service: light.turn_off
entity_id: light.obyvacka_hlavne_svetlo
- service: switch.turn_on
entity_id: switch.router_zasuvka #stromcek
- service: light.turn_on
data:
entity_id: light.wled_3
effect: "Flow"
brightness: 50 #vianocna parapeta
# - service: switch.turn_on
# entity_id: switch.stara_pracovna #vianocny balkon
- service: notify.mobile_app_samsung_s21
data:
message: "TV Mode Light automatizacia spustena o {{ now().strftime('%H:%M:%S %A %d %B %Y') }}"
data:
ttl: 0
priority: high
- id: TV Mode Light2
alias: TV Mode Light2
mode: restart
trigger:
- platform: state
entity_id: media_player.samsung_ue55f9000
to: 'on'
condition:
- condition: sun
after: sunset
after_offset: '-00:30:00'
action:
- service: light.turn_on
entity_id: light.obyvacka_lampa
- service: light.turn_off
entity_id: light.obyvacka_hlavne_svetlo
- service: switch.turn_on
entity_id: switch.router_zasuvka #stromcek
- service: light.turn_on
data:
entity_id: light.wled_3
effect: "Flow"
brightness: 50 #vianocna parapeta
# - service: switch.turn_on
# entity_id: switch.stara_pracovna #vianocny balkon
- service: notify.mobile_app_samsung_s21
data:
message: "TV Mode Light2 automatizacia spustena o {{ now().strftime('%H:%M:%S %A %d %B %Y') }}"
data:
ttl: 0
priority: high
##################################################### Vypnutie TV
- id: Vypnutie TV vecer 00:01:00
alias: Vypnutie TV vecer 00:01:00
trigger:
- at: "00:01:00"
platform: time
condition:
- condition: device
device_id: 1cb152c0e364422bb003be4ab140daa6
domain: media_player
entity_id: media_player.samsung_ue55f9000
type: is_off
action:
- service: switch.turn_off
entity_id: switch.tv_zasuvka
# - service: switch.turn_off
# entity_id: switch.obyvacka_predlzovacka
##################################################### Vypnutie Zone2 na zosilovaci
- id: Vypnutie Zone2 na zosilovaci
alias: Vypnutie Zone2 na zosilovaci
trigger:
- platform: state
entity_id: media_player.denon_avr_x1600h
to: 'off'
action:
- delay: 00:00:02
- service: media_player.turn_off
entity_id: media_player.denon_avr_x1600h_2
##################################################### Vypnutie Satelitu ak je zapnuty Shield
- id: Vypnutie Satelitu ak je zapnuty Shield
alias: Vypnutie Satelitu ak je zapnuty Shield
trigger:
- platform: state
entity_id: media_player.nvidia_shield
from: 'off'
to: 'idle'
- platform: state
entity_id: media_player.nvidia_shield
from: 'off'
to: 'playing'
action:
- service: media_player.turn_off
entity_id: media_player.enigma2_media_player
##################################################### Diana odchod z Prace
- id: Diana odchod z Prace
alias: Diana odchod z Prace
trigger:
- platform: zone
event: leave
zone: zone.diana_praca
entity_id: device_tracker.samsung_s20
action:
- service: notify.mobile_app_samsung_s21
data:
message: "Diana odisla z prace o {{ now().strftime('%H:%M:%S %A %d %B %Y') }}"
data:
ttl: 0
priority: high
##################################################### Zasuvky
- id: Predlzovacka Vypnutie pod 2W
alias: Predlzovacka Vypnutie pod 2W
mode: restart
trigger:
- entity_id: sensor.obyvacka_predlzovacka_energy_power
platform: numeric_state
below: '2'
condition:
- condition: state
entity_id: switch.obyvacka_predlzovacka
state: 'on'
action:
- service: switch.turn_off
entity_id: switch.obyvacka_predlzovacka
- service: notify.mobile_app_samsung_s21
data:
message: "Predlzovacka sa vypla {{ now().strftime('%H:%M:%S %A %d %B %Y') }}"
data:
ttl: 0
priority: high
# - id: Pracovna zasuvka Vypnutie pod 5.5W
# alias: Pracovna zasuvka Vypnutie pod 5.5W
# mode: restart
# trigger:
# - entity_id: sensor.pracovna_energy_power
# platform: numeric_state
# below: '5.5'
# condition:
# - condition: state
# entity_id: switch.pracovna
# state: 'on'
# action:
# - delay: 00:02:00
# - service: switch.turn_off
# entity_id: switch.pracovna
# - service: notify.mobile_app_samsung_s21
# data:
# message: "Zasuvka v pracovni sa vypla {{ now().strftime('%H:%M:%S %A %d %B %Y') }}"
# data:
# ttl: 0
# priority: high
- id: TV zasuvka Vypnutie pod 25W
alias: TV zasuvka Vypnutie pod 25W
mode: restart
trigger:
- entity_id: sensor.tv_zasuvka_energy_power
platform: numeric_state
below: '25'
condition:
- condition: state
entity_id: switch.tv_zasuvka
state: 'on'
action:
- delay: 00:02:00
- service: switch.turn_off
entity_id: switch.tv_zasuvka
- service: notify.mobile_app_samsung_s21
data:
message: "TV sa vypla {{ now().strftime('%H:%M:%S %A %d %B %Y') }}"
data:
ttl: 0
priority: high
- id: Vypnutie pracky a susicky o polnoci
alias: Vypnutie pracky a susicky o polnoci
trigger:
- at: "00:01:00"
platform: time
action:
- service: switch.turn_off
entity_id:
- switch.pracka_zasuvka
- switch.susicka_zasuvka
##################################################### Vypinac WC
######## Ventilacka
- id: WC Ventilacka vypnutie po 1. minute
alias: WC Ventilacka vypnutie po 1. minute
mode: restart
trigger:
- entity_id: switch.wc_ventilacka
from: 'off'
platform: state
to: 'on'
action:
- delay: 00:01:00
- service: switch.turn_off
entity_id: switch.wc_ventilacka
######## Svetlo
- id: WC Svetlo vypnutie po 30 min
alias: WC Svetlo vypnutie po 30 min
mode: restart
trigger:
- platform: state
entity_id: switch.wc_svetlo
to: 'on'
for:
minutes: 30
action:
- service: switch.turn_off
entity_id: switch.wc_svetlo
####################################################### Radiator Spalna
######### ZAP
- id: Spalna - Zapnutie Kurenia pod 23 stupna
alias: Spalna - Zapnutie Kurenia pod 23 stupna
trigger:
platform: time_pattern
minutes: '/1'
condition:
- condition: and
conditions:
- condition: time
after: "22:00:00"
before: "08:00:00"
#### Podmienka ze teplota na teplomery je mensia ako teplota pre radiator nastavena na Administration pre spalnu
- condition: template
value_template: "{{ states('sensor.ble_temperature_4c65a8dfc04a')| float(0)|round(1) < states('input_number.radiator_spalna')| float(0)|round(1) }}"
#### Podmienka ze teplota na na riadore sa nerovna teplote pre radiator nastavena na Administration pre spalnu
- condition: template
value_template: "{{ states('sensor.radiator_spalna_heat_setpoint')| float(0)|round(1) != states('input_number.radiator_spalna')| float(0)|round(1) }}"
- condition: state
entity_id: binary_sensor.0x00158d00054d661a_contact
state: 'off'
- condition: state
entity_id: binary_sensor.0x00158d00069b07d7_contact
state: 'off'
- condition: or
conditions:
- condition: state
entity_id: device_tracker.samsung_s21
state: 'home'
- condition: state
entity_id: device_tracker.samsung_s20
state: 'home'
action:
- service: mqtt.publish
data:
topic: zigbee2mqtt/0xbc33acfffe37e579/set
payload: '{"current_heating_setpoint":"{{ states.input_number.radiator_spalna.state | float(0)|round(1) }}"}'
- service: notify.mobile_app_samsung_s21
data:
message: "Spalna - Kurenie sa zaplo {{ now().strftime('%H:%M:%S %A %d %B %Y') }} Aktualna teplota je {{state_attr('sensor.ble_temperature_4c65a8dfc04a', 'mean')}} °C. "
data:
ttl: 0
priority: high
######### VYP Radiatora - TEPLOTA
- id: Spalna - Vypnutie Kurenia nad 23 stupna
alias: Spalna - Vypnutie Kurenia nad 23 stupna
trigger:
platform: time_pattern
minutes: '/1'
condition:
- condition: and
conditions:
- condition: time
after: "22:00:00"
before: "08:00:00"
### Opacne ako v predchazajucej automatizacii
- condition: template
value_template: "{{ states('sensor.ble_temperature_4c65a8dfc04a')| float(0)|round(1) > states('input_number.radiator_spalna')| float(0)|round(1) }}"
### Opacne ako v predchazajucej automatizacii
- condition: template
value_template: "{{ states('sensor.radiator_spalna_heat_setpoint')| float(0)|round(1) == states('input_number.radiator_spalna')| float(0)|round(1) }}"
action:
- service: mqtt.publish
data:
topic: zigbee2mqtt/0xbc33acfffe37e579/set
payload: '{"current_heating_setpoint":"5.0"}'
######### VYP Radiatora -CAS
- id: Spalna - Vypnutie Kurenia po 9:00
alias: Spalna - Vypnutie Kurenia po 9:00
trigger:
- at: "09:00:00"
platform: time
action:
- service: mqtt.publish
data:
topic: zigbee2mqtt/0xbc33acfffe37e579/set
payload: '{"current_heating_setpoint":"5.0"}'
######### VYP Radiatora -Okno
- id: Spalna - Vypnutie Kurenia ak je otvorene okno
alias: Spalna - Vypnutie Kurenia ak je otvorene okno
trigger:
- platform: state
entity_id: binary_sensor.0x00158d00054d661a_contact
from: "off"
to: 'on'
action:
- service: mqtt.publish
data:
topic: zigbee2mqtt/0xbc33acfffe37e579/set
payload: '{"current_heating_setpoint":"5.0"}'
####################################################### Radiator Obyvacka
######### ZAP
- id: Obyvacka - Zapnutie kurenia ked je zapnuta TV
alias: Obyvacka - Zapnutie kurenia ked je zapnuta TV
trigger:
platform: time_pattern
minutes: '/1'
condition:
- condition: and
conditions:
- condition: device
device_id: 1cb152c0e364422bb003be4ab140daa6
domain: media_player
entity_id: media_player.samsung_ue55f9000
type: is_on
#### Podmienka ze teplota na teplomery je mensia ako teplota pre radiator nastavena na Administration pre obyvacku
- condition: template
value_template: "{{ states('sensor.ble_temperature_4c65a8d0b9be')| float(0)|round(1) < states('input_number.radiator_obyvacka')| float(0)|round(1) }}"
#### Podmienka ze teplota na na riadore sa nerovna teplote pre radiator nastavena na Administration pre obyvacku
- condition: template
value_template: "{{ states('sensor.radiator_obyvacka_heat_setpoint')| float(0)|round(1) != states('input_number.radiator_obyvacka')| float(0)|round(1) }}"
- condition: state
entity_id: binary_sensor.0x00158d00054dafc8_contact
state: 'off'
- condition: state
entity_id: binary_sensor.0x00124b002269eafa_contact
state: 'off'
- condition: state
entity_id: binary_sensor.0x00124b0022ed310a_contact
state: 'off'
- condition: state
entity_id: binary_sensor.0x00124b002266fd11_contact
state: 'off'
action:
- service: mqtt.publish
data:
topic: zigbee2mqtt/0x60a423fffea0fc8f/set
payload: '{"current_heating_setpoint":"{{ states.input_number.radiator_obyvacka.state | float(0)|round(1) }}"}'
- service: notify.mobile_app_samsung_s21
data:
message: "Obyvacka - Kurenie sa zaplo {{ now().strftime('%H:%M:%S %A %d %B %Y') }} Aktualna teplota je {{state_attr('sensor.ble_temperature_4c65a8d0b9be', 'mean')}} °C. "
data:
ttl: 0
priority: high
######### VYP
- id: Obyvacka - Vypnutie kurenia ked je teplota nad 24
alias: Obyvacka - Vypnutie kurenia ked je teplota nad 24
trigger:
platform: time_pattern
minutes: '/1'
condition:
### Opacne ako v predchazajucej automatizacii
- condition: template
value_template: "{{ states('sensor.ble_temperature_4c65a8d0b9be')| float(0)|round(1) > states('input_number.radiator_obyvacka')| float(0)|round(1) }}"
### Opacne ako v predchazajucej automatizacii
- condition: template
value_template: "{{ states('sensor.radiator_obyvacka_heat_setpoint')| float(0)|round(1) == states('input_number.radiator_obyvacka')| float(0)|round(1) }}"
action:
- service: mqtt.publish
data:
topic: zigbee2mqtt/0x60a423fffea0fc8f/set
payload: '{"current_heating_setpoint":"5.0"}'
- service: notify.mobile_app_samsung_s21
data:
message: "Obyvacka - Kurenie sa vyplo {{ now().strftime('%H:%M:%S %A %d %B %Y') }} Aktualna teplota je {{state_attr('sensor.ble_temperature_4c65a8d0b9be', 'mean')}} °C. "
data:
ttl: 0
priority: high
######### VYP Radiatora -Okno
- id: Obyvacka - Vypnutie Kurenia ak je otvorene okno
alias: Obyvacka - Vypnutie Kurenia ak je otvorene okno
trigger:
- platform: state
entity_id: binary_sensor.0x00158d00054dafc8_contact
from: "off"
to: 'on'
- platform: state
entity_id: binary_sensor.0x00124b002269eafa_contact
from: "off"
to: 'on'
- platform: state
entity_id: binary_sensor.0x00124b0022ed310a_contact
from: "off"
to: 'on'
action:
- service: mqtt.publish
data:
topic: zigbee2mqtt/0x60a423fffea0fc8f/set
payload: '{"current_heating_setpoint":"5.0"}'
######### ZAP
- id: Obyvacka - Notifikacia otvorenych dveri kvoli kureniu
alias: Obyvacka - Notifikacia otvorenych dveri kvoli kureniu
trigger:
platform: time_pattern
minutes: '/30'
condition:
- condition: and
conditions:
- condition: device
device_id: 1cb152c0e364422bb003be4ab140daa6
domain: media_player
entity_id: media_player.samsung_ue55f9000
type: is_on
- condition: template
value_template: "{{ states('sensor.ble_temperature_4c65a8d0b9be')| float(0)|round(1) < states('input_number.radiator_obyvacka')| float(0)|round(1) }}"
- condition: template
value_template: "{{ states('sensor.radiator_obyvacka_heat_setpoint')| float(0)|round(1) != states('input_number.radiator_obyvacka')| float(0)|round(1) }}"
- condition: state
entity_id: binary_sensor.0x00158d00054dafc8_contact
state: 'off'
- condition: state
entity_id: binary_sensor.0x00124b002269eafa_contact
state: 'off'
- condition: state
entity_id: binary_sensor.0x00124b0022ed310a_contact
state: 'off'
- condition: state
entity_id: binary_sensor.0x00124b002266fd11_contact
state: 'on'
action:
- service: notify.mobile_app_samsung_s21
data:
message: "Obyvacka - Ak chces aby sa kurenie zaplo chod zavriet dvere na chodbu. Aktualna teplota je {{state_attr('sensor.ble_temperature_4c65a8d0b9be', 'mean')}} °C. Cas {{ now().strftime('%H:%M:%S %A %d %B %Y') }} "
data:
ttl: 0
priority: high
- service: notify.mobile_app_samsung_s20
data:
message: "Obyvacka - Ak chces aby sa kurenie zaplo chod zavriet dvere na chodbu. Aktualna teplota je {{state_attr('sensor.ble_temperature_4c65a8d0b9be', 'mean')}} °C. Cas {{ now().strftime('%H:%M:%S %A %d %B %Y') }} "
data:
ttl: 0
priority: high
####################################################### Radiator Pracovna
######### VYP Radiatora -CAS
- id: Pracovna - Vypnutie Kurenia po 17:00
alias: Pracovna - Vypnutie Kurenia po 17:00
trigger:
- at: "17:00:00"
platform: time
action:
- service: mqtt.publish
data:
topic: zigbee2mqtt/0x60a423fffea3a842/set
payload: '{"current_heating_setpoint":"5.0"}'
############################### Nizka teplota v izbe
- id: Spalna - Teplota pod 20 stupnov notif
alias: Spalna - Teplota pod 20 stupnov notif
trigger:
- entity_id: sensor.ble_temperature_4c65a8dfc04a
platform: numeric_state
below: '20'
condition:
- condition: state
entity_id: binary_sensor.0x00158d00054d661a_contact
state: 'on'
action:
- service: notify.mobile_app_samsung_s21
data:
message: "Chod zavriet okno do spalne {{ now().strftime('%H:%M:%S %A %d %B %Y') }} Aktualna teplota je {{state_attr('sensor.ble_temperature_4c65a8dfc04a', 'mean')}} °C. "
data:
ttl: 0
priority: high
- service: notify.mobile_app_samsung_s20
data:
message: "Diana chod zavriet okno do spalne {{ now().strftime('%H:%M:%S %A %d %B %Y') }} Aktualna teplota je {{state_attr('sensor.ble_temperature_4c65a8dfc04a', 'mean')}} °C. "
- id: Pracovna - Teplota pod 20 stupnov
alias: Pracovna - Teplota pod 20 stupnov
trigger:
- entity_id: sensor.ble_temperature_4c65a8dfacaf
platform: numeric_state
below: '20'
condition:
- condition: state
entity_id: binary_sensor.0x00158d00069acede_contact
state: 'on'
action:
- service: notify.mobile_app_samsung_s21
data:
message: "Chod zavriet okno do pracovne {{ now().strftime('%H:%M:%S %A %d %B %Y') }} Aktualna teplota je {{state_attr('sensor.ble_temperature_4c65a8dfacaf', 'mean')}} °C. "
data:
ttl: 0
priority: high
- service: notify.mobile_app_samsung_s20
data:
message: "Diana chod zavriet okno do pracovne {{ now().strftime('%H:%M:%S %A %d %B %Y') }} Aktualna teplota je {{state_attr('sensor.ble_temperature_4c65a8dfacaf', 'mean')}} °C. "
############################### Cistenie databazy
- id: Purge Database
alias: Purge Database
trigger:
- at: "21:00:00"
platform: time
action:
- service: recorder.purge
data:
keep_days: 2
repack: true
############################### Kanvica zovrela voda
- id: Kanvica zovrela voda
alias: Kanvica zovrela voda
trigger:
- entity_id: sensor.ble_temperature_ac9a22f296d0
platform: numeric_state
above: '90'
condition:
- condition: state
entity_id: binary_sensor.ble_switch_ac9a22f296d0
state: 'on'
action:
- service: yeelight.set_color_scene
data:
entity_id: light.kuchyna_pasik
rgb_color: [255,0,0]
brightness: '100'
- service: light.turn_on
data:
entity_id: light.wled
effect: "Android"
brightness: 100
rgb_color: [255,0,0]
- service: tts.google_translate_say
entity_id: media_player.living_room_speaker
data_template:
message: "Voda v rýchlovarnej kanvici zovrela. Choď zaliať čaj."
cache: false
- delay: 00:00:10
- service: light.turn_off
entity_id: light.wled
- delay: 00:00:45
- service: light.turn_off
entity_id: light.kuchyna_pasik
- id: Kanvica napoj je pripraveny
alias: Kanvica napoj je pripraveny
trigger:
- entity_id: sensor.xiaomi_kettle_state
platform: state
from: "Kanvica zohrieva vodu"
to: 'Kanvica je vypnuta'
- entity_id: sensor.xiaomi_kettle_state
platform: state
from: "Voda zovrela - udrziavam"
to: 'Kanvica je vypnuta'
action:
- delay: 00:07:00
- service: tts.google_translate_say
entity_id: media_player.living_room_speaker
data_template:
message: "čaj je pripravený."
cache: false
##################################################### Leaving Home
- id: Leaving home
alias: Leaving home
trigger:
- platform: state
entity_id: group.telefony
from: 'home'
to: 'not_home'