-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathautomations.yaml
3451 lines (3451 loc) · 84 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: '1628636985715'
alias: 'Dishwasher 1: Running'
description: ''
trigger:
- type: power
platform: device
device_id: e9add1d7cbaf9ac24247bdafa119ac3c
entity_id: sensor.dishwasher_monitor_current_consumption
domain: sensor
above: 200
condition:
- condition: not
conditions:
- condition: state
entity_id: input_select.dishwasher_status
state: Running
action:
- service: input_select.select_option
target:
entity_id: input_select.dishwasher_status
data:
option: Running
- service: counter.decrement
target:
entity_id: counter.dishwasher_refills_remaining
mode: single
- id: '1634247341320'
alias: 'Washing Machine 1: Running'
description: ''
trigger:
- type: power
platform: device
device_id: 4cb07f4ed8cbd66c706783be0e291d40
entity_id: sensor.washing_machine_monitor_current_consumption
domain: sensor
above: 100
enabled: false
- platform: numeric_state
entity_id: sensor.washing_machine_monitor_current_consumption
above: 100
condition:
- condition: state
entity_id: input_select.washing_machine_status
state: Idle
enabled: true
action:
- service: input_select.select_option
target:
entity_id: input_select.washing_machine_status
data:
option: Running
mode: single
- id: '1635557895849'
alias: 'Washing Machine 2: Finishing'
description: ''
trigger:
- type: power
platform: device
device_id: 4cb07f4ed8cbd66c706783be0e291d40
entity_id: sensor.washing_machine_monitor_current_consumption
domain: sensor
below: 100
for:
hours: 0
minutes: 3
seconds: 0
condition:
- condition: state
entity_id: input_select.washing_machine_status
state: Running
action:
- service: input_select.select_option
target:
entity_id: input_select.washing_machine_status
data:
option: Finishing
mode: single
- id: '1635558163655'
alias: 'Washing Machine 3: Clean'
description: ''
trigger:
- type: power
platform: device
device_id: 4cb07f4ed8cbd66c706783be0e291d40
entity_id: sensor.washing_machine_monitor_current_consumption
domain: sensor
below: 5
for:
hours: 0
minutes: 5
seconds: 0
milliseconds: 0
condition:
- condition: state
entity_id: input_select.washing_machine_status
state: Finishing
action:
- service: input_select.select_option
target:
entity_id: input_select.washing_machine_status
data:
option: Clean
- service: notify.standard
data:
title: Washing Machine has Finished
message: Empty it now.
- service: shopping_list.add_item
data:
name: Empty the washing machine
mode: single
- id: '1635675397925'
alias: 'Tumble Dryer 1: Drying'
description: ''
trigger:
- type: power
platform: device
device_id: 92224f9cfbf922e97724f6754d21f7b5
entity_id: sensor.tumble_dryer_monitor_current_consumption
domain: sensor
above: 100
for:
hours: 0
minutes: 1
seconds: 0
milliseconds: 0
condition: []
action:
- service: input_select.select_option
data:
entity_id: input_select.tumble_dryer_status
option: Drying
mode: single
- id: '1635802296533'
alias: 'Tumble Dryer 2: Needs Emptying'
description: ''
trigger:
- type: power
platform: device
device_id: 92224f9cfbf922e97724f6754d21f7b5
entity_id: sensor.tumble_dryer_monitor_current_consumption
domain: sensor
below: 100
for:
hours: 0
minutes: 5
seconds: 0
milliseconds: 0
condition:
- condition: and
conditions:
- condition: state
entity_id: input_select.tumble_dryer_status
state: Drying
- condition: and
conditions:
- condition: state
entity_id: binary_sensor.tumble_dryer_door_contact
state: 'off'
action:
- service: input_select.select_option
data:
option: Needs Emptying
target:
entity_id: input_select.tumble_dryer_status
- service: notify.standard
data:
title: Tumble Dryer has Finished
message: Empty it now
mode: single
- id: '1635806770670'
alias: Water Jug Filter Days Remaining Decrement
description: ''
trigger:
- platform: time
at: 01:00
condition: []
action:
- service: counter.decrement
target:
entity_id: counter.water_jug_filter
mode: single
- id: '1635889319656'
alias: Alarm Clock with Wake Up Light
description: ''
use_blueprint:
path: sbyx/wake-up-light-alarm-with-sunrise-effect.yaml
input:
manual_time: 08:30:00
check_entity: binary_sensor.alarm_clock_status
post_sunrise_actions:
- service: cover.open_cover
target:
entity_id: cover.bedroom_blind
data: {}
- service: notify.standard
data:
title: Sunrise Automation
message: Post-sunrise
- service: rest_command.alarm_clock_end_shortcut
data: {}
- service: input_datetime.set_datetime
target:
entity_id: input_datetime.alarm_clock_ran
data:
datetime: '{{ now() }}'
- service: script.reset_alarm_to_default
data: {}
light_entity: light.wake_up
pre_sunrise_actions:
- service: notify.standard
data:
title: Sunrise Automation
message: Pre-sunrise
- service: script.disable_alarm_if_not_at_home
data: {}
- service: climate.set_temperature
target:
entity_id: climate.bedroom_thermostat
data:
temperature: 18
enabled: false
timestamp_sensor: sensor.alarm_clock_timestamp
sunrise_duration: 30
- id: '1635898135761'
alias: Check if at Home after turning on alarm
description: ''
trigger:
- platform: state
entity_id: input_datetime.alarm_time
condition: []
action:
- delay:
hours: 0
minutes: 5
seconds: 0
milliseconds: 0
- service: script.disable_alarm_if_not_at_home
mode: single
- id: '1636282256212'
alias: 'Dishwasher 4: Clean to Dirty'
description: ''
trigger:
- platform: time
at: input_datetime.dishwasher_finishes_drying
condition:
- condition: state
entity_id: input_select.dishwasher_status
state: Clean
action:
- service: input_select.select_option
target:
entity_id: input_select.dishwasher_status
data:
option: Dirty
mode: single
- id: '1636495549037'
alias: 'Tumble Dryer 3: Empty'
description: ''
trigger:
- type: opened
platform: device
device_id: 48b62d261d34910dd58b458a4b428e21
entity_id: binary_sensor.tumble_dryer_door_contact
domain: binary_sensor
condition: []
action:
- service: input_select.select_option
target:
entity_id: input_select.tumble_dryer_status
data:
option: Empty
mode: single
- id: '1636495599966'
alias: 'Washing Machine 4: Idle'
description: ''
trigger:
- type: opened
platform: device
device_id: df8b9c0ce4492b787a1982bd7494d9e6
entity_id: binary_sensor.washing_machine_door_contact
domain: binary_sensor
condition:
- condition: not
conditions:
- condition: state
entity_id: input_select.washing_machine_status
state: Idle
action:
- service: input_select.select_option
data:
option: Idle
target:
entity_id: input_select.washing_machine_status
mode: single
- id: '1636831426523'
alias: Kitchen Device Status Change Notifications
description: ''
trigger:
- platform: state
entity_id:
- input_select.dishwasher_status
id: dishwasher
to: Clean
from: Drying
- platform: state
entity_id:
- input_select.washing_machine_status
id: washing_machine
to: Clean
from: Finishing
- platform: state
entity_id:
- input_select.tumble_dryer_status
id: tumble_dryer
to: Needs Emptying
from: Drying
condition: []
action:
- choose:
- conditions:
- condition: trigger
id: dishwasher
sequence:
- service: rest_command.grocy_manual_chore_due
data:
choreId: 38
- conditions:
- condition: trigger
id: washing_machine
sequence:
- if:
- condition: state
entity_id: binary_sensor.washing_machine_door_contact
state: 'on'
then:
- service: input_select.select_first
data: {}
target:
entity_id: input_select.washing_machine_status
- stop: ''
else:
- service: rest_command.grocy_manual_chore_due
data:
choreId: 35
payload:
rescheduled_date: '{{ now() + timedelta( minutes = 15 ) }}'
- conditions:
- condition: trigger
id: tumble_dryer
sequence:
- service: rest_command.grocy_manual_chore_due
data:
choreId: 37
payload:
rescheduled_date: '{{ now() + timedelta( minutes = 15 ) }}'
default: []
- service: grocy.add_generic
data:
entity_type: tasks
data:
name: Empty the {{ trigger.to_state.attributes.friendly_name | replace("Status",
"") | trim }}
due_date: '{{ now().year }}-{{ now().month }}-{{ now().day }}'
enabled: false
- service: telegram_bot.send_message
data:
title: '{{ trigger.to_state.attributes.friendly_name | default("Something in
the Kitchen") }}'
message: '{{ states(trigger.entity_id) | default("Finished") }}'
message_tag: '{{ trigger.id }}_state'
- if:
- condition: state
entity_id: media_player.philips_tv
state: 'on'
then:
- service: notify.android_tv
data:
title: '{{ trigger.to_state.attributes.friendly_name | default("Something
in the Kitchen") }}'
message: '{{ states(trigger.entity_id) | default("Finished") }}'
mode: single
- id: '1636844645498'
alias: Energy Meter Tariff Switch
description: ''
trigger:
- platform: time
at: 00:00
- platform: time
at: 06:00
condition: []
action:
- service: utility_meter.next_tariff
target:
entity_id:
- utility_meter.daily_energy
- utility_meter.weekly_energy
- utility_meter.monthly_energy
mode: single
- id: '1637004661254'
alias: 'Lava Lamp 1: Set Turn off Time'
description: ''
trigger:
- platform: state
entity_id:
- light.lava_lamp
not_from: 'on'
to: 'on'
condition: []
action:
- service: input_datetime.set_datetime
target:
entity_id: input_datetime.lava_lamp_off
data:
timestamp: '{{ as_timestamp(now() + timedelta( hours = 7 )) }}'
mode: single
- id: '1637010364033'
alias: 'Lava Lamp 2: Turn Off'
description: ''
trigger:
- platform: time
at: input_datetime.lava_lamp_off
- platform: homeassistant
event: start
- platform: state
entity_id:
- light.lava_lamp
to: 'On'
for:
hours: 7
minutes: 30
seconds: 0
condition: []
action:
- service: light.turn_off
data: {}
target:
entity_id: light.lava_lamp
mode: single
- id: '1637010873397'
alias: 'Dishwasher 2: Drying'
description: ''
trigger:
- type: opened
platform: device
device_id: fe7d0a86c8421bc652d91da338cfe9e4
entity_id: binary_sensor.dishwasher_door_contact
domain: binary_sensor
condition:
- condition: state
entity_id: input_select.dishwasher_status
state: Running
action:
- service: input_select.select_option
target:
entity_id: input_select.dishwasher_status
data:
option: Drying
- service: fan.turn_on
data: {}
target:
entity_id: fan.kitchen_extractor
- service: input_datetime.set_datetime
target:
entity_id: input_datetime.dishwasher_finishes_drying
data:
timestamp: '{{ as_timestamp(now() + timedelta( minutes = 10 )) }}'
mode: single
- id: '1637011165703'
alias: 'Dishwasher 3: Finished Drying'
description: ''
trigger:
- platform: time
at: input_datetime.dishwasher_finishes_drying
condition:
- condition: state
entity_id: input_select.dishwasher_status
state: Drying
action:
- service: input_select.select_option
target:
entity_id: input_select.dishwasher_status
data:
option: Clean
- service: fan.turn_off
data: {}
target:
entity_id: fan.kitchen_extractor
- service: input_datetime.set_datetime
target:
entity_id: input_datetime.dishwasher_finishes_drying
data:
timestamp: '{{ as_timestamp(now() + timedelta( hours = 1 )) }}'
mode: single
- id: '1637147200786'
alias: 'Alarm Clock: Notify of time set'
description: ''
trigger:
- platform: time
at: '21:00'
- platform: homeassistant
event: start
id: home-assistant-start
condition:
- condition: and
conditions:
- condition: trigger
id: home-assistant-start
- condition: time
after: '21:00'
action:
- choose:
- conditions:
- condition: and
conditions:
- condition: not
conditions:
- condition: state
entity_id: input_select.manual_alarm_setting
state: Unset
- condition: state
entity_id: binary_sensor.workday_sensor
state: 'off'
sequence:
- service: notify.log_file
data:
title: No alarm set
message: No alarm set, no override set.
- service: notify.standard
data:
title: No alarm set
message: No alarm set, no override set.
default:
- service: notify.standard
data:
title: Alarm Set
message: Alarm is set for {{ states('input_datetime.alarm_time') }} tomorrow
mode: single
- id: '1637271399489'
alias: 'Heating Pad Switch 1: On'
description: ''
trigger:
- platform: state
entity_id: input_boolean.office_heating_pad_controller
from: 'off'
to: 'on'
id: office
- platform: state
entity_id: input_boolean.living_room_heating_pad_controller
from: 'off'
to: 'on'
id: living_room
condition: []
action:
- choose:
- conditions:
- condition: trigger
id: office
sequence:
- type: turn_on
device_id: 271d66f529a60fbdd1335c9434bd1278
entity_id: switch.office_heating_pad
domain: switch
- service: input_boolean.turn_off
target:
entity_id: input_boolean.living_room_heating_pad_controller
data: {}
- type: turn_off
device_id: 9e16330576df742cd97c19c54903c753
entity_id: switch.living_room_heating_pad
domain: switch
- conditions:
- condition: trigger
id: living_room
sequence:
- type: turn_on
device_id: 9e16330576df742cd97c19c54903c753
entity_id: switch.living_room_heating_pad
domain: switch
- service: input_boolean.turn_off
target:
entity_id: input_boolean.office_heating_pad_controller
data: {}
- type: turn_off
device_id: 271d66f529a60fbdd1335c9434bd1278
entity_id: switch.office_heating_pad
domain: switch
default: []
- service: script.heating_pad_heat
data: {}
mode: single
- id: '1637271809244'
alias: 'Heating Pad Switch 2: Off'
description: ''
trigger:
- platform: state
entity_id: input_boolean.office_heating_pad_controller
to: 'off'
from: 'on'
id: office
- platform: state
entity_id: input_boolean.living_room_heating_pad_controller
to: 'off'
from: 'on'
id: living_room
condition: []
action:
- service: input_datetime.set_datetime
target:
entity_id: input_datetime.heating_pad_time_change
data:
timestamp: '{{ as_timestamp(now()) }}'
- type: turn_off
device_id: 271d66f529a60fbdd1335c9434bd1278
entity_id: switch.office_heating_pad
domain: switch
- choose:
- conditions:
- condition: trigger
id: office
sequence:
- type: turn_off
device_id: 271d66f529a60fbdd1335c9434bd1278
entity_id: switch.office_heating_pad
domain: switch
- conditions:
- condition: trigger
id: living_room
sequence:
- type: turn_off
device_id: 9e16330576df742cd97c19c54903c753
entity_id: switch.living_room_heating_pad
domain: switch
default: []
mode: single
- id: '1637272487498'
alias: Heating Pad Time
description: ''
trigger:
- platform: time
at: input_datetime.heating_pad_time_change
id: time_trigger
- platform: homeassistant
event: start
id: home_assistant
condition:
- condition: or
conditions:
- condition: and
conditions:
- condition: trigger
id: home_assistant
- condition: time
after: input_datetime.heating_pad_time_change
- condition: trigger
id: time_trigger
- condition: or
conditions:
- condition: state
entity_id: input_boolean.office_heating_pad_controller
state: 'on'
- condition: state
entity_id: input_boolean.living_room_heating_pad_controller
state: 'on'
action:
- choose:
- conditions:
- condition: state
entity_id: input_select.heating_pad_state
state: Heat
sequence:
- service: script.heating_pad_pause
- choose:
- conditions:
- condition: state
entity_id: input_boolean.debug
state: 'on'
sequence:
- service: notify.standard
data:
title: Heating Pad
message: Pausing
default: []
- conditions:
- condition: state
entity_id: input_select.heating_pad_state
state: Pause
sequence:
- choose:
- conditions:
- condition: state
entity_id: input_boolean.debug
state: 'on'
sequence:
- service: notify.standard
data:
title: Heating Pad
message: Heating
default: []
- service: script.heating_pad_heat
default: []
mode: single
- id: '1637283110300'
alias: Robot Vacuum Running
description: ''
trigger:
- platform: state
entity_id:
- vacuum.buttercup_2_0
from: cleaning
to: docked
- platform: state
entity_id:
- vacuum.buttercup_2_0
from: returning
to: docked
condition: []
action:
- service: input_datetime.set_datetime
target:
entity_id: input_datetime.buttercup_cleaned
data:
date: '{{ now().strftime("%Y-%m-%d") }}'
mode: single
- id: '1637514198181'
alias: Home Assistant Start Checks
description: ''
trigger:
- platform: homeassistant
event: start
condition: []
action:
- choose:
- conditions:
- condition: device
type: is_on
device_id: 93f136451d30db55dd7bf47a9bae0251
entity_id: switch.living_room_air_freshener
domain: switch
sequence:
- type: turn_off
device_id: 93f136451d30db55dd7bf47a9bae0251
entity_id: switch.living_room_air_freshener
domain: switch
default: []
- choose:
- conditions:
- condition: device
type: is_on
device_id: 93f136451d30db55dd7bf47a9bae0251
entity_id: switch.living_room_air_freshener
domain: switch
sequence:
- type: turn_off
device_id: 93f136451d30db55dd7bf47a9bae0251
entity_id: switch.living_room_air_freshener
domain: switch
default: []
mode: single
- id: '1637579052093'
alias: Security Notification
description: ''
trigger:
- platform: device
device_id: b52cde9e0bda7a1606a13d4f39d567e9
domain: lock
entity_id: lock.yale_conexis_l1
type: unlocked
id: lock
- platform: device
device_id: a020138c924bb59a2b8ecd05bb893a3c
domain: lock
entity_id: lock.smart_door_lock
type: unlocked
id: lock
- platform: device
device_id: b52cde9e0bda7a1606a13d4f39d567e9
domain: lock
entity_id: lock.yale_conexis_l1
type: locked
id: lock
- platform: device
device_id: a020138c924bb59a2b8ecd05bb893a3c
domain: lock
entity_id: lock.smart_door_lock
type: locked
id: lock
condition: []
action:
- service: notify.standard
data:
title: Security Notification
message: '{{ trigger.to_state.attributes.friendly_name ~ " " ~ trigger.to_state
}}'
mode: single
- id: '1637885409509'
alias: 'Living Room TV: On/Off'
description: ''
trigger:
- platform: state
entity_id:
- binary_sensor.television_on
to: 'on'
id: 'On'
from: 'off'
- platform: state
to: 'off'
entity_id:
- binary_sensor.television_on
id: 'Off'
from: 'on'
condition: []
action:
- choose:
- conditions:
- condition: trigger
id: 'On'
sequence:
- service: switch.turn_off
target:
entity_id:
- switch.lights
data: {}
- if:
- condition: not
conditions:
- condition: or
conditions:
- condition: state
entity_id: cover.vertical_rotate
attribute: position
state: '0'
- condition: state
entity_id: cover.vertical_rotate
attribute: position
state: '100'
then:
- service: cover.close_cover
target:
entity_id:
- cover.vertical_rotate
data: {}
- conditions:
- condition: trigger
id: 'Off'
sequence:
- service: switch.turn_on
target:
entity_id:
- switch.100126cbfc_1
- switch.lights
data: {}
- choose:
- conditions:
- condition: state
entity_id: binary_sensor.dark_lounge
state: 'off'
sequence:
- service: script.open_living_room_blinds
data: {}
default: []
default: []
mode: single
- id: '1637885411110'
alias: 'Living Room TV: Media Controls Lights'
description: ''
trigger:
- platform: state
entity_id:
- binary_sensor.television_active
to: 'on'
id: 'On'
from: 'off'
- platform: state
entity_id:
- binary_sensor.television_active
to: 'off'
id: 'Off'
from: 'on'
- platform: state
id: 'On'
entity_id:
- media_player.living_room_apple_tv
not_from: playing
to: playing
- platform: state
id: 'Off'
entity_id:
- media_player.living_room_apple_tv
from: playing
not_to: playing
condition: []
action:
- choose:
- conditions:
- condition: trigger
id: 'On'
sequence:
- if:
- condition: state
entity_id: light.hallway_overhead
state: 'on'
then:
- service: light.turn_off
target:
entity_id: light.hallway_overhead
data: {}
- if:
- condition: or
conditions:
- condition: state
entity_id: binary_sensor.dark_lounge
state: 'on'
- condition: state
entity_id: light.living_room_main_lights
state: 'on'
enabled: true
then:
- if:
- condition: state
entity_id: light.living_room_main_lights
state: 'on'
then:
- service: scene.create
data:
scene_id: living_room_lights
snapshot_entities:
- light.living_room_overhead
- light.light_panels
- service: scene.turn_on
target:
entity_id: scene.living_room_dimmed
data:
transition: 10
- conditions:
- condition: trigger
id: 'Off'
sequence:
- if:
- condition: state
entity_id: binary_sensor.dark_lounge
state: 'on'
then:
- service: scene.turn_on
data:
transition: 20
target:
entity_id: scene.living_room_lights
default: []
mode: single
- id: '1637886815823'
alias: 'Living Room: Occupied'
description: ''
trigger:
- platform: state
entity_id:
- binary_sensor.presence_lounge
id: 'on'
to: 'on'
from: 'off'
- platform: state
to: 'off'
for:
hours: 0
minutes: 5
seconds: 0
id: 'off'
entity_id:
- binary_sensor.living_room_occupied
from: 'on'
condition:
- condition: or
conditions:
- condition: trigger
id: 'off'
- condition: and
conditions:
- condition: trigger
id: 'on'
- condition: state
entity_id: binary_sensor.dark_lounge
state: 'on'
- condition: not
conditions:
- condition: state
entity_id: input_select.rose_state
state: Sleep
- condition: numeric_state
entity_id: zone.home
above: 0
action:
- choose:
- conditions:
- condition: or
conditions:
- condition: trigger
id: 'on'
- condition: state
entity_id: binary_sensor.presence_lounge
state: 'on'
sequence: