-
Notifications
You must be signed in to change notification settings - Fork 36
/
automations.yaml
1821 lines (1809 loc) · 50.2 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: '1727716571707'
alias: App - Lock door
description: ''
trigger:
- event_type: ios.action_fired
platform: event
event_data:
actionID: 23157A7D-6931-485B-A4E3-23E3B0F3226C
condition: []
action:
- action: lock.lock
metadata: {}
data: {}
target:
entity_id: lock.voordeur
mode: single
- id: '1727716714681'
alias: App - Open door
description: ''
trigger:
- event_data:
actionID: 28C02FBA-55CB-4421-BD32-E8BBB2056210
event_type: ios.action_fired
platform: event
condition: []
action:
- action: lock.unlock
target:
entity_id: lock.voordeur
data: {}
mode: single
- id: '1732692880064'
alias: Telegram HVC Notification
description: Send a notification when there is a garbage collection
triggers:
- at: '19:00:00'
trigger: time
conditions:
- condition: or
conditions:
- condition: state
entity_id: sensor.hvc_restafval
attribute: day
state: Morgen
- condition: state
entity_id: sensor.hvc_gft
attribute: day
state: Morgen
- condition: state
entity_id: sensor.hvc_plastic
attribute: day
state: Morgen
- condition: state
entity_id: sensor.hvc_papier
attribute: day
state: Morgen
actions:
- choose:
- conditions:
- condition: state
entity_id: sensor.hvc_restafval
attribute: day
state: Morgen
sequence:
- data:
title: HVC
message: 'Morgen komt Restafval, vergeet de bak niet aan de weg te zetten!
'
action: notify.mobile_app_nimbus_2000
- conditions:
- condition: state
entity_id: sensor.hvc_gft
attribute: day
state: Morgen
sequence:
- data:
title: HVC
message: 'Morgen komt GFT, vergeet de bak niet aan de weg te zetten!
'
action: notify.mobile_app_nimbus_2000
- conditions:
- condition: state
entity_id: sensor.hvc_plastic
attribute: day
state: Morgen
sequence:
- data:
title: HVC
message: 'Morgen komt Plastic, vergeet de bak niet aan de weg te zetten!
'
action: notify.mobile_app_nimbus_2000
- conditions:
- condition: state
entity_id: sensor.hvc_papier
attribute: day
state: Morgen
sequence:
- data:
title: HVC
message: 'Morgen komt Oud Papier, vergeet het niet aan de weg te zetten!
'
action: notify.mobile_app_nimbus_2000
mode: single
max_exceeded: silent
- id: '1733776537852'
alias: Brand!
description: Er is brand!
triggers:
- entity_id:
- binary_sensor.rookmelder_keuken_smoke
- binary_sensor.rookmelder_lily_smoke
- binary_sensor.rookmelder_olivia_smoke
- binary_sensor.rookmelder_harvey_smoke
- binary_sensor.rookmelder_slaapkamer_smoke
to: 'on'
trigger: state
- entity_id:
- siren.rookmelder_keuken_siren
- siren.rookmelder_lily_siren
- siren.rookmelder_olivia_siren
- siren.rookmelder_harvey_siren
- siren.rookmelder_slaapkamer_siren
to: 'off'
from: 'on'
trigger: state
conditions:
- condition: state
entity_id:
- binary_sensor.rookmelder_keuken_smoke
- binary_sensor.rookmelder_lily_smoke
- binary_sensor.rookmelder_olivia_smoke
- binary_sensor.rookmelder_harvey_smoke
- binary_sensor.rookmelder_slaapkamer_smoke
match: any
state: 'on'
actions:
- parallel:
- target:
entity_id:
- siren.rookmelder_keuken_siren
- siren.rookmelder_lily_siren
- siren.rookmelder_olivia_siren
- siren.rookmelder_harvey_siren
- siren.rookmelder_slaapkamer_siren
data:
duration: 10
action: siren.turn_on
- continue_on_error: true
data:
target: '{{telegram_target}}'
title: '*BRAND!*'
message: '{% for state in states.binary_sensor if is_state_attr(state.entity_id,
''device_class'', ''smoke'') and is_state(state.entity_id, ''on'') -%} {{-
state.attributes.friendly_name }}
{% endfor %}
'
action: telegram_bot.send_message
- continue_on_error: true
data:
title: BRAND!
message: '{% for state in states.binary_sensor if is_state_attr(state.entity_id,
''device_class'', ''smoke'') and is_state(state.entity_id, ''on'') -%} {{-
state.attributes.friendly_name }}
{% endfor %}
'
data:
push:
sound:
name: alarm.caf
critical: 1
volume: 1
action: notify.mobile_app_nimbus_2000
- continue_on_error: true
data:
title: BRAND!
message: '{% for state in states.binary_sensor if is_state_attr(state.entity_id,
''device_class'', ''smoke'') and is_state(state.entity_id, ''on'') -%} {{-
state.attributes.friendly_name }}
{% endfor %}
'
data:
ttl: 0
priority: high
channel: alarm_stream
action: notify.mobile_app_danielle
- continue_on_error: true
data:
title: BRAND!
message: '{% for state in states.binary_sensor if is_state_attr(state.entity_id,
''device_class'', ''smoke'') and is_state(state.entity_id, ''on'') -%} {{-
state.attributes.friendly_name }}
{% endfor %}
'
data:
notification_id: fire
action: notify.persistent_notification
mode: single
max_exceeded: silent
variables:
telegram_target: -788454569
- id: '1733776593318'
alias: Voordeur Auto Lock
description: Voordeur dagelijks automatisch op slot.
triggers:
- at: 00:00:00
trigger: time
conditions:
- condition: not
conditions:
- condition: state
entity_id: lock.voordeur
state: locked
actions:
- wait_template: '{{ is_state(''binary_sensor.voordeur'', ''off'') }}'
timeout:
minutes: 10
continue_on_timeout: true
- target:
entity_id: lock.voordeur
action: lock.lock
data: {}
mode: single
- id: '1733776611957'
alias: Voordeur Button
description: Open en sluit voordeur met IKEA knop
triggers:
- event_type: zha_event
event_data:
device_id: 05c5ad32692a45cf985ab7ace8893fa4
trigger: event
conditions: []
actions:
- choose:
- conditions:
- condition: template
value_template: '{{ trigger.event.data.command == "on" }}'
sequence:
- wait_template: '{{ is_state(''binary_sensor.voordeur_opening'', ''off'') }}'
timeout:
minutes: 1
continue_on_timeout: false
- target:
entity_id: lock.voordeur
action: lock.lock
data: {}
- conditions:
- condition: template
value_template: '{{ trigger.event.data.command == "move_with_on_off" }}'
sequence:
- wait_template: '{{ is_state(''binary_sensor.voordeur_opening'', ''off'') }}'
timeout:
minutes: 1
continue_on_timeout: false
- target:
entity_id: lock.voordeur
action: lock.lock
data: {}
- conditions:
- condition: template
value_template: '{{ trigger.event.data.command == "off" }}'
sequence:
- target:
entity_id: lock.voordeur
action: lock.unlock
data: {}
- conditions:
- condition: template
value_template: '{{ trigger.event.data.command == "move" }}'
sequence:
- target:
entity_id: lock.voordeur
action: lock.unlock
data: {}
default: []
mode: restart
max_exceeded: silent
- id: '1733776624719'
alias: Voordeur NFC Tag
description: Open voordeur zodra NFC tag wordt gescand.
triggers:
- tag_id: ef228741-9c01-4742-9460-22eac6841a4f
trigger: tag
conditions: []
actions:
- target:
entity_id: lock.voordeur
action: lock.unlock
data: {}
mode: single
- id: '1733776641109'
alias: Badkamer Afzuiging
description: Zet de afzuiging aan/uit op basis van het verschil in luchtvochtigheid
tussen de badkamer en de rest van de verdieping.
triggers:
- entity_id: sensor.badkamer_luchtvochtigheid_afwijking
above: 20
id: 'on'
trigger: numeric_state
- entity_id: sensor.badkamer_luchtvochtigheid_afwijking
below: 15
id: 'off'
trigger: numeric_state
- entity_id: fan.afzuiging
to: 'on'
for:
hours: 1
id: 'off'
trigger: state
conditions: []
actions:
- choose:
- conditions:
- condition: trigger
id: 'on'
sequence:
- target:
entity_id: fan.afzuiging
data:
percentage: 100
action: fan.turn_on
- delay:
seconds: 1
- target:
entity_id: fan.afzuiging
data:
percentage: 90
action: fan.turn_on
- delay:
seconds: 1
- target:
entity_id: fan.afzuiging
data:
percentage: 100
action: fan.turn_on
default:
- target:
entity_id: fan.afzuiging
action: fan.turn_off
data: {}
mode: single
max_exceeded: silent
- id: '1733776653408'
alias: Badkamer Schakelaar
description: Zet het licht in de badkamer aan/uit wanneer de schakelaar wordt geschakeld.
triggers:
- entity_id: binary_sensor.badkamer_plafond_switch
from:
- 'on'
- 'off'
to:
- 'off'
- 'on'
trigger: state
conditions: []
actions:
- data:
entity_id: light.badkamer_plafond
brightness: 254
hs_color:
- 38.222
- 52.941
action: light.toggle
mode: single
max_exceeded: silent
- id: '1733776664320'
alias: Badkamer Spiegelverwarming
description: Zet de spiegelverwarming aan/uit op basis van het verschil in luchtvochtigheid
tussen de badkamer en de rest van de verdieping.
triggers:
- entity_id: sensor.badkamer_luchtvochtigheid_afwijking
above: 20
id: 'on'
trigger: numeric_state
- entity_id: sensor.badkamer_luchtvochtigheid_afwijking
below: 15
id: 'off'
trigger: numeric_state
conditions: []
actions:
- choose:
- conditions:
- condition: trigger
id: 'on'
sequence:
- data_template:
entity_id: switch.badkamer_spiegelverwarming
action: switch.turn_on
default:
- data_template:
entity_id: switch.badkamer_spiegelverwarming
action: switch.turn_off
mode: single
max_exceeded: silent
- id: '1733776683437'
alias: Buitenverlichting Achterdeur
description: Zet het licht bij de achterdeur aan/uit op basis van de zon.
triggers:
- event: sunrise
id: 'off'
trigger: sun
- event: sunset
id: 'on'
trigger: sun
conditions: []
actions:
- choose:
- conditions:
- condition: trigger
id: 'off'
sequence:
- target:
entity_id: light.achterdeur
action: light.turn_off
data: {}
default:
- target:
entity_id: light.achterdeur
action: light.turn_on
data: {}
mode: single
- id: '1733776695860'
alias: Voordeur feller zetten als de deur open gaat
description: Zet het licht bij de voordeur feller als de deur open gaat.
triggers:
- entity_id: binary_sensor.voordeur_opening
from: 'off'
to: 'on'
trigger: state
conditions:
- condition: state
entity_id: light.voordeur
state: 'on'
actions:
- variables:
brightness_now: '{{ state_attr(''light.voordeur'', ''brightness'') }}'
- target:
entity_id: light.voordeur
data:
brightness_pct: 100
transition: 1
action: light.turn_on
- wait_for_trigger:
- entity_id: binary_sensor.voordeur_opening
from: 'on'
to: 'off'
trigger: state
timeout:
minutes: 10
continue_on_timeout: true
- target:
entity_id: light.voordeur
data:
brightness: '{{ brightness_now }}'
transition: 2
action: light.turn_on
mode: single
- id: '1733776711872'
alias: Buitenverlichting Voordeur
description: Zet het licht bij de voordeur aan/uit op basis van de zon.
triggers:
- event: sunrise
id: 'off'
trigger: sun
- event: sunset
id: 'on'
trigger: sun
conditions: []
actions:
- choose:
- conditions:
- condition: trigger
id: 'off'
sequence:
- target:
entity_id: light.voordeur
action: light.turn_off
data: {}
default:
- target:
entity_id: light.voordeur
action: light.turn_on
data: {}
mode: single
- id: '1733776728832'
alias: Bar Schakelaar
description: Zet het licht boven de bar aan/uit wanneer de schakelaar wordt geschakeld.
triggers:
- entity_id: binary_sensor.bar_switch
from:
- 'on'
- 'off'
to:
- 'off'
- 'on'
trigger: state
conditions: []
actions:
- data:
entity_id: light.bar
brightness: 254
hs_color:
- 38.222
- 52.941
action: light.toggle
mode: single
max_exceeded: silent
- id: '1733776741467'
alias: Tafel Schakelaar
description: Zet het licht boven de tafel aan/uit wanneer de schakelaar wordt geschakeld.
triggers:
- entity_id: binary_sensor.tafel_switch
from:
- 'on'
- 'off'
to:
- 'off'
- 'on'
trigger: state
conditions: []
actions:
- data:
entity_id: light.tafel
brightness: 254
hs_color:
- 38.222
- 52.941
action: light.toggle
mode: single
max_exceeded: silent
- id: '1733776754262'
alias: Keuken Schakelaar Kastjes
description: Zet het licht onder de keukenkastjes aan/uit wanneer de schakelaar
wordt geschakeld.
triggers:
- entity_id: binary_sensor.keukenkastjes_switch
from:
- 'on'
- 'off'
to:
- 'off'
- 'on'
trigger: state
conditions: []
actions:
- data:
entity_id: light.keuken_kastjes
brightness: 254
hs_color:
- 38.222
- 52.941
action: light.toggle
mode: single
max_exceeded: silent
- id: '1733776768342'
alias: Keuken Schakelaar Plafond
description: Zet het licht in de keuken aan/uit wanneer de schakelaar wordt geschakeld.
triggers:
- entity_id: binary_sensor.keukenplafond_switch
from:
- 'on'
- 'off'
to:
- 'off'
- 'on'
trigger: state
conditions: []
actions:
- data:
entity_id: light.keuken_plafond
brightness: 254
hs_color:
- 38.222
- 52.941
action: light.toggle
mode: single
max_exceeded: silent
- id: '1733776950068'
alias: Kleedkamer Schakelaar
description: Zet het licht in de kleedkamer aan/uit wanneer de schakelaar wordt
geschakeld.
triggers:
- entity_id: binary_sensor.kleedkamer_switch
from:
- 'on'
- 'off'
to:
- 'off'
- 'on'
trigger: state
conditions: []
actions:
- data:
entity_id: light.kleedkamer
brightness: 254
hs_color:
- 38.222
- 52.941
action: light.toggle
mode: single
max_exceeded: silent
- id: '1733776963050'
alias: Meterkast Deurbel
description: Laat de bel afgaan via de Google Speakers en stuur een melding naar
iedereen die thuis is.
triggers:
- entity_id: binary_sensor.voordeur_ding
from: 'off'
to: 'on'
trigger: state
conditions: []
actions:
- data:
entity_id: media_player.woonkamer_mini
media_content_id: http://192.168.0.1:8123/local/deurbel.mp3
media_content_type: music
action: media_player.play_media
- delay:
seconds: 10
mode: single
max_exceeded: silent
- id: '1733776979297'
alias: Niels Pillen Herinnering
description: Stuur een herinnering om 21:00 om pillen in te nemen
triggers:
- trigger: time
at: '21:00:00'
conditions: []
actions:
- alias: Turn on helper
action: input_boolean.turn_on
target:
entity_id:
- input_boolean.niels_pillen
data: {}
- alias: Repeat every 10 minutes
repeat:
while:
- alias: Helper is On
condition: state
entity_id: input_boolean.niels_pillen
state: 'on'
sequence:
- alias: Send actionable notification
action: notify.mobile_app_nimbus_2000
data:
title: Pillen
message: Het is tijd om je pilletje in te nemen
data:
url: /lovelace/pillen
push:
sound:
name: Alert_Health_Haptic.caf
critical: 1
volume: 1
actions:
- action: PILLS_DONE
title: Ingenomen
authenticationRequired: true
icon: sfsymbols:pill
- alias: Wait for confirmation
wait_for_trigger:
- alias: Confirmation given
trigger: event
event_type: mobile_app_notification_action
event_data:
action: PILLS_DONE
- alias: Helper turned Off
trigger: state
entity_id:
- input_boolean.niels_pillen
to: 'off'
timeout:
minutes: 10
- alias: Turn off helper on confirmation
if:
- alias: Confirmation is given
condition: template
value_template: '{{ wait.trigger.event.data.action == ''PILLS_DONE'' }}'
then:
- alias: Turn helper Off
action: input_boolean.turn_off
target:
entity_id: input_boolean.niels_pillen
data: {}
mode: restart
- id: '1733776990052'
alias: Overloop Schakelaar
description: Zet het licht op de overloop aan/uit wanneer de schakelaar wordt geschakeld.
triggers:
- entity_id: binary_sensor.overloop_switch
from:
- 'on'
- 'off'
to:
- 'off'
- 'on'
trigger: state
conditions: []
actions:
- data:
entity_id: light.overloop
brightness: 254
hs_color:
- 38.222
- 52.941
action: light.toggle
mode: single
max_exceeded: silent
- id: '1733777007479'
alias: Slaapkamer IKEA Remote
description: Zet alle verlichting uit met de druk van elke knop op de IKEA Remote.
triggers:
- event_type: zha_event
event_data:
device_id: 5279ce03243d54e6596565d4af4d3567
trigger: event
conditions: []
actions:
- choose:
- conditions:
- condition: template
value_template: '{{ trigger.event.data.command == "toggle" }}'
sequence:
- entity_id: automation.slaapkamer_schakelaar
action: automation.trigger
- conditions:
- condition: template
value_template: '{{ trigger.event.data.command == "move_to_level_with_on_off"
}}'
sequence:
- target:
entity_id: light.slaapkamer
data:
brightness: 254
hs_color:
- 38.222
- 52.941
action: light.turn_on
- conditions:
- condition: template
value_template: '{{ trigger.event.data.command == "step_with_on_off" }}'
sequence:
- choose:
- conditions:
- condition: template
value_template: "{{\n expand(state_attr('light.slaapkamer', 'entity_id'))\n
\ |selectattr('state', 'eq', 'on')\n |map(attribute='entity_id')\n
\ |list\n |count\n > 0\n}}"
sequence:
- target:
entity_id: "{{\n expand(state_attr('light.slaapkamer', 'entity_id'))\n
\ |selectattr('state', 'eq', 'on')\n |map(attribute='entity_id')\n
\ |list\n}}"
data:
brightness_step_pct: 10
action: light.turn_on
default:
- choose:
- conditions:
- condition: time
before: '10:00'
after: '21:00'
sequence:
- target:
entity_id: light.bed
data:
brightness_step_pct: 10
action: light.turn_on
default:
- target:
entity_id: light.slaapkamer
data:
brightness_step_pct: 10
action: light.turn_on
- conditions:
- condition: template
value_template: '{{ trigger.event.data.command == "move_with_on_off" }}'
sequence:
- repeat:
while: []
sequence:
- choose:
- conditions:
- condition: template
value_template: "{{\n expand(state_attr('light.slaapkamer', 'entity_id'))\n
\ |selectattr('state', 'eq', 'on')\n |map(attribute='entity_id')\n
\ |list\n |count\n > 0\n}}"
sequence:
- target:
entity_id: "{{\n expand(state_attr('light.slaapkamer', 'entity_id'))\n
\ |selectattr('state', 'eq', 'on')\n |map(attribute='entity_id')\n
\ |list\n}}"
data:
brightness_step_pct: 10
transition: 0.5
action: light.turn_on
default:
- choose:
- conditions:
- condition: time
before: '10:00'
after: '21:00'
sequence:
- target:
entity_id: light.bed
data:
brightness_step_pct: 10
transition: 0.5
action: light.turn_on
default:
- target:
entity_id: light.slaapkamer
data:
brightness_step_pct: 10
transition: 0.5
action: light.turn_on
- delay:
milliseconds: 500
- conditions:
- condition: template
value_template: '{{ trigger.event.data.command == "step" }}'
sequence:
- target:
entity_id: "{{\n expand(state_attr('light.slaapkamer', 'entity_id'))\n
\ |map(attribute='entity_id')\n |list\n}}"
data:
brightness_step_pct: -10
action: light.turn_on
- conditions:
- condition: template
value_template: '{{ trigger.event.data.command == "move" }}'
sequence:
- repeat:
while: []
sequence:
- choose:
- conditions:
- condition: template
value_template: "{{\n expand(state_attr('light.slaapkamer', 'entity_id'))\n
\ |selectattr('state', 'eq', 'on')\n |map(attribute='entity_id')\n
\ |list\n |count\n > 0\n}}"
sequence:
- target:
entity_id: "{{\n expand(state_attr('light.slaapkamer', 'entity_id'))\n
\ |selectattr('state', 'eq', 'on')\n |map(attribute='entity_id')\n
\ |list\n}}"
data:
brightness_step_pct: -10
transition: 0.5
action: light.turn_on
default:
- choose:
- conditions:
- condition: time
before: '10:00'
after: '21:00'
sequence:
- target:
entity_id: light.bed
data:
brightness_step_pct: -10
transition: 0.5
action: light.turn_on
default:
- target:
entity_id: light.slaapkamer
data:
brightness_step_pct: -10
transition: 0.5
action: light.turn_on
- delay:
milliseconds: 500
- conditions:
- condition: template
value_template: '{{ trigger.event.data.command == "press" }}'
- condition: template
value_template: '{{ trigger.event.data.args == [256,13,0] }}'
sequence:
- choose:
- conditions:
- condition: state
entity_id: media_player.slaapkamer_mini
state: playing
sequence:
- target:
entity_id: media_player.slaapkamer_mini
action: media_player.media_next_track
data: {}
default:
- target:
entity_id: light.bed
data:
brightness: 100
color_name: red
action: light.turn_on
- conditions:
- condition: template
value_template: '{{ trigger.event.data.command == "hold" }}'
- condition: template
value_template: '{{ trigger.event.data.args == [3328,0] }}'
sequence:
- target:
entity_id: media_player.slaapkamer_mini
action: media_player.turn_off
data: {}
- conditions:
- condition: template
value_template: '{{ trigger.event.data.command == "press" }}'
- condition: template
value_template: '{{ trigger.event.data.args == [257,13,0] }}'
sequence:
- choose:
- conditions:
- condition: state
entity_id: media_player.slaapkamer_mini
state: playing
sequence:
- target:
entity_id: media_player.slaapkamer_mini
action: media_player.media_previous_track
data: {}
default:
- target:
entity_id: light.bed
data:
brightness: 100
color_name: red
action: light.turn_on
- conditions:
- condition: template
value_template: '{{ trigger.event.data.command == "hold" }}'
- condition: template
value_template: '{{ trigger.event.data.args == [3329,0] }}'
sequence:
- target:
entity_id: media_player.slaapkamer_mini
action: media_player.turn_off
data: {}
default: []
mode: restart
max_exceeded: silent
- id: '1733777034423'
alias: Kantoor Schakelaar
description: Zet het licht op het kantoor aan/uit wanneer de schakelaar wordt geschakeld.
triggers:
- entity_id: binary_sensor.kantoor_switch
from:
- 'on'
- 'off'
to:
- 'off'
- 'on'
trigger: state
conditions: []
actions:
- data:
entity_id: light.kantoor
brightness: 254
hs_color:
- 38.222
- 52.941
action: light.toggle
mode: single
max_exceeded: silent
- id: '1733777054072'
alias: Slaapkamer Schakelaar
description: Zet het licht in de slaapkamer aan/uit wanneer de schakelaar wordt
geschakeld.
triggers:
- entity_id: binary_sensor.slaapkamer_switch
from:
- 'on'
- 'off'
to:
- 'off'
- 'on'
trigger: state
conditions: []
actions:
- choose:
- conditions:
- condition: state
entity_id: light.slaapkamer
state: 'off'
sequence:
- choose:
- conditions:
- condition: time