-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathautomations.yaml
927 lines (816 loc) · 23.1 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
#- alias: 'Follow Me Lights Mode On'
# trigger:
# platform: state
# entity_id: sensor.eveybody_home
# to: 'somebody'
# action:
# service: input_boolean.turn_on
# data:
# entity_id: input_boolean.follow_me_lights
- alias: 'Follow Me Lights Mode Off'
trigger:
platform: state
entity_id: sensor.eveybody_home
to: 'everybody'
action:
service: input_boolean.turn_off
data:
entity_id: input_boolean.follow_me_lights
- alias: 'Arriving Home'
trigger:
- platform: state
entity_id:
- device_tracker.dmitry
- device_tracker.eileen
- device_tracker.dogwalker
- device_tracker.siti
from: 'not_home'
to: 'home'
action:
service: script.set_arrive_sensor
data_template:
tracker: >
{% set person = trigger.entity_id.split('.')[1] %}
{{ 'input_boolean.' + person + '_arriving' }}
- alias: 'Dmitry Arrival Greeting'
trigger:
platform: state
entity_id: sensor.living_room_door_entry
to: 'Open'
action:
- service: script.arrive_dmitry_greetings
data_template:
person: 'dmitry'
speech_message: >
{% set person = 'Dimitri' %}
{{ [
"Welcome back home " + person ,
"House was not same without you " + person ,
"Good to see you back " + person ,
"Like you've never left " + person ,
"The king is back. Welcome " + person,
"Why took so long daddy? Woof!",
"There he is.." + person,
person + "Life is like a song, you’re back where you belong.",
"Welcome Home!" + person
] | random }}
- service: homeassistant.turn_off
data:
entity_id: input_boolean.dmitry_arriving
- alias: 'Eileen Arrival Greeting'
trigger:
platform: state
entity_id: sensor.living_room_door_entry
to: 'Open'
action:
- service: script.arrive_eileen_greetings
data_template:
person: 'eileen'
speech_message: >
{% set person = 'Eileen' %}
{{ [
"Welcome back home " + person ,
"I missed you mommy.. Woof.",
"Great to see you " + person ,
"Hope you had a great day " + person ,
"Family is happy to have you back " + person ,
"It is so lonelyy without you home " + person ,
"I was about to be sad without you " + person ,
"Hello.. My tail is all wagging Mommy." ,
"Hope you had a good day " + person ,
"Good to have you back " + person ,
"How was your day " + person ,
"Guess who is home?" + person,
person + "is now in the house!",
"Welcome Home Love. We have missed you. Or at least Dexter did.",
"Our home is now complete. Welcome Back " + person,
person + "Life is like a song, you’re back where you belong.",
"Welcome Home " + person
] | random }}
- service: homeassistant.turn_off
data:
entity_id: input_boolean.eileen_arriving
- alias: 'DogWalker Arrival Greeting'
trigger:
platform: state
entity_id: sensor.living_room_door_entry
to: 'Open'
action:
- service: script.arrive_dogwalker_greetings
data_template:
person: 'Prioshka'
speech_message: >
{% set person = 'Preoshka' %}
{{ [
"Welcome " + person ,
"I was waiting for you to walk me.. Woof.",
"My tail is wagging.. Woof,Woof " + person ,
"Hope you had a great day " + person ,
"I am happy to run on east coast with you " + person ,
"Lets go play and run " + person ,
"I was about to pee on the floor while waiting for you " + person ,
"Hello.. My tail is all wagging" + person ,
"Are we going for a walk? Yes. Yes. " ,
"Lets play. I am ready to go " + person ,
"Was looking out in the window for you " + person ,
"Guess who is here?" + person,
person + "is in the house. Yay! Woof,Woof!",
"Now we can go pee! Welcome Back " + person,
person + "Welcome to Dexter's house.",
"Welcome to our home. " + person
] | random }}
- service: homeassistant.turn_off
data:
entity_id: input_boolean.dogwalker_arriving
- alias: 'Kitesurf Text Alert'
trigger:
platform: state
entity_id: sensor.windy
to: 'Windy'
condition:
condition: and
conditions:
- condition: state
entity_id: sun.sun
state: 'above_horizon'
- condition: state
entity_id: input_boolean.wind_alert
state: 'on'
- condition: time
before: '18:30:00'
after: '10:00:00'
action:
- service: script.send_wind_alert
data_template:
wind_message: >
{{ [
"Time to go foiling." ,
"Bad day at the beach is better than good day at the office.",
"Time to head to the beach.",
"Wow, you could be riding now.",
"What is your reason for not being at the beach now?.",
"It's windy. Just like that. Boom!",
"Family, friends and work can wait. Wind will not!",
"Time to try that trick you were thinking about.",
"Is that just me or is it windy now?",
"I was getting bored, but it just picked up! Lets go.",
"Pack your gear! Wind is up.",
"Will it still be windy, by the time you get to the beach? Only one way to find out.",
"Everybody is out ridding. Are you ready to join them?",
"Its windy! Who will be the first one out?",
"Seems windy.",
"Ready to ride? ",
"Its kitesurfing Weather.",
"Lets go foiling..",
"Life is short. Go foil! ",
"Good wind for kitesurfing! "
] | random }}
Changi: {{ states.sensor.pws_wind_dir_3.state }} {{ states.sensor.costawindtotal.state | float | round(1) }} kmh
WindChart: http://bit.ly/wind-chart
----------------
5 min: From {{ states.sensor.pws_wind_kph_3.state | float | round(1) }} kmh To {{ states.sensor.pws_wind_gust_kph_3.state | float | round(1) }} kmh
15 min EMA: {{ states.sensor.amawindtotal.state | float | round(1) }} kmh
Temp: {{ states.sensor.pws_temp_c_3.state }} c Pressure: {{ states.sensor.pws_pressure_mb_3.state }} mb
Pressure Trend : {{ states.sensor.pws_pressure_trend_3.state }}
Next Hour: {{ states.sensor.pws_weather_1h_3.state }}
- alias: Send Facebook Wind Report
trigger:
platform: state
entity_id: input_boolean.fb_kitesurf_wind_request
to: 'on'
action:
service: script.send_facebook_wind_alert
- alias: Kitesurf Beach Report
trigger:
platform: state
entity_id: input_boolean.kitesurf_wind_request
to: 'on'
action:
- service: script.send_wind_alert
data_template:
wind_message: >
{{ [
"Time to go foiling." ,
"Bad day at the beach is better than good day at the office.",
"Time to head to the beach.",
"Wow, you could be riding now.",
"What is your reason for not being at the beach now?.",
"It's windy. Just like that. Boom!",
"Family, friends and work can wait. Wind will not!",
"Time to try that trick you were thinking about.",
"Is that just me or is it windy now?",
"I was getting bored, but it just picked up! Lets go.",
"Pack your gear! Wind is up.",
"Will it still be windy, by the time you get to the beach? Only one way to find out.",
"Everybody is out ridding. Are you ready to join them?",
"Its windy! Who will be the first one out?",
"Seems windy.",
"Ready to ride? ",
"Its kitesurfing Weather.",
"Lets go foiling..",
"Life is short. Go foil! ",
"Good wind for kitesurfing! "
] | random }}
Changi: {{ states.sensor.pws_wind_dir_3.state }} {{ states.sensor.costawindtotal.state | float | round(1) }} kmh
WindChart: http://bit.ly/wind-chart
----------------
5 min: From {{ states.sensor.pws_wind_kph_3.state | float | round(1) }} kmh To {{ states.sensor.pws_wind_gust_kph_3.state | float | round(1) }} kmh
15 min EMA: {{ states.sensor.amawindtotal.state | float | round(1) }} kmh
Temp: {{ states.sensor.pws_temp_c_3.state }} c Pressure: {{ states.sensor.pws_pressure_mb_3.state }} mb
Pressure Trend : {{ states.sensor.pws_pressure_trend_3.state }}
Next Hour: {{ states.sensor.pws_weather_1h_3.state }}
- alias: 'Kitesurf Voice Alert'
trigger:
platform: state
entity_id: sensor.windy
to: 'Windy'
condition:
condition: and
conditions:
- condition: state
entity_id: sun.sun
state: 'above_horizon'
- condition: state
entity_id: input_boolean.wind_alert
state: 'on'
- condition: time
before: '18:30:00'
after: '10:00:00'
- condition: state
entity_id: device_tracker.dmitry
state: 'home'
action:
- service: script.yandex_say
data_template:
sonos_entity: media_player.living_room
volume: 0.4
delay: '00:00:05'
message: >
{% set wind_txt = " {{ states.sensor.pws_wind_string.state }} " %}
{{ [
'Maybe time to go foiling.' ,
'Seems windy ' ,
'Are you ready to ride? ' ,
'Its kitesurfing Weather.' ,
'Lets go foiling ' ,
'Life is short, Go foil! ' ,
'I think its good for kitesurfing!'
] | random }}
- alias: 'Dexter Pee call'
trigger:
platform: mqtt
topic: iot/button/dexter/pee
action:
service: notify.ios_dmitry
data:
message: 'Daddy. I want to go pee.'
data:
push:
badge: 5
category: TEST_ALARM
- alias: 'Dexter TV Pee Alert'
trigger:
platform: state
entity_id: device_tracker.eileen
from: 'someplace'
to: 'someplace'
action:
service: notify.living_tv
data:
title: "Dexter Wee Alert"
message: "Daddy I want to go pee!"
- alias: ET Comes Home
trigger:
platform: state
entity_id: device_tracker.eileen
from: 'not_home'
to: 'home'
action:
service: notify.ios_dmitry
data:
message: 'ET is home'
data:
push:
badge: 5
category: TEST_ALARM
- alias: ET Left Home
trigger:
platform: state
entity_id: device_tracker.eileen
from: 'home'
to: 'not_home'
action:
service: notify.ios_dmitry
data:
message: 'ET left home'
data:
push:
badge: 5
category: TEST_ALARM
- alias: Cleaner Arrives
trigger:
platform: state
entity_id: device_tracker.sharon
from: 'not_home'
to: 'home'
action:
service: notify.ios_dmitry
data:
message: 'Cleaner Arrived'
data:
push:
badge: 5
category: TEST_ALARM
- alias: Cleaner Left
trigger:
platform: state
entity_id: device_tracker.sharon
from: 'home'
to: 'not_home'
action:
service: notify.ios_dmitry
data:
message: 'Cleaner Left Home'
data:
push:
badge: 5
category: TEST_ALARM
- alias: Dog Walker Arrived
trigger:
platform: state
entity_id: device_tracker.dogwalker
from: 'not_home'
to: 'home'
action:
service: notify.ios_dmitry
data:
message: 'Dog Wallker Arrived'
data:
push:
badge: 5
category: TEST_ALARM
- alias: Dog Walker Left Home
trigger:
platform: state
entity_id: device_tracker.dogwalker
from: 'home'
to: 'not_home'
action:
service: notify.ios_dmitry
data:
message: 'Dog Walker left house recently'
data:
push:
badge: 5
category: TEST_ALARM
- alias: Dog Walker-2 Arrived
trigger:
platform: state
entity_id: device_tracker.siti
from: 'not_home'
to: 'home'
action:
service: notify.ios_dmitry
data:
message: 'Siti Dog Wallker Arrived'
data:
push:
badge: 5
category: TEST_ALARM
- alias: Dog Walker-2 Left Home
trigger:
platform: state
entity_id: device_tracker.siti
from: 'home'
to: 'not_home'
action:
service: notify.ios_dmitry
data:
message: 'Siti Dog Walker left house recently'
data:
push:
badge: 5
category: TEST_ALARM
- alias: Aircon ON
trigger:
platform: state
entity_id: input_boolean.aircon
to: 'on'
action:
service: remote.send_command
data_template:
entity_id: remote.livingroom
command: Power ON
device: !secret au_device_id_aircon
- alias: Bedroom Aircon ON
trigger:
platform: state
entity_id: input_boolean.bedroom_aircon
to: 'on'
action:
service: script.turn_bedroom_aircon_on
- alias: Bedroom Aircon OFF
trigger:
platform: state
entity_id: input_boolean.bedroom_aircon
to: 'off'
action:
service: script.turn_bedroom_aircon_off
- alias: Office Aircon ON
trigger:
platform: state
entity_id: input_boolean.office_aircon
to: 'on'
action:
service: script.turn_office_aircon_on
- alias: Office Dehumidifier ON
trigger:
platform: state
entity_id: input_boolean.office_dehumidifer
to: 'on'
action:
service: script.turn_office_dehumidifier_on
- alias: Office Aircon OFF
trigger:
platform: state
entity_id: input_boolean.office_aircon
to: 'off'
action:
service: climate.set_operation_mode
entity_id: climate.office_climate_control_cooling_1
data:
operation_mode: "Off"
- alias: Office Dehumidifier OFF
trigger:
platform: state
entity_id: input_boolean.office_dehumidifer
to: 'off'
action:
service: script.turn_office_dehumidifier_off
- alias: Guestroom Aircon ON
trigger:
platform: state
entity_id: input_boolean.guestroom_aircon
to: 'on'
action:
service: script.turn_guestroom_aircon_on
- alias: Guestroom Aircon OFF
trigger:
platform: state
entity_id: input_boolean.guestroom_aircon
to: 'off'
action:
service: climate.set_operation_mode
entity_id: climate.guestroom_climate_control_cooling_1
data:
operation_mode: "Off"
- alias: Aircon OFF
trigger:
platform: state
entity_id: input_boolean.aircon
to: 'off'
action:
service: remote.send_command
data_template:
entity_id: remote.livingroom
command: Power OFF
device: !secret au_device_id_aircon
- alias: Fan ON
trigger:
platform: state
entity_id: input_boolean.fan
to: 'on'
action:
service: remote.send_command
data_template:
entity_id: remote.livingroom
command: PowerToggle
device: !secret au_device_id_fan
- alias: Fan OFF
trigger:
platform: state
entity_id: input_boolean.fan
to: 'off'
action:
service: remote.send_command
data_template:
entity_id: remote.livingroom
command: PowerToggle
device: !secret au_device_id_fan
- alias: Tv ON
trigger:
platform: state
entity_id: input_boolean.tv
to: 'on'
action:
service: remote.send_command
data_template:
entity_id: remote.livingroom
command: PowerOn
device: !secret au_device_id_tv
- alias: Tv OFF
trigger:
platform: state
entity_id: input_boolean.tv
to: 'off'
action:
service: remote.send_command
data_template:
entity_id: remote.livingroom
command: PowerOff
device: !secret au_device_id_tv
- alias: AppleTv ON Scrreen Saver
trigger:
platform: state
entity_id: input_boolean.apple_tv
to: 'on'
action:
service: script.turn_apple_tv_screensaver_on
- alias: AppleTv OFF Scrreen Saver
trigger:
platform: state
entity_id: input_boolean.apple_tv
to: 'off'
action:
service: remote.send_command
data_template:
entity_id: remote.livingroom
command: PowerOff
device: !secret au_device_id_tv
- alias: Sonos Activity Music ON
trigger:
platform: state
entity_id: input_boolean.Sonos_LivingRoom
to: 'on'
action:
service: remote.turn_on
entity_id: remote.living_room
data:
activity: 26463498
device: !secret au_device_id_sonos
- alias: Sonos Activity Music OFF
trigger:
platform: state
entity_id: input_boolean.Sonos_LivingRoom
to: 'off'
action:
service: remote.turn_off
entity_id: remote.living_room
- alias: Door Entry
trigger:
platform: state
entity_id: sensor.living_room_door_entry
to: 'Open'
condition:
- condition: state
entity_id: sun.sun
state: 'below_horizon'
action:
service: script.living_room_lights_on
- alias: Living Room Lights ON
trigger:
platform: state
entity_id: sensor.living_room_motion
to: 'Burglar'
condition:
condition: and
conditions:
- condition: state
entity_id: sun.sun
state: 'below_horizon'
- condition: state
entity_id: input_boolean.motion_detection
state: 'on'
action:
service: script.living_room_lights_on
- alias: Turn off Living room lights after 10 mins no motion
trigger:
platform: state
entity_id: sensor.living_room_motion
to: 'Off'
for:
minutes: 10
condition:
condition: and
conditions:
- condition: state
entity_id: sun.sun
state: 'below_horizon'
- condition: state
entity_id: input_boolean.motion_detection
state: 'on'
action:
service: script.living_room_lights_off
- alias: Familiy Room Lights ON
trigger:
platform: state
entity_id: sensor.family_room_motion
to: 'Burglar'
condition:
condition: and
conditions:
- condition: state
entity_id: sun.sun
state: 'below_horizon'
- condition: state
entity_id: input_boolean.motion_detection
state: 'on'
action:
service: script.follow_me_lights_on
data_template:
light_id: switch.family_room_ceiling_light_switch
- alias: Turn off Family room lights after 2 mins no motion
trigger:
platform: state
entity_id: sensor.family_room_motion
to: 'Off'
for:
minutes: 2
condition:
condition: and
conditions:
- condition: state
entity_id: input_boolean.motion_detection
state: 'on'
action:
service: homeassistant.turn_off
entity_id: switch.family_room_ceiling_light_switch
- alias: BedRoom Lights ON
trigger:
platform: state
entity_id: sensor.bedroom_motion
to: 'Burglar'
condition:
condition: and
conditions:
- condition: state
entity_id: sun.sun
state: 'below_horizon'
- condition: state
entity_id: input_boolean.motion_detection
state: 'on'
- condition: time
before: '23:59:58'
after: '19:00:00'
action:
service: script.follow_me_lights_on
data_template:
light_id: switch.bedroom_ceiling_light_switch
- alias: BedRoom LED ON
trigger:
platform: state
entity_id: sensor.bedroom_motion
to: 'Burglar'
condition:
condition: and
conditions:
- condition: state
entity_id: sun.sun
state: 'below_horizon'
- condition: state
entity_id: input_boolean.motion_detection
state: 'on'
- condition: time
after: '23:45:59'
before: '06:30:00'
action:
service: homeassistant.turn_on
data:
entity_id: light.bedroom_steps_led_level
brightness: 50
- alias: Bedroom lights OFF after 2 mins no motion
trigger:
platform: state
entity_id: sensor.bedroom_motion
to: 'Off'
for:
minutes: 2
condition:
condition: and
conditions:
- condition: state
entity_id: sun.sun
state: 'below_horizon'
- condition: state
entity_id: input_boolean.motion_detection
state: 'on'
action:
service: homeassistant.turn_off
entity_id: switch.bedroom_ceiling_light_switch, light.bedroom_steps_led_level
- alias: Facebook Wind Alert
trigger:
platform: state
entity_id: sensor.windy
to: 'Windy'
condition:
condition: and
conditions:
- condition: state
entity_id: sun.sun
state: 'above_horizon'
- condition: state
entity_id: input_boolean.wind_alert
state: 'on'
- condition: time
before: '18:30:00'
after: '10:00:00'
action:
service: script.send_facebook_wind_alert
- alias: Office Lights ON
trigger:
platform: state
entity_id: sensor.office_motion
to: 'Burglar'
condition:
condition: and
conditions:
- condition: state
entity_id: sun.sun
state: 'below_horizon'
- condition: state
entity_id: input_boolean.motion_detection
state: 'on'
action:
service: script.follow_me_lights_on
data_template:
light_id: switch.office_lights_switch_2
- alias: Turn off Office lights after 10 mins no motion
trigger:
platform: state
entity_id: sensor.office_motion
to: 'Off'
for:
minutes: 10
condition:
condition: and
conditions:
- condition: state
entity_id: input_boolean.motion_detection
state: 'on'
action:
service: homeassistant.turn_off
entity_id: switch.office_lights_switch_2
- alias: Kitchen Lights ON
trigger:
platform: state
entity_id: sensor.kitchen_motion
to: 'Burglar'
condition:
condition: and
conditions:
- condition: state
entity_id: sun.sun
state: 'below_horizon'
- condition: state
entity_id: input_boolean.motion_detection
state: 'on'
action:
service: script.follow_me_lights_on
data_template:
light_id: switch.kitchen_light_switch
- alias: Turn off Kitchen lights after 10 mins no motion
trigger:
platform: state
entity_id: sensor.kitchen_motion
to: 'Off'
for:
minutes: 10
condition:
condition: and
conditions:
- condition: state
entity_id: input_boolean.motion_detection
state: 'on'
action:
service: homeassistant.turn_off
entity_id: switch.kitchen_light_switch
- alias: 'Bedroom AirCon Auto ON'
trigger:
platform: state
entity_id: sensor.bedroom_motion
to: 'Burglar'
condition:
condition: and
conditions:
- condition: time
before: '05:55:00'
after: '22:45:00'
- condition: or
conditions:
- condition: state
entity_id: sensor.eveybody_home
state: 'everybody'
- condition: state
entity_id: sensor.eveybody_home
state: 'somebody'
- condition: state
entity_id: input_boolean.bedroom_aircon
state: 'off'
action:
service: script.turn_bedroom_aircon_on
- alias: 'Bedroom AirCon Morning Auto OFF'
trigger:
platform: time
at: '07:00'
action:
service: script.turn_bedroom_aircon_off