-
Notifications
You must be signed in to change notification settings - Fork 0
/
automations.yaml
1446 lines (1443 loc) · 37.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
- id: '1636214178243'
alias: 'Washer finished cycle '
description: Notify on phones that washer has finished a cycle.
trigger:
- type: turned_on
platform: device
device_id: 2f49ef255d2d31d08989070b0c4ef410
entity_id: binary_sensor.washer_wash_completed
domain: binary_sensor
action:
- service: notify.mobile_app_thomas_phone
data:
message: "\U0001F300 De was is klaar! "
- service: notify.mobile_app_frederieke_iphone
data:
message: "\U0001F300 De was is klaar! "
mode: single
- id: '1653461112548'
alias: Deurbel Notificatie Thomas
use_blueprint:
path: AndreiRadchenko/doorbell-cam-actionable-nitification.yaml
input:
notification_title: Iemand aan de deur!
doorbell_button: switch.doorbell_downstairs_bel
doorbell_cam: camera.birdseye
notify_dev: notify.mobile_app_thomas_phone
uri_: /lovelace/security
- id: '1653554412347'
alias: Deurbel Notificatie Fre
use_blueprint:
path: AndreiRadchenko/doorbell-cam-actionable-nitification.yaml
input:
notification_title: Iemand aan de deur!
doorbell_button: switch.doorbell_downstairs_bel
doorbell_cam: camera.birdseye
notify_dev: notify.mobile_app_frederieke_iphone
uri_: /lovelace/security
- id: '1657483816969'
alias: Verlichting uit sleep mode
description: Haal de verlichting uit sleep mode als sleep mode uit gaat
trigger:
- platform: state
entity_id:
- input_boolean.sleep_mode
from: 'on'
to: 'off'
condition: []
action:
- service: switch.turn_off
data: {}
target:
entity_id:
- switch.adaptive_lighting_sleep_mode_bijkeuken_plafond
- switch.adaptive_lighting_sleep_mode_eetkamer_hoek_links
- switch.adaptive_lighting_sleep_mode_badkamer_plafond
- switch.adaptive_lighting_sleep_mode_eetkamer_plafond
- switch.adaptive_lighting_sleep_mode_keuken_spots
- switch.adaptive_lighting_sleep_mode_overloop_kleding
- switch.adaptive_lighting_sleep_mode_overloop_plafond
- switch.adaptive_lighting_sleep_mode_woonkamer_plafond
mode: single
- id: '1668711755849'
alias: Tag 2833316 is gescand
description: ''
trigger:
- platform: tag
tag_id: '2833316'
- platform: tag
tag_id: '2868498'
- platform: tag
tag_id: '3003698'
- platform: tag
tag_id: '3003705'
condition: []
action: []
mode: single
- id: '1669496934507'
alias: Alarm Panel Sounds
description: ''
trigger:
- platform: state
entity_id:
- alarm_control_panel.alarm
to: pending
- platform: state
entity_id:
- alarm_control_panel.alarm
to: arming
condition: []
action:
- repeat:
while:
- condition: state
entity_id: alarm_control_panel.alarm
state: arming
sequence:
- service: media_player.play_media
target:
entity_id: media_player.tablet3
data:
media_content_id: media-source://media_source/local/Ring - Sonar.oga
media_content_type: audio/ogg
metadata:
title: Ring - Sonar.oga
thumbnail:
media_class: music
children_media_class:
navigateIds:
- {}
- media_content_type: app
media_content_id: media-source://media_source
mode: single
- id: '1669762061493'
alias: Tablets reload na home assistant start
description: ''
trigger:
- platform: homeassistant
event: start
- platform: event
event_type: lovelace_updated
condition: []
action:
- service: button.press
data: {}
target:
entity_id:
- button.tablet_1_restart_browser
- button.tablet_2_restart_browser
- button.tablet_3_restart_browser_2
enabled: false
- delay:
hours: 0
minutes: 0
seconds: 5
milliseconds: 0
- service: button.press
data: {}
target:
entity_id:
- button.tablet_1_load_start_url
- button.tablet_2_load_start_url
- button.tablet_3_load_start_url_2
mode: restart
- id: '1670252084636'
alias: Verlichting in sleep mode
description: Als Sleep mode aan gaat, zet dan alle lampen op sleep mode (via adaptive
lighting op dit moment)
trigger:
- platform: state
entity_id:
- input_boolean.sleep_mode
from: 'off'
to: 'on'
condition: []
action:
- service: switch.turn_on
data: {}
target:
entity_id:
- switch.adaptive_lighting_sleep_mode_bijkeuken_plafond
- switch.adaptive_lighting_sleep_mode_eetkamer_hoek_links
- switch.adaptive_lighting_sleep_mode_badkamer_plafond
- switch.adaptive_lighting_sleep_mode_overloop_kleding
- switch.adaptive_lighting_sleep_mode_eetkamer_plafond
- switch.adaptive_lighting_sleep_mode_keuken_spots
- switch.adaptive_lighting_sleep_mode_overloop_plafond
- switch.adaptive_lighting_sleep_mode_woonkamer_plafond
mode: single
- id: '1673860979697'
alias: 'Toilet media uitschakelen als pauze '
description: ''
trigger:
- platform: state
entity_id:
- media_player.toilet
from: playing
to: paused
for:
hours: 0
minutes: 0
seconds: 5
condition:
- condition: state
state: 'on'
entity_id: automation.radio_in_toilet
action:
- service: media_player.turn_off
data: {}
target:
entity_id:
- media_player.toilet
mode: single
- id: '1677082011846'
alias: Notify Thomas als iets stuk gaat
description: ''
trigger:
- platform: state
entity_id:
- climate.opentherm_livingroom_central_heating
to: unavailable
for:
hours: 0
minutes: 1
seconds: 0
condition: []
action:
- service: notify.mobile_app_thomas_phone
data:
message: Something important broke
mode: single
- id: '1679570570181'
alias: 'Sleep mode aan als Fré iPhone Sleep mode '
description: ''
trigger:
- platform: state
entity_id:
- binary_sensor.frederieke_iphone_focus
from: 'off'
to: 'on'
for:
hours: 0
minutes: 0
seconds: 5
condition:
- condition: zone
entity_id: person.frederieke
zone: zone.home
action:
- service: input_boolean.turn_on
data: {}
target:
entity_id: input_boolean.sleep_mode
mode: single
- id: '1679570632756'
alias: 'Sleep mode uit als fré iphone sleep mode uit '
description: ''
trigger:
- platform: state
entity_id:
- binary_sensor.frederieke_iphone_focus
for:
hours: 0
minutes: 0
seconds: 5
from: 'on'
to: 'off'
condition:
- condition: zone
entity_id: person.frederieke
zone: zone.home
action:
- service: input_boolean.turn_off
data: {}
target:
entity_id: input_boolean.sleep_mode
mode: single
- id: '1679579856569'
alias: Wekker Thomas Events
description: ''
use_blueprint:
path: IATkachenko/full.yaml
input:
device: 32bc03e232f39f108ed9a8478be375d0
person: person.thomas
alarm_alert_start:
- service: vacuum.start
metadata: {}
data: {}
target:
entity_id: vacuum.winston
- id: '1680993027286'
alias: Deurbel notificatie Eetkamer TV
description: ''
trigger:
- platform: state
entity_id:
- switch.doorbell_downstairs_bel
to: 'on'
condition: []
action:
- service: notify.eetkamer
data:
message: Iemand aan de deur!
title: Deurbel
data:
fontsize: large
position: top-right
duration: 10
transparency: 25%
interrupt: 0
color: teal
image:
url: https://linux.garden{{ states.camera.front_door_snapshot.attributes.entity_picture
}}
enabled: false
mode: single
- id: '1681162310695'
alias: 'Toilet start playing '
description: ''
trigger:
- platform: state
entity_id:
- light.toilet
to: 'on'
from: 'off'
condition: []
action:
- service: media_player.volume_set
data:
volume_level: 0.32
target:
entity_id: media_player.toilet
enabled: false
- service: media_player.turn_on
data: {}
enabled: false
target:
entity_id: media_player.toilet
- service: media_player.media_play
metadata: {}
data: {}
target:
entity_id: media_player.toilet
enabled: true
- service: mass.play_media
data: {}
enabled: false
mode: single
- id: '1681162461094'
alias: Radio Toilet uit
description: ''
trigger:
- platform: state
entity_id:
- light.toilet
from: 'on'
to: 'off'
condition: []
action:
- service: media_player.turn_off
data: {}
target:
entity_id: media_player.toilet
mode: single
- id: '1681766389024'
alias: 'Lavalamp auto uit '
description: 'Als langer aan dan 6 uur de afgelopen 8 '
trigger:
- platform: numeric_state
entity_id: sensor.lavalamp_on_past_8_hours
for:
hours: 0
minutes: 1
seconds: 0
above: 6
- platform: state
entity_id:
- switch.powerstrip_diningroom_stopcontact_4
to: 'on'
condition:
- condition: numeric_state
entity_id: sensor.lavalamp_on_past_8_hours
above: 6
action:
- service: light.turn_off
data: {}
target:
entity_id:
- light.eetkamer_hoek_links
mode: single
- id: '1681809742635'
alias: 'Leeg Winston als niemand thuis is '
description: ''
trigger:
- platform: zone
entity_id: person.frederieke
zone: zone.home
event: leave
- platform: zone
entity_id: person.thomas
zone: zone.home
event: leave
condition:
- condition: not
conditions:
- condition: zone
entity_id: person.frederieke
zone: zone.home
- condition: zone
entity_id: person.thomas
zone: zone.home
action:
- service: vacuum.send_command
data:
command: app_start_collect_dust
target:
entity_id: vacuum.winston
mode: single
- id: '1683897272135'
alias: Intercom Keuken
description: Open fullscreen popup with intercom card when called
trigger:
- platform: state
entity_id:
- sensor.104_state
to: Ringing
condition: []
action:
- service: browser_mod.popup
data:
browser_id:
- tablet1
dismissable: true
title: Intercom
size: fullscreen
content:
type: custom:sipjs-card
server: sip.brasser.family
port: '443'
button_size: '48'
state_color: true
auto_answer: false
hide_me: true
custom_title: ''
video: true
custom: []
dtmfs: []
iceTimeout: 5
prefix: ''
ringtone: /local/cowpowder.mp3
ringbacktone: /local/spacy_ringback.mp3
buttons: []
backup_name: Keuken
backup_extension: '101'
backup_secret: frederiekeislekker
extensions:
- person: person.keuken
name: Keuken
extension: '104'
secret: frederiekeislekker
icon: hue:room-kitchen
entity: binary_sensor.area_keuken
camera: camera.tablet1
- person: person.frederieke
name: Frederieke
extension: '100'
secret: frederiekeislekker
icon: mdi:face-woman
entity: binary_sensor.frederieke_phone
- person: person.thomas
name: Thomas
extension: '101'
secret: frederiekeislekker
icon: mdi:face-man
entity: binary_sensor.thomas_phone
- person: person.woonkamer
name: Woonkamer
extension: '102'
secret: frederiekeislekker
icon: hue:room-living
entity: binary_sensor.area_woonkamer
camera: camera.tablet3
- person: person.eetkamer
name: Eetkamer
extension: '103'
secret: frederiekeislekker
icon: hue:room-dining
entity: binary_sensor.area_eetkamer
camera: camera.tablet2
mode: single
- id: '1688591327748'
alias: AI 9 o'clock day report
description: ''
use_blueprint:
path: homeassistant/notify_agent_agenda.yaml
input:
conversation_agent: homeassistant
calendar_entity: calendar.ical_familywall
weather_entity: weather.buienradar
zone_entity: zone.home
notify_service: notify.notify
notify_time: 09:00:00
prompt: "Please generate text for a notification that will be sent to the users\nsmartphone
with helpful information.\n\n- Your messages help the user prepare for their
day, for example:\n - Making note of unusual weather for the location and
time of year (but not mundane details like \"0% chance of precipitation\")\n
\ - How much time remaining until their first meeting\n - Anything that may
be of interest."
- id: '1692531095698'
alias: Woonkamer Tablet 2 Screen on when area active
description: ''
trigger:
- platform: state
entity_id:
- binary_sensor.area_woonkamer
from: 'off'
to: 'on'
condition: []
action:
- service: switch.turn_on
data: {}
target:
entity_id:
- switch.tablet_2_screen
- switch.woonkamer_mic
- service: switch.turn_off
data: {}
target:
entity_id: switch.tablet_2_screensaver
enabled: false
mode: single
- id: '1692531226712'
alias: Woonkamer Tablet 2 Screen off when area clear
description: ''
trigger:
- platform: state
entity_id:
- binary_sensor.area_woonkamer
from: 'on'
to: 'off'
condition: []
action:
- service: switch.turn_off
data: {}
target:
entity_id:
- switch.tablet_2_screen
- switch.woonkamer_mic
mode: single
- id: '1692531370728'
alias: Woonkamer Tablet 2 Screensaver off on motion
description: ''
trigger:
- platform: state
entity_id:
- binary_sensor.tablet2_person_occupancy
from: 'off'
to: 'on'
condition: []
action:
- service: browser_mod.navigate
metadata: {}
data:
path: woonkamer
target:
device_id: bc4811bf683ce14894ea17d6f7a58885
mode: single
- id: '1692531439719'
alias: Woonkamer Tablet 2 Screensaver on when no motion
description: ''
trigger:
- platform: state
entity_id:
- binary_sensor.tablet2_person_occupancy
from: 'on'
to: 'off'
condition: []
action:
- service: browser_mod.navigate
metadata: {}
data:
path: screensaver
target:
device_id: bc4811bf683ce14894ea17d6f7a58885
mode: single
- id: '1693816251866'
alias: Eetkamer Tablet 1 Screensaver Uit
description: ''
trigger:
- platform: state
entity_id:
- binary_sensor.tablet1_person_occupancy
from: 'off'
to: 'on'
condition: []
action:
- type: turn_off
device_id: 0bfc31147ded6f4ff82de798fd2a4f2a
entity_id: 76d3094050a76542cd8342f5d173ad0a
domain: switch
mode: single
- id: '1704309594854'
alias: TRV Keuken Temperatuur
description: ''
use_blueprint:
path: pavax/z2m_aqara_trv_external_temperature.yaml
input:
external_temp_sensor: sensor.area_temperature_degc_keuken
aqara_trv_device: 021568c690934628b135ba50c37d75a4
- id: '1704492886183'
alias: Keuken Tablet 3 scherm uit
description: ''
trigger:
- platform: state
entity_id:
- binary_sensor.area_keuken
from: 'on'
to: 'off'
condition: []
action:
- service: switch.turn_off
data: {}
target:
entity_id:
- switch.tablet_3_screen_2
mode: single
- id: '1704492976228'
alias: Keuken Tablet 3 Scherm aan
description: ''
trigger:
- platform: state
entity_id:
- binary_sensor.area_keuken
from: 'off'
to: 'on'
condition: []
action:
- service: switch.turn_on
data: {}
target:
entity_id:
- switch.tablet_3_screen_2
mode: single
- id: '1704493042444'
alias: Keuken Tablet 3 Screensaver weg
description: ''
trigger:
- platform: state
entity_id:
- binary_sensor.tablet3_person_occupancy
from: 'off'
to: 'on'
condition: []
action:
- service: browser_mod.navigate
metadata: {}
data:
path: keuken
target:
device_id: a3fef3295e374b9fba27bb62b9e484c4
- service: switch.turn_on
metadata: {}
data: {}
target:
entity_id: switch.keuken_mic
mode: single
- id: '1704493939837'
alias: Keuken Tablet 3 Screensaver aan
description: ''
trigger:
- platform: state
entity_id:
- binary_sensor.tablet3_person_occupancy
from: 'on'
to: 'off'
condition: []
action:
- service: browser_mod.navigate
metadata: {}
data:
path: screensaver
target:
device_id: a3fef3295e374b9fba27bb62b9e484c4
- service: switch.turn_off
target:
entity_id: switch.keuken_mic
data: {}
mode: single
- id: '1705059335266'
alias: Bosch TRV II external temperature
description: ''
use_blueprint:
path: local/z2m_bosch_trv_external_temperature.yaml
input:
external_temp_sensor: sensor.area_temperature_degc_badkamer
aqara_trv_device: e08286ed05715fb9e2c177f8a48905b7
- id: '1706464369402'
alias: 'Eetkamer Tablet 1 Screen off when area clear '
description: ''
trigger:
- platform: state
entity_id:
- binary_sensor.area_eetkamer
from: 'on'
to: 'off'
condition: []
action:
- service: light.turn_off
data: {}
target:
entity_id:
- light.tablet1_screen
mode: single
- id: '1706464507417'
alias: 'Eetkamer Tablet 1 Screen on when area active '
description: ''
trigger:
- platform: state
entity_id:
- binary_sensor.area_eetkamer
from: 'off'
to: 'on'
condition: []
action:
- service: light.turn_on
data: {}
target:
entity_id:
- light.tablet1_screen
mode: single
- id: '1706473828197'
alias: Tablet 1 - Load Room View
description: ''
trigger:
- platform: state
entity_id:
- binary_sensor.tablet1_person_occupancy
from: 'off'
to: 'on'
- type: turned_on
platform: device
device_id: fca30a1dfbb3841b04ca20717e3a25e8
entity_id: 6cd5929c4cd5a6d55303b0936ecc1e42
domain: binary_sensor
- platform: state
entity_id:
- sensor.3ec720803e154901bd8b17cb064367c9_100_40004_area
condition: []
action:
- service: browser_mod.navigate
metadata: {}
data_template:
path: '{% if has_value(''sensor.3ec720803e154901bd8b17cb064367c9_100_40004_area'')
%}{{ state_attr(''sensor.3ec720803e154901bd8b17cb064367c9_100_40004_area'',''area_id'')
}}{% else %}eetkamer{% endif %}'
target:
device_id: fca30a1dfbb3841b04ca20717e3a25e8
- service: switch.turn_on
metadata: {}
data: {}
target:
entity_id: switch.eetkamer_mic
mode: single
- id: '1706473905310'
alias: 'Eetkamer Tablet 1 Screensaver on when no motion '
description: ''
trigger:
- platform: state
entity_id:
- binary_sensor.tablet1_person_occupancy
from: 'on'
to: 'off'
condition: []
action:
- service: browser_mod.navigate
metadata: {}
data:
path: screensaver
browser_id: tablet1
- service: switch.turn_off
metadata: {}
data: {}
target:
entity_id: switch.eetkamer_mic
mode: single
- id: '1706644618953'
alias: Reload 2410
description: ''
trigger:
- platform: state
entity_id:
- binary_sensor.hlk_ld2410_80ad_beweging
to: unavailable
for:
hours: 0
minutes: 0
seconds: 5
condition: []
action:
- service: homeassistant.reload_config_entry
metadata: {}
data: {}
target:
device_id: 61c9f67ae88f0303176ff63ba4d91fc0
mode: single
- id: '1706714763735'
alias: Hue Tap Dimmer Switch
description: ''
use_blueprint:
path: vandalon/Z2M - Philips Hue Tap dial switch.yaml
input:
controller: tap dial switch eetkamer
- id: '1706716759116'
alias: Philips Hue Dial Switch (Zigbee2MQTT)
description: ''
trigger:
- platform: mqtt
topic: zigbee2mqtt/Philips Hue Tap Dial Switch/action
condition:
- condition: template
value_template: '{{ trigger.payload is match(''^(dial_rotate_|button_[1-4]_(press|hold))'')
and trigger.payload != '''' and trigger.payload is not none }}'
action:
- choose:
- conditions:
- alias: Update Last Pressed
condition: template
value_template: '{{ trigger.payload is match(''^button_[1-4]_press$'') }}'
sequence:
- alias: Prevent different buttons to be registered as double press
if:
- condition: template
value_template: '{{ trigger.payload | regex_replace(find=''[^1-4]'', replace='''')
!= states(''input_text.philips_hue_dial_switch_last_pressed'') }}'
then:
- service: counter.reset
data: {}
target:
entity_id: counter.philips_hue_dial_switch_button_counter
enabled: true
enabled: true
- service: input_text.set_value
data:
value: '{{ trigger.payload | regex_replace(find=''[^1-4]'', replace='''')
}}'
target:
entity_id: input_text.philips_hue_dial_switch_last_pressed
alias: Update the input text helper with the last pressed button number
- service: counter.increment
data: {}
target:
entity_id: counter.philips_hue_dial_switch_button_counter
alias: Increase the counter helper with 1
- delay:
hours: 0
minutes: 0
seconds: 1
milliseconds: 0
- service: counter.reset
data: {}
target:
entity_id: counter.philips_hue_dial_switch_button_counter
alias: Reset the counter helper
enabled: true
- conditions:
- alias: Double xxx2 event
condition: template
value_template: '{{ trigger.payload is match(''button_[1-4]_press_release'')
}}'
- condition: numeric_state
entity_id: counter.philips_hue_dial_switch_button_counter
above: 1
sequence:
- choose:
- conditions:
- alias: Double press button 1
condition: template
value_template: '{{ trigger.payload == ''button_1_press_release'' }}'
sequence:
- service: light.turn_off
metadata: {}
data: {}
target:
entity_id: light.woonkamer_plafond
- conditions:
- alias: Double press button 2
condition: template
value_template: '{{ trigger.payload == ''button_2_press_release'' }}'
sequence:
- service: media_player.turn_off
metadata: {}
data: {}
target:
entity_id: media_player.global
- conditions:
- alias: Double press button 3
condition: template
value_template: '{{ trigger.payload == ''button_3_press_release'' }}'
sequence:
- service: light.turn_off
metadata: {}
data: {}
target:
entity_id: light.eetkamer_hoek_links
- conditions:
- alias: Double press button 4
condition: template
value_template: '{{ trigger.payload == ''button_4_press_release'' }}'
sequence:
- service: light.turn_off
metadata: {}
data:
transition: 1
target:
entity_id: light.dimmer2_diningroom_ceiling_dimmer2_diningroom_ceiling
default:
- alias: Single xxx2 event
if:
- condition: template
value_template: '{{ trigger.payload is match(''button_[1-4]_press_release'')
}}'
then:
- delay:
hours: 0
minutes: 0
seconds: 0
milliseconds: 250
- if:
- condition: numeric_state
entity_id: counter.philips_hue_dial_switch_button_counter
above: 1
then:
- stop: Double tap detected
- service: counter.reset
data: {}
target:
entity_id: counter.philips_hue_dial_switch_button_counter
enabled: true
- choose:
- conditions:
- condition: state
entity_id: input_text.philips_hue_dial_switch_last_pressed
state: '1'
- condition: template
value_template: '{{ trigger.payload is match(''^dial_rotate_'') }}'
sequence:
- choose:
- conditions:
- condition: template
value_template: '{{ trigger.payload is match(''^dial_rotate_left'')
}}'
sequence:
- service: light.turn_on
metadata: {}
data:
brightness_step: -{{ states.sensor.philips_hue_tap_dial_switch_action_time.state
}}
target:
entity_id: light.woonkamer_plafond
- conditions:
- condition: template
value_template: '{{ trigger.payload is match(''^dial_rotate_right'')
}}'
sequence:
- service: light.turn_on
metadata: {}
data:
brightness_step: '{{ states.sensor.philips_hue_tap_dial_switch_action_time.state
}}'
entity_id: light.woonkamer_plafond
- conditions:
- condition: state
entity_id: input_text.philips_hue_dial_switch_last_pressed
state: '2'
- condition: template
value_template: '{{ trigger.payload is match(''^dial_rotate_'') }}'
sequence:
- choose:
- conditions:
- condition: template
value_template: '{{ trigger.payload is match(''^dial_rotate_left'')
}}'
sequence:
- service: media_player.volume_set
data:
volume_level: '{{ state_attr(''media_player.global'',''volume_level'')
- (states.sensor.philips_hue_tap_dial_switch_action_time.state |
float / 1000 ) | round(2) }}'
target:
entity_id: media_player.global
- conditions:
- condition: template
value_template: '{{ trigger.payload is match(''^dial_rotate_right'')
}}'
sequence:
- service: media_player.volume_set
data:
volume_level: '{{ state_attr(''media_player.global'',''volume_level'')
+ (states.sensor.philips_hue_tap_dial_switch_action_time.state |
float / 1000 ) | round(2) }}'
target:
entity_id: media_player.global
- conditions:
- condition: state
entity_id: input_text.philips_hue_dial_switch_last_pressed
state: '3'
- condition: template
value_template: '{{ trigger.payload is match(''^dial_rotate_'') }}'
sequence:
- choose:
- conditions:
- condition: template
value_template: '{{ trigger.payload is match(''^dial_rotate_left'')
}}'
sequence: []
- conditions:
- condition: template
value_template: '{{ trigger.payload is match(''^dial_rotate_right'')
}}'
sequence: []