-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathautomations.yaml
959 lines (912 loc) · 24.8 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
- id: arrive_home
alias: "Arrive Home"
triggers:
- trigger: zone
entity_id: person.dale
zone: zone.home
event: enter
actions:
- action: notify.mobile_app_dales_iphone
data:
message: "Welcome home"
- id: internet_down
alias: "Internet down"
triggers:
- trigger: state
entity_id: binary_sensor.internet
to: "off"
actions:
- action: notify.mobile_app_dales_iphone
data:
message: "Internet is down"
- id: internet_up
alias: "Internet up"
triggers:
- trigger: state
entity_id: binary_sensor.internet
to: "on"
actions:
- action: notify.mobile_app_dales_iphone
data:
message: "Internet is up"
- id: entrance_lights_brighten
alias: "Entrance light brighten"
triggers:
- trigger: state
entity_id: binary_sensor.entrance_pir_occupancy
from: "off"
to: "on"
actions:
- action: scene.create
data:
scene_id: entrance_light_saved_scene
snapshot_entities:
- light.entrance_overhead
- action: light.turn_on
target:
entity_id: light.entrance_overhead
data:
transition: 1
brightness: 255
color_temp: "{{ state_attr('switch.adaptive_lighting_home', 'color_temp_mired') }}"
- id: entrance_lights_restore
alias: "Entrance light restore"
triggers:
- trigger: state
entity_id: binary_sensor.entrance_pir_occupancy
from: "on"
to: "off"
actions:
- action: scene.turn_on
data:
entity_id: scene.entrance_light_saved_scene
transition: 3
- id: laundry_start_reminder
alias: Laundry reminder
triggers:
- trigger: time
at: input_datetime.laundry_reminder
actions:
- action: notify.family
data:
message: "Don't forget your laundry booking"
- action: tts.google_cloud_say
entity_id:
- media_player.kitchen_display
- media_player.bedroom_speaker
- media_player.lounge_speaker
data_template:
message: "{{ states('sensor.greeting') }}. Don't forget about your laundry"
- id: laundry_start
alias: Laundry timer started
triggers:
- trigger: tag
tag_id: f0a4261e-287b-481d-a93f-1bb33b2de291
actions:
- action: notify.family
data:
title: "Laundry timer started"
message: "Reminder in {{ state_attr('timer.laundry', 'duration') }}"
- action: timer.start
target:
entity_id: timer.laundry
- id: laundry_done_reminder
alias: Laundry is done
triggers:
- trigger: event
event_type: timer.finished
event_data:
entity_id: timer.laundry
actions:
- action: notify.family
data:
message: "Laundry done"
- action: tts.google_cloud_say
entity_id:
- media_player.kitchen_display
- media_player.bedroom_speaker
- media_player.lounge_speaker
data_template:
message: "{{ states('sensor.greeting') }}. The laundry is done"
- id: rainfall_alert_morning
alias: Rainfall on the way to work
triggers:
- trigger: numeric_state
entity_id: sensor.precipitation_next_hour
above: 0
- trigger: time
at: "08:15:00"
conditions:
- condition: state
entity_id: binary_sensor.workday_sensor
state: "on"
- condition: zone
entity_id: person.dale
zone: zone.home
- condition: time
after: "08:15:00"
before: "10:00:00"
- condition: numeric_state
entity_id: sensor.precipitation_next_hour
above: 0
actions:
- action: notify.mobile_app_dales_iphone
data:
title: "{{ state_attr('sensor.precipitation_next_hour', 'title') }}"
message: "{{ states('sensor.precipitation_next_hour') }} mm in next hour"
- id: rainfall_alert_afternoon
alias: Rainfall on the way home
triggers:
- trigger: time
at: "17:00:00"
- trigger: time
at: "11:55:00"
- trigger: numeric_state
entity_id: sensor.precipitation_next_hour
above: 0
conditions:
- condition: zone
entity_id: person.dale
zone: zone.work
- or:
- condition: time
after: "11:55:00"
before: "12:10:00"
- condition: time
after: "17:00:00"
- condition: numeric_state
entity_id: sensor.precipitation_next_hour
above: 0
actions:
- action: notify.mobile_app_dales_iphone
data:
title: "{{ state_attr('sensor.precipitation_next_hour', 'title') }}"
message: "{{ states('sensor.precipitation_next_hour') }} mm in next hour"
- id: rainfall_alert_away
alias: Rain alert while outdoors
triggers:
- trigger: numeric_state
entity_id: sensor.precipitation_next_hour
above: 0
conditions:
- condition: state
entity_id: person.dale
state: "not_home"
- not:
- condition: state
entity_id: sensor.dales_iphone_connection_type
state: "Wi-Fi"
actions:
- action: notify.mobile_app_dales_iphone
data:
title: "{{ state_attr('sensor.precipitation_next_hour', 'title') }}"
message: "{{ states('sensor.precipitation_next_hour') }} mm in next hour"
- id: rainfall_alert_frontdoor
alias: Rain alert at front door
triggers:
- trigger: state
entity_id: binary_sensor.entrance_pir_occupancy
from: "off"
to: "on"
conditions:
- condition: numeric_state
entity_id: sensor.precipitation_next_hour
above: 0
actions:
- action: light.turn_on
data:
effect: okay
target:
entity_id: light.entrance_overhead
- id: lunch_reminer_on
alias: Turn on lunch reminder
triggers:
- trigger: tag
tag_id: 9c666023-7e07-491d-be90-c8be0d53b3b5
conditions:
- condition: time
after: "18:00:00"
actions:
- action: automation.turn_on
target:
entity_id: automation.lunch_reminder
- action: tts.google_cloud_say
entity_id: media_player.kitchen_display
data_template:
message: "Okay, I'll remind you about your lunch tomorrom morning."
- id: lunch_reminer_off
alias: Turn off lunch reminder
triggers:
- trigger: tag
tag_id: 9c666023-7e07-491d-be90-c8be0d53b3b5
conditions:
- condition: time
before: "10:00:00"
actions:
- action: automation.turn_off
target:
entity_id: automation.lunch_reminder
- id: lunch_reminder
alias: Lunch reminder
triggers:
- trigger: state
entity_id: binary_sensor.entrance_pir_occupancy
from: "off"
to: "on"
conditions:
- condition: time
before: "10:00:00"
actions:
- action: light.turn_on
data:
effect: okay
target:
entity_id: light.entrance_overhead
- action: notify.mobile_app_dales_iphone
data:
message: "Remember your lunch"
- action: automation.turn_off
target:
entity_id: automation.lunch_reminder
- id: dishwasher_leak
alias: Dishwasher leak
triggers:
- trigger: state
entity_id: binary_sensor.dishwasher_leak_water_leak
to: "on"
actions:
- action: notify.family
data:
title: "Dishwasher leak"
message: "Water detected under the dishwasher"
data:
push:
interruption-level: critical
- action: tts.google_cloud_say
entity_id:
- media_player.kitchen_display
- media_player.bedroom_speaker
- media_player.lounge_speaker
data_template:
message: >
"{{ states('sensor.greeting') }}. Water has been detected under the dishwasher.
Please check for leaks... The shutoff valve is on the kitchen sink tap"
- id: bathroom_leak
alias: Bathroom leak
triggers:
- trigger: state
entity_id: binary_sensor.bathroom_leak_water_leak
to: "on"
actions:
- action: notify.family
data:
title: "Bathroom leak"
message: "Water detected under the washing machine"
data:
push:
interruption-level: critical
- action: tts.google_cloud_say
entity_id:
- media_player.kitchen_display
- media_player.bedroom_speaker
- media_player.lounge_speaker
data_template:
message: >
"{{ states('sensor.greeting') }}. Water has been detected in the bathroom under the washing machine.
Please check for leaks... The shutoff valve is on the bathroom ceiling, next to the basin."
- id: start_robot_vacuum
alias: Start robot vacuum
triggers:
- trigger: state
entity_id: zone.home
to: "0"
- trigger: time
at: "11:00:00"
conditions:
- condition: state
entity_id: input_boolean.run_vacuum_today
state: "on"
- condition: state
entity_id: zone.home
state: "0"
- condition: time
after: "09:00:00"
- condition: time
before: "20:00:00"
actions:
- action: vacuum.start
target:
entity_id: vacuum.vader
- id: start_robot_vacuum_weekday
alias: Start robot vacuum limited
description: "Limited weekday cleanup: Entrance, kitchen, bedroom"
triggers:
- trigger: time
at: "17:00:00"
conditions:
- condition: state
entity_id: input_boolean.run_vacuum_today
state: "on"
- condition: state
entity_id: binary_sensor.workday_sensor
state: "on"
actions:
- action: xiaomi_miio.vacuum_clean_segment
data:
segments: [20, 16, 17]
target:
entity_id: vacuum.vader
- id: run_vacuum_max_once_per_day
alias: Run vacuum max once per day
triggers:
- trigger: state
entity_id: vacuum.vader
to: "cleaning"
actions:
- action: input_boolean.turn_off
target:
entity_id: input_boolean.run_vacuum_today
- id: reset_run_vacuum_today
alias: Reset run vacuum today
triggers:
- trigger: time
at: "03:00:00"
actions:
- action: input_boolean.turn_on
target:
entity_id: input_boolean.run_vacuum_today
- id: vacuum_finished_cleaning
alias: Vacuum finished cleaning
triggers:
- trigger: state
entity_id: vacuum.vader
from: "cleaning"
to: "returning"
conditions:
- condition: state
entity_id: binary_sensor.vacation
state: "off"
actions:
- action: counter.decrement
target:
entity_id: counter.empty_vacuum_bin
- condition: numeric_state
entity_id: counter.empty_vacuum_bin
below: 1
- action: xiaomi_miio.vacuum_goto
target:
entity_id: vacuum.vader
data:
x_coord: '28566'
y_coord: '27749'
- wait_for_trigger:
- trigger: state
entity_id: vacuum.vader
to: "idle"
- action: vacuum.locate
target:
entity_id: vacuum.vader
- id: vacuum_water_tank_in
alias: Vacuum water tank reattached
triggers:
- trigger: state
entity_id: binary_sensor.vader_mop_attached_2
from: "off"
to: "on"
actions:
- action: counter.reset
target:
entity_id: counter.empty_vacuum_bin
- id: storeroom_light
alias: Storeroom light
triggers:
- trigger: state
entity_id: binary_sensor.storeroom_pir_occupancy
to: "on"
conditions:
- condition: state
entity_id: binary_sensor.hall_pir_occupancy
state: "on"
actions:
- action: light.turn_on
data:
color_temp: 250
brightness: 255
transition: 1
target:
entity_id: light.storeroom_overhead
- wait_for_trigger:
- trigger: state
entity_id: binary_sensor.storeroom_pir_occupancy
to: "off"
for: "00:01:00"
- action: light.turn_off
data:
transition: 1
target:
entity_id: light.storeroom_overhead
- id: bedroom_floor_lighting_on
alias: Bedroom floor night lighting on
triggers:
- trigger: state
entity_id: binary_sensor.bedroom_pir_occupancy
to: "on"
conditions:
- condition: state
entity_id: light.bedside_lights
state: "off"
- condition: state
entity_id: binary_sensor.illuminance_bright
state: "off"
actions:
- choose:
- conditions:
- condition: time
after: input_datetime.dale_alarm_time
before: "12:00:00"
- condition: state
entity_id: binary_sensor.workday_sensor
state: "on"
sequence:
- action: light.turn_on
data:
color_temp: 370
brightness: 255
transition: 3
target:
entity_id: light.bedroom_floor
default:
- action: light.turn_on
data:
color_name: red
brightness: 50
target:
entity_id: light.bedroom_floor
- id: bedroom_floor_lighting_off
alias: Bedroom floor night lighting off
triggers:
- trigger: state
entity_id: binary_sensor.bedroom_pir_occupancy
to: "off"
- trigger: state
entity_id: binary_sensor.bedroom_cupboard_pir_occupancy
to: "off"
conditions:
- condition: state
entity_id: light.bedside_lights
state: "off"
- condition: state
entity_id: binary_sensor.bedroom_cupboard_pir_occupancy
state: "off"
- condition: state
entity_id: binary_sensor.bedroom_pir_occupancy
state: "off"
actions:
- action: light.turn_off
data:
transition: 3
target:
entity_id: light.bedroom_floor
- id: bedroom_bedside_light_switch
alias: Bedroom bedside light switch
triggers:
- trigger: state
entity_id: sensor.bedside_dale_switch_action
to: "single_left"
id: single_left
- trigger: state
entity_id: sensor.bedside_dale_switch_action
to: "double_left"
id: double_left
- trigger: state
entity_id: sensor.bedside_dale_switch_action
to: "single_right"
id: single_right
- trigger: state
entity_id: sensor.bedside_dale_switch_action
to: "double_right"
id: double_right
- trigger: state
entity_id: sensor.bedside_dale_switch_action
to: "single_both"
id: single_both
actions:
- choose:
- conditions:
- condition: trigger
id: single_left
sequence:
- action: light.toggle
target:
entity_id: light.bedroom_overhead
- conditions:
- condition: trigger
id: single_right
sequence:
- action: light.toggle
target:
entity_id:
- light.bedside_lights
- light.bedroom_floor
- conditions:
- condition: trigger
id: double_left
sequence:
- action: light.toggle
target:
entity_id: light.bedside_dale
- conditions:
- condition: trigger
id: double_right
sequence:
- action: light.toggle
target:
entity_id: light.bedside_mark
- conditions:
- condition: trigger
id: single_both
sequence:
- action: scene.turn_on
target:
entity_id: scene.bedroom_winddown
- id: easy_wakeup
alias: Easy wakeup
triggers:
- trigger: template
value_template: "{{ (state_attr('input_datetime.dale_alarm_time', 'timestamp') - 10*60) | timestamp_custom('%H:%M', False) == states('sensor.time') }}"
conditions:
- condition: state
entity_id: binary_sensor.vacation
state: "off"
- condition: state
entity_id: binary_sensor.workday_sensor
state: "on"
- condition: state
entity_id: input_boolean.dale_alarm_enable
state: "on"
actions:
- action: script.easy_wakeup
- id: kitchen_nightlight_on
alias: Kitchen night lighting on
triggers:
- trigger: state
entity_id: binary_sensor.kitchen_pir_occupancy
to: "on"
conditions:
- condition: state
entity_id: binary_sensor.hall_pir_occupancy
state: "on"
- condition: state
entity_id: light.kitchen_overhead
state: "off"
- condition: state
entity_id: binary_sensor.illuminance_bright
state: "off"
- condition: numeric_state
entity_id: sensor.kitchen_illuminance_average
below: 10
actions:
- choose:
- conditions:
- condition: time
after: input_datetime.dale_alarm_time
before: "12:00:00"
sequence:
- action: light.turn_on
data:
transition: 3
target:
entity_id: light.kitchen_lights
default:
- action: light.turn_on
data:
brightness: 50
target:
entity_id: light.kitchen_overhead_1
- id: kitchen_nightlight_off
alias: Kitchen night lighting off
triggers:
- trigger: state
entity_id: binary_sensor.kitchen_pir_occupancy
to: "off"
conditions:
- condition: state
entity_id: light.kitchen_overhead_1
state: "on"
- condition: state
entity_id: light.kitchen_overhead_4
state: "off"
actions:
- action: light.turn_off
data:
transition: 3
target:
entity_id: light.kitchen_overhead_1
- id: diningroom_overhead_light_dim
alias: Diningroom overhead light dimming
triggers:
- trigger: state
entity_id: binary_sensor.diningroom_chair_occupancy
to: "on"
conditions:
- condition: numeric_state
entity_id: light.diningroom_overhead
attribute: brightness
above: 128
- condition: state
entity_id: binary_sensor.illuminance_bright
state: "off"
actions:
- action: light.turn_on
data:
brightness: 77
transition: 3
target:
entity_id: light.diningroom_overhead
- id: kitchen_freezer_too_warm
alias: Alert when freezer too warm
triggers:
- trigger: numeric_state
entity_id: sensor.freezer_temperature
above: -10
for:
minutes: 15
actions:
- action: notify.family
data:
title: Freezer temperature
message: "{{ states('sensor.freezer_temperature') |int }} °C is too warm"
data:
push:
interruption-level: critical
- action: tts.google_cloud_say
entity_id:
- media_player.kitchen_display
- media_player.bedroom_speaker
- media_player.lounge_speaker
data_template:
message: >
"{{ states('sensor.greeting') }}. The freezer is {{ states('sensor.freezer_temperature') | int }} degrees.
Please check if the door is properly closed."
- id: bedroom_thermostat_night
alias: Set bedroom sleep temperature
triggers:
- trigger: time
at: "19:00"
actions:
- action: climate.set_temperature
target:
entity_id: climate.bedroom_thermostat
data:
temperature: 18
- id: bedroom_thermostat_day
alias: Set bedroom day temperature
triggers:
- trigger: template
value_template: "{{ (state_attr('input_datetime.dale_alarm_time', 'timestamp') - 60*60) | timestamp_custom('%H:%M', False) == states('sensor.time') }}"
actions:
- action: climate.set_temperature
target:
entity_id: climate.bedroom_thermostat
data:
temperature: 21
- id: all_lights_off
alias: All lights off
triggers:
- trigger: numeric_state
entity_id: zone.home
below: 1 # Unfortunatley no '== 0' in HA
- trigger: state
entity_id: binary_sensor.illuminance_bright
from: "off"
to: "on"
actions:
- action: light.turn_off
target:
entity_id: all
- id: all_lights_on
alias: All lights on
triggers:
- trigger: numeric_state
entity_id: zone.home
above: 0
- trigger: state
entity_id: binary_sensor.illuminance_bright
from: "on"
to: "off"
conditions:
- condition: numeric_state
entity_id: zone.home
above: 0
- condition: state
entity_id: binary_sensor.illuminance_bright
state: "off"
actions:
- action: script.adaptive_lights_on
- id: bathroom_light_on
alias: Bathroom light on
triggers:
- trigger: state
entity_id: binary_sensor.bathroom_pir_occupancy
to: "on"
actions:
- choose:
- conditions:
- condition: time
after: "00:00:00"
before: input_datetime.dale_alarm_time
sequence:
- action: light.turn_on
target:
entity_id: light.bathroom_overhead
data:
brightness: 13
default:
- action: light.turn_on
target:
entity_id: light.bathroom_overhead
data:
brightness_pct: "{{ state_attr('switch.adaptive_lighting_home', 'brightness_pct') }}"
- id: bathroom_light_off
alias: Bathroom light off
triggers:
- trigger: state
entity_id: binary_sensor.bathroom_pir_occupancy
to: "off"
for:
minutes: 5
- trigger: state
entity_id: binary_sensor.bathroom_shower_occupancy
to: "off"
for:
minutes: 5
conditions:
- condition: state
entity_id: binary_sensor.bathroom_pir_occupancy
state: "off"
- condition: state
entity_id: binary_sensor.bathroom_shower_occupancy
state: "off"
actions:
- action: light.turn_off
target:
entity_id: light.bathroom_overhead
data:
transition: 3
- id: bathroom_towelrail_on
alias: Bathroom towelrail when showering
triggers:
- trigger: state
entity_id: binary_sensor.bathroom_shower_occupancy
to: "on"
actions:
- action: switch.turn_on
target:
entity_id: switch.bathroom_towelrail
- action: timer.start
target:
entity_id: timer.bathroom_towelrail
- id: bathroom_towelrail_timer_start # In case the towel rail is manually turned on
alias: Start auto-off bathroom towelrail timer
triggers:
- trigger: state
entity_id: switch.bathroom_towelrail
from: "off"
to: "on"
actions:
- action: timer.start
target:
entity_id: timer.bathroom_towelrail
- id: bathroom_towelrail_off
alias: Bathroom towelrail off when timer expires
triggers:
- trigger: event
event_type:
- timer.finished
- timer.cancelled
event_data:
entity_id: timer.bathroom_towelrail
actions:
- action: switch.turn_off
target:
entity_id: switch.bathroom_towelrail
- id: adaptive_lights_on_action
alias: iOS action to turn adaptive lighting on
triggers:
- trigger: event
event_type: ios.action_fired
event_data:
actionName: "Auto lights on"
actions:
- action: script.adaptive_lights_on
- id: relax_scene_on_action
alias: iOS action to activate relax scene script
triggers:
- trigger: event
event_type: ios.action_fired
event_data:
actionName: "Activate relax script"
actions:
- action: script.relax_scene_on
- id: hall_nightlight_on
alias: Hall night lighting on
triggers:
- trigger: state
entity_id: binary_sensor.hall_pir_occupancy
to: "on"
conditions:
- condition: state
entity_id: light.hall_lights
state: "off"
- condition: numeric_state
entity_id: sensor.hall_pir_illuminance_lux
below: 1
actions:
- action: light.turn_on
target:
entity_id: light.hall_cabinet
data:
color_name: red
brightness: 3
transition: 1
effect: Solid
- id: hall_nightlight_off
alias: Hall night lighting off
triggers:
- trigger: state
entity_id: binary_sensor.hall_pir_occupancy
to: "off"
conditions:
- condition: state
entity_id: light.hall_lights
state: "off"
actions:
- action: light.turn_off
target:
entity_id: light.hall_cabinet
data:
transition: 3
- id: nspanel_entrance_screen_timeout_on
alias: NSPanel entrance screen timeout on
triggers:
- trigger: state
entity_id: light.entrance_overhead
to: "off"
actions:
- action: mqtt.publish
data:
topic: nspanelpro/nspanel_entrance/config/update
payload: >
{ "screen-off-timeout": "120000" }
- id: nspanel_entrance_screen_timeout_off
alias: NSPanel entrance screen timeout off
triggers:
- trigger: state
entity_id: light.entrance_overhead
to: "on"
actions:
- action: mqtt.publish
data:
topic: nspanelpro/nspanel_entrance/config/update
payload: >
{ "screen-off-timeout": "2147483647" }
- action: mqtt.publish
data:
topic: nspanelpro/nspanel_entrance/command/device
payload: >
{ "command": "wake_up" }
- id: nspanel_entrance_screen_wakeup
alias: NSPanel entrance screen wake up
triggers:
- trigger: state
entity_id: binary_sensor.entrance_pir_occupancy
to: "on"
- trigger: state
entity_id: binary_sensor.hall_pir_occupancy
to: "on"
actions:
- action: mqtt.publish
data:
topic: nspanelpro/nspanel_entrance/command/device
payload: >
{ "command": "wake_up" }