-
Notifications
You must be signed in to change notification settings - Fork 5
/
automations.yaml
5504 lines (5496 loc) · 164 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: '1665680853122'
alias: ☑️ Close Garage Door
description: Closes the garage door when the action is pressed
trigger:
- platform: event
event_type: mobile_app_notification_action
event_data:
action: close_garage_door
- platform: event
event_type: hass_agent_notifications
event_data:
action: close_garage_door
condition: []
action:
- target:
entity_id: cover.garage_door
data: {}
action: cover.close_cover
- data:
who: parents
title: Garage Door Closed
message: The Garage Door was closed
notification_icon: mdi:garage-variant
color: '#ff9800'
icon_url: local/icons/garage.png
group: Security
tag: garage-door
url: lovelace/security
action: script.notify_mobile
mode: single
- id: '1665681396617'
alias: ☑️ Garbage Collection
description: Confirm collection can is on the curb
trigger:
- platform: event
event_type: mobile_app_notification_action
event_data:
action: garbage_collection
- platform: event
event_type: mobile_app_notification_action
event_data:
action: recycle_collection
- platform: event
event_type: hass_agent_notifications
event_data:
action: garbage_collection
- platform: event
event_type: hass_agent_notifications
event_data:
action: recycle_collection
condition: []
action:
- variables:
tag: '{{ trigger.event.data.tag }}'
type: '{{ iif(tag == ''recycle_collection'', ''Recycling'', ''Garbage'') }}'
- target:
entity_id: input_boolean.{{ tag }}
action: input_boolean.turn_on
- parallel:
- data:
who: parents
title: '{{ type }} Collection'
message: The {{ type }} can is at the curb
notification_icon: '{{ trigger.event.data.notification_icon }}'
color: '{{ trigger.event.data.color }}'
icon_url: '{{ trigger.event.data.icon_url }}'
group: '{{ trigger.event.data.group }}'
tag: '{{ tag }}'
action: script.notify_mobile
- data:
entity:
- media_player.erebus
- media_player.nasya
title: '{{ type }} Collection'
message: The {{ type }} can is at the curb
action: script.notify_hass_agent
mode: single
- id: '1665681528781'
alias: ☑️ Ignore Door Alerts
description: Ignore door open alerts when the action is pressed
trigger:
- platform: event
event_type: mobile_app_notification_action
event_data:
action: ignore_door_alerts
- platform: event
event_type: hass_agent_notifications
event_data:
action: ignore_door_alerts
condition: []
action:
- target:
entity_id: input_boolean.door_open_alerts
data: {}
action: input_boolean.turn_off
- if:
- condition: template
value_template: '{{ trigger.event.data.tag != "" }}'
then:
- data:
who: parents
message: clear_notification
tag: '{{ trigger.event.data.tag }}'
action: script.notify_mobile
- data:
who: parents
title: Door Alerts Ignored
message: The Door Open alerts have been ignored until all doors are closed
icon_url: local/icons/door-open.png
group: Security
tag: door-alerts-ignored
action: script.notify_mobile
- data:
entity:
- media_player.erebus
- media_player.nasya
title: Door Alerts Ignored
message: The Door Open alerts have been ignored until all doors are closed
action: script.notify_hass_agent
mode: single
- id: '1665681539044'
alias: ☑️ Ignore Garage Door Alerts
description: Ignore garage door open alerts when the action is pressed
trigger:
- platform: event
event_type: mobile_app_notification_action
event_data:
action: ignore_garage_door_alerts
- platform: event
event_type: hass_agent_notifications
event_data:
action: ignore_garage_door_alerts
condition: []
action:
- target:
entity_id: input_boolean.garage_door_open_alerts
data: {}
action: input_boolean.turn_off
- data:
who: parents
message: clear_notification
tag: garage-door
action: script.notify_mobile
- data:
who: parents
title: Garage Door Alerts Ignored
message: The Garage Door Open alerts have been ignored until the Garage Door
is closed
icon_url: local/icons/garage-open.png
group: Security
tag: garage-door-alerts-ignored
action: script.notify_mobile
- data:
entity:
- media_player.erebus
- media_player.nasya
title: Garage Door Alerts Ignored
message: The Garage Door Open alerts have been ignored until the Garage Door
is closed
action: script.notify_hass_agent
mode: single
- id: '1665683799664'
alias: ☑️ Ignore Window Alerts
description: Ignore window open alerts when the action is pressed
trigger:
- platform: event
event_type: mobile_app_notification_action
event_data:
action: ignore_window_alerts
- platform: event
event_type: hass_agent_notifications
event_data:
action: ignore_window_alerts
action:
- target:
entity_id: input_boolean.window_open_alerts
data: {}
action: input_boolean.turn_off
- if:
- condition: template
value_template: '{{ trigger.event.data.tag != "" }}'
then:
- data:
who: parents
message: clear_notification
tag: '{{ trigger.event.data.tag }}'
action: script.notify_mobile
- data:
who: parents
title: Window Alerts Ignored
message: The Window Open alerts have been ignored until all windows are closed
notification_icon: mdi:window-open
color: '#9c27b0'
icon_url: local/icons/window-open.png
group: Security
tag: window-alerts-ignored
action: script.notify_mobile
- data:
entity:
- media_player.erebus
- media_player.nasya
title: Window Alerts Ignored
message: The Window Open alerts have been ignored until all windows are closed
action: script.notify_hass_agent
- id: '1665681550417'
alias: ☑️ Retry Remote Start Ascent
description: Starts the Ascent (usually after a failure) when the action is pressed
trigger:
- platform: event
event_type: mobile_app_notification_action
event_data:
action: remote_start_again
- platform: event
event_type: hass_agent_notifications
event_data:
action: remote_start_again
condition: []
action:
- parallel:
- target:
entity_id: button.ascent_remote_start
data: {}
action: button.press
- data:
who: parents
message: clear_notification
tag: ascent
action: script.notify_mobile
- data:
notification_id: ascent
action: persistent_notification.dismiss
mode: single
- id: '1665681684041'
alias: ☑️ Turn on Water Main
description: Turns on the water main when the action is pressed
trigger:
- platform: event
event_type: mobile_app_notification_action
event_data:
action: turn_on_water
- platform: event
event_type: hass_agent_notifications
event_data:
action: turn_on_water
condition: []
action:
- variables:
title: Water Main
message: The water main has been turned back on after the leak was detected.
- parallel:
- target:
entity_id: valve.water_main_valve
data: {}
action: valve.open_valve
- data:
who: parents
message: clear_notification
tag: water-leak
action: script.notify_mobile
- data:
notification_id: water-leak
action: persistent_notification.dismiss
- wait_for_trigger:
- platform: state
entity_id:
- valve.water_main_valve
to: open
timeout: 00:00:30
- parallel:
- data:
who: parents
title: '{{ title }}'
message: '{{ message }}'
notification_icon: mdi:water-alert
color: '#009688'
icon_url: local/icons/water-alert.png
group: Water Leak
priority: high
tag: water-leak-main-on
action: script.notify_mobile
- data:
entity:
- media_player.erebus
- media_player.nasya
title: '{{ title }}'
message: '{{ message }}'
action: script.notify_hass_agent
- data:
entity:
- media_player.shield_living_room
- media_player.shield_family_room
- media_player.shield_main_bedroom
title: '{{ title }}'
message: '{{ message }}'
icon_url: local/icons/water-alert.png
action: script.notify_pipup
mode: single
- id: '1665682232855'
alias: "\U0001F5A5️ [Ardena] Power Actions"
description: Actions to run when Ardena is on/off
trigger:
- platform: state
entity_id: binary_sensor.ardena_connected
condition: []
action:
- choose:
- conditions:
- condition: state
entity_id: binary_sensor.ardena_connected
state: 'on'
sequence:
- entity_id: fan.computer
action: fan.turn_on
- conditions:
- condition: state
entity_id: binary_sensor.ardena_connected
state: 'off'
sequence:
- entity_id: fan.computer
action: fan.turn_off
mode: single
- id: '1665682307865'
alias: "\U0001F5A5️ [Ardena] Power on Activity"
description: Turns on/off Ardena when the Family Room Harmony activity is changed
trigger:
- platform: state
entity_id: remote.harmony_family_room
attribute: current_activity
to: Computer
id: power_on
- platform: state
entity_id: remote.harmony_family_room
attribute: current_activity
from: Computer
to: PowerOff
id: power_off
condition: []
action:
- choose:
- conditions:
- condition: trigger
id:
- power_on
sequence:
- entity_id: switch.ardena
action: switch.turn_on
- conditions:
- condition: trigger
id:
- power_off
- condition: state
entity_id: binary_sensor.ardena_connected
state: 'on'
sequence:
- data: {}
target:
entity_id: button.ardena_sleep
action: button.press
mode: restart
- id: '1665682398363'
alias: "\U0001F4E6 Clear Packages Out for Delivery"
description: Clears package delivery notification when packages are delivered
triggers:
- entity_id: sensor.mail_packages_in_transit
to: '0'
trigger: state
conditions:
- condition: template
value_template: "{{ (trigger.from_state.state | int(default=0)) > 0\n and (trigger.to_state.state
| int(default=0)) != (trigger.from_state.state | int(default=0))\n and not
trigger.from_state.state in ['unknown', 'unavailable']\n and not trigger.to_state.state
in ['unknown', 'unavailable'] }}"
actions:
- data:
who: parents
message: clear_notification
tag: delivery-packages-pending
action: script.notify_mobile
mode: single
- id: '1665682414590'
alias: "\U0001F4E6 Mail Today"
description: Notifies when mail will be delivered today
triggers:
- entity_id: sensor.mail_usps_mail
trigger: state
conditions:
- condition: template
value_template: "{{ (trigger.to_state.state | int(default=0)) > 0\n and (trigger.to_state.state
| int(default=0)) != (trigger.from_state.state | int(default=0))\n and not
trigger.from_state.state in ['unknown', 'unavailable']\n and not trigger.to_state.state
in ['unknown', 'unavailable'] }}"
actions:
- variables:
message: '{{ trigger.to_state.state }} {{ "item" if trigger.to_state.state ==
"1" else "items" }} will be in the mailbox today.'
- data:
who: parents
title: Mail Today
message: '{{ message }}'
notification_icon: mdi:mail
color: '#2096f3'
camera: camera.mail_usps_camera
url: lovelace/main
group: Delivery
tag: delivery-mail
action: script.notify_mobile
- data:
entity:
- media_player.erebus
- media_player.nasya
title: Mail Today
message: '{{ message }}'
camera: camera.mail_usps_camera
action: script.notify_hass_agent
- data:
entity:
- media_player.shield_living_room
- media_player.shield_family_room
- media_player.shield_main_bedroom
title: Mail Today
message: '{{ message }}'
image: '{{ state_attr("camera.mail_usps_camera", "file_path")[1:] }}'
duration: 15
action: script.notify_pipup
mode: single
- id: '1665682445018'
alias: "\U0001F4E6 Packages Delivered"
description: Notifies when packages have been delivered
triggers:
- entity_id: sensor.mail_packages_delivered
trigger: state
conditions:
- condition: template
value_template: "{{ (trigger.to_state.state | int(default=0)) > 0\n and (trigger.to_state.state
| int(default=0)) != (trigger.from_state.state | int(default=0))\n and not
trigger.from_state.state in ['unknown', 'unavailable']\n and not trigger.to_state.state
in ['unknown', 'unavailable'] }}"
actions:
- variables:
message: '{{ trigger.to_state.state }} {{ "package is" if trigger.to_state.state
== "1" else "packages are" }} delivered.'
- parallel:
- data:
who: parents
title: Package Delivery
message: '{{ message }}'
notification_icon: mdi:package-variant
color: '#795548'
icon_url: local/icons/package-variant.png
group: Delivery
tag: delivery-packages-delivered
action: script.notify_mobile
- data:
entity:
- media_player.erebus
- media_player.nasya
title: Package Delivery
message: '{{ message }}'
action: script.notify_hass_agent
- data:
entity:
- media_player.shield_living_room
- media_player.shield_family_room
- media_player.shield_main_bedroom
title: Package Delivery
message: '{{ message }}'
icon_url: local/icons/package-variant.png
action: script.notify_pipup
mode: single
- id: '1665682458887'
alias: "\U0001F4E6 Packages Out for Delivery"
description: Notifies when packages are out for delivery
trigger:
- platform: state
entity_id: sensor.mail_packages_in_transit
condition:
- condition: template
value_template: "{{ (trigger.to_state.state | int(default=0)) > 0\n and (trigger.to_state.state
| int(default=0)) != (trigger.from_state.state | int(default=0))\n and not
trigger.from_state.state in [\"unknown\", \"unavailable\"]\n and not trigger.to_state.state
in [\"unknown\", \"unavailable\"] }}"
action:
- variables:
message: '{{ trigger.to_state.state }} {{ "package is" if trigger.to_state.state
== "1" else "packages are" }} out for delivery.'
- parallel:
- data:
who: parents
title: Package Delivery
message: '{{ message }}'
notification_icon: mdi:package
color: '#795548'
icon_url: local/icons/package.png
group: Delivery
tag: delivery-packages-pending
action: script.notify_mobile
- data:
entity:
- media_player.erebus
- media_player.nasya
title: Package Delivery
message: '{{ message }}'
action: script.notify_hass_agent
- data:
entity:
- media_player.shield_living_room
- media_player.shield_family_room
- media_player.shield_main_bedroom
title: Package Delivery
icon_url: local/icons/package.png
message: '{{ message }}'
action: script.notify_pipup
mode: single
- id: '1665685653869'
alias: "\U0001F4E6 Update USPS Mail Camera"
description: Updates the mail image camera when mail is updated
trigger:
- platform: state
entity_id: sensor.mail_updated
- platform: homeassistant
event: start
condition: []
action:
- data: {}
action: mail_and_packages.update_image
mode: single
- id: '1665685949212'
alias: ⏯ Family Room Media Auto Off
description: Automatically turn off the Media Center in the Family Room
trigger:
- platform: state
entity_id:
- remote.androidtv_family_room
to: 'off'
condition:
- condition: template
value_template: '{{ not trigger.from_state.state in ["unknown", "unavailable"]
}}'
- condition: state
entity_id: remote.harmony_family_room
state: 'on'
- condition: state
entity_id: remote.harmony_family_room
attribute: current_activity
state: Shield TV
action:
- entity_id: remote.harmony_family_room
action: remote.turn_off
mode: restart
- id: '1665685997408'
alias: ⏯ Main Bedroom Media Auto Off
description: Automatically turn off the Media Center in the Main Bedroom
trigger:
- platform: state
entity_id:
- remote.androidtv_main_bedroom
to: 'off'
condition:
- condition: template
value_template: '{{ not trigger.from_state.state in ["unknown", "unavailable"]
}}'
- condition: state
entity_id: remote.harmony_main_bedroom
state: 'on'
- condition: state
entity_id: remote.harmony_main_bedroom
attribute: current_activity
state: Shield TV
action:
- entity_id: remote.harmony_main_bedroom
action: remote.turn_off
mode: restart
- id: '1665686040957'
alias: "\U0001F9FA Dryer Notifications"
description: Actions when the dryer is running and is done
triggers:
- entity_id: sensor.emporiavue_main_dryer_power
for:
minutes: 1
above: 100
trigger: numeric_state
conditions: []
actions:
- alias: Set start time and start power tracking
variables:
start_time: '{{ now().timestamp() }}'
start_power_consumption: '{{ states(''sensor.emporiavue_main_dryer_daily'')
| float }}'
- alias: Set dryer active switch on
target:
entity_id: input_boolean.dryer_status
data: {}
action: input_boolean.turn_on
- alias: Wait until appliance has finished
wait_for_trigger:
- entity_id: sensor.emporiavue_main_dryer_power
below: 100
for:
seconds: 30
trigger: numeric_state
- alias: Set message and stop power tracking
variables:
end_power_consumption: '{{ states(''sensor.emporiavue_main_dryer_daily'') |
float }}'
message: 'The dryer is done! {% set kwh = end_power_consumption | float - start_power_consumption
| float %} {{''\n''}}Consumption {{kwh | round(2) }}kWh {% set cost = (end_power_consumption
| float - start_power_consumption | float) * (states(''sensor.tariff_price'')
| float) %} {{''\n''}}Approx Cost ${{cost | round(2) }} {% set end_time =
now().timestamp() %} {% set duration = (end_time - start_time) | int %} {%
set hours = (duration // 3600) | int %} {% set minutes = ((duration % 3600)
// 60) | int %} {% set seconds = (duration % 60) | int %} {{''\n''}}Duration
{{ ''%02d'' | format(hours) }}:{{ ''%02d'' | format(minutes) }}:{{ ''%02d''
| format(seconds) }}
'
- alias: Set dryer active switch off
target:
entity_id: input_boolean.dryer_status
data: {}
action: input_boolean.turn_off
- alias: Send a notification to each device
parallel:
- data:
who: parents
title: Dryer
message: '{{ message }}'
notification_icon: mdi:tumble-dryer
color: '#ff9800'
icon_url: local/icons/tumble-dryer.png
group: Laundry
priority: high
tag: laundry-dryer
action: script.notify_mobile
- data:
entity:
- media_player.erebus
- media_player.nasya
title: Dryer
message: '{{ message }}'
action: script.notify_hass_agent
- data:
entity:
- media_player.shield_living_room
- media_player.shield_family_room
- media_player.shield_main_bedroom
title: Dryer
message: The dryer is done!
icon_url: local/icons/tumble-dryer.png
action: script.notify_pipup
mode: single
max_exceeded: silent
- id: '1665686051361'
alias: "\U0001F9FA Washer Notifications"
description: Actions when the washer is running and is done
triggers:
- entity_id: sensor.emporiavue_main_washer_power
for:
minutes: 1
above: 40
trigger: numeric_state
conditions: []
actions:
- alias: Set start time and start power tracking
variables:
start_time: '{{ now().timestamp() }}'
start_power_consumption: '{{ states(''sensor.emporiavue_main_washer_daily'')
| float }}'
- alias: Set washer active switch on
target:
entity_id: input_boolean.washer_status
data: {}
action: input_boolean.turn_on
- alias: Wait until appliance has finished
wait_for_trigger:
- entity_id: sensor.emporiavue_main_washer_power
below: 10
for:
seconds: 30
trigger: numeric_state
- alias: Set message and stop power tracking
variables:
end_power_consumption: '{{ states(''sensor.emporiavue_main_washer_daily'') |
float }}'
message: 'The washer is done! {% set kwh = end_power_consumption | float - start_power_consumption
| float %} {{''\n''}}Consumption {{kwh | round(2) }}kWh {% set cost = (end_power_consumption
| float - start_power_consumption | float) * (states(''sensor.tariff_price'')
| float) %} {{''\n''}}Approx Cost ${{cost | round(2) }} {% set end_time =
now().timestamp() %} {% set duration = (end_time - start_time) | int %} {%
set hours = (duration // 3600) | int %} {% set minutes = ((duration % 3600)
// 60) | int %} {% set seconds = (duration % 60) | int %} {{''\n''}}Duration
{{ ''%02d'' | format(hours) }}:{{ ''%02d'' | format(minutes) }}:{{ ''%02d''
| format(seconds) }}
'
- alias: Set washer active switch off
target:
entity_id: input_boolean.washer_status
data: {}
action: input_boolean.turn_off
- alias: Send a notification to each device
parallel:
- data:
who: parents
title: Washer
message: '{{ message }}'
notification_icon: mdi:washing-machine
color: '#ff9800'
icon_url: local/icons/washing-machine.png
group: Laundry
priority: high
tag: laundry-washer
action: script.notify_mobile
- data:
entity:
- media_player.erebus
- media_player.nasya
title: Washer
message: '{{ message }}'
action: script.notify_hass_agent
- data:
entity:
- media_player.shield_living_room
- media_player.shield_family_room
- media_player.shield_main_bedroom
title: Washer
message: The washer is done!
icon_url: local/icons/washing-machine.png
action: script.notify_pipup
mode: single
max_exceeded: silent
- id: '1665686312416'
alias: "\U0001F4A1 All Lights off when Away"
description: Turns off all the lights when no one is home
trigger:
- platform: state
entity_id: group.people
from: home
to: not_home
for:
minutes: 15
condition:
- condition: state
entity_id: input_boolean.guest_mode
state: 'off'
- condition: sun
after: sunrise
after_offset: 00:45:00
- condition: sun
before: sunset
before_offset: -00:45:00
- condition: state
entity_id: light.all_lights
state: 'on'
action:
- parallel:
- data: {}
target:
entity_id: light.all_lights
action: light.turn_off
- data:
who: parents
title: Lights Out
message: The lights have been turned off since no one is home.
notification_icon: mdi:lightbulb
color: '#9e9e9e'
icon_url: local/icons/lightbulb.png
group: Light
action: script.notify_mobile
mode: single
- id: '1665686481763'
alias: "\U0001F4A1 Dim Front Lights at Night"
description: Dims the front lights at night
triggers:
- at: input_datetime.lights_front_night_dim
trigger: time
conditions: []
actions:
- data:
transition: 360
brightness_pct: 25
kelvin: 3000
target:
entity_id: light.outside_garage
action: light.turn_on
- data:
transition: 360
brightness_pct: 1
kelvin: 3000
target:
entity_id: light.outside_entry
action: light.turn_on
mode: single
- id: '1665686521519'
alias: "\U0001F4A1 Front Lights off at Sunrise"
description: Turns the front lights off at sunrise
trigger:
- platform: sun
event: sunrise
offset: +00:20:00
condition: []
action:
- action: light.turn_off
data: {}
target:
entity_id:
- light.outside_garage
- light.outside_entry
mode: single
- id: '1665686549835'
alias: "\U0001F4A1 Front Lights on at Sunset"
description: Turns the front lights on at sunset
triggers:
- event: sunset
offset: -00:20:00
trigger: sun
conditions:
- condition: time
before: input_datetime.lights_front_night_dim
after: 00:00:00
actions:
- variables:
scene: '{{ states(''sensor.seasonal_lights'')}}'
- action: scene.turn_on
metadata: {}
data: {}
target:
entity_id: '{{ scene }}'
mode: single
- id: '1665686584864'
alias: "\U0001F4A1 Living Room Lamps on/off"
description: Turns on/off the Living Room lamps
trigger:
- platform: sun
event: sunset
offset: -00:20:00
id: 'on'
- platform: time
at: input_datetime.living_room_lamps_off
id: 'off'
condition: []
action:
- choose:
- conditions:
- condition: trigger
id:
- 'on'
sequence:
- if:
- condition: state
entity_id: light.living_room_floor_lamp
state: 'off'
then:
- entity_id: light.living_room_floor_lamp
data:
transition: 30
brightness: 100
color_temp: 370
action: light.turn_on
- if:
- condition: state
entity_id: light.living_room_lamp
state: 'off'
then:
- entity_id: light.living_room_lamp
data:
transition: 30
brightness: 100
action: light.turn_on
- conditions:
- condition: trigger
id:
- 'off'
sequence:
- entity_id: light.living_room_floor_lamp
action: light.turn_off
- entity_id: light.living_room_lamp
action: light.turn_off
mode: single
- id: '1665686715952'
alias: "\U0001F4A1 Turn Lights On when Arrive"
description: Turns lights on when someone arrives home after sunset
triggers:
- entity_id: group.people
from: not_home
to: home
for:
minutes: 1
trigger: state
conditions:
- condition: sun
after: sunset
after_offset: -0:30:00
- condition: time
before: '23:59:59'
after: 00:00:00
actions:
- parallel:
- entity_id: light.mud_room
action: light.turn_on
- entity_id: light.living_room_fan_light
data:
brightness: 255
action: light.turn_on
- data:
brightness: 255
action: light.turn_on
target:
entity_id: light.dining_room
- data:
who: parents
title: Lights On
message: Welcome home, some lights have been turned on for you since it's
dark.
notification_icon: mdi:lightbulb-on
color: '#ffeb3b'
icon_url: local/icons/lightbulb-on.png
group: Light
action: script.notify_mobile
- delay:
minutes: 5
- entity_id: light.mud_room
action: light.turn_off
mode: single
- id: '1665686891355'
alias: "\U0001F512 Door Lock Jammed"
description: ''
trigger:
- platform: state
entity_id:
- binary_sensor.front_door_lock_jammed
to: 'on'
- platform: state
entity_id:
- binary_sensor.garage_entry_lock_jammed
to: 'on'
condition: []
action:
- variables:
lock: '{{ trigger.to_state.attributes.friendly_name | replace('' jammed'', '''')
}}'
message: Check the {{ lock }}, something is wrong.
- parallel:
- data:
who: parents
title: '{{ lock }} Issue'
message: '{{ message }}'
notification_icon: mdi:lock-smart
color: '#03a9f4'
icon_url: local/icons/lock-smart.png
group: Security
action: script.notify_mobile
- data:
entity:
- media_player.erebus
- media_player.nasya
title: '{{ lock }} Issue'
message: '{{ message }}'
action: script.notify_hass_agent
- data:
entity:
- media_player.shield_living_room
- media_player.shield_family_room
- media_player.shield_main_bedroom
title: '{{ lock }} Issue'
message: '{{ message }}'
icon_url: local/icons/lock-smart.png
action: script.notify_pipup
- data:
media_player: media_player.cast_living_room_speaker
message: '{{ message }}'
action: script.notify_speech
mode: single
- id: '1665686913548'
alias: "\U0001F512 Lock Doors when Away"
description: ''
trigger:
- platform: state
entity_id: group.people
from: home
to: not_home
for:
minutes: 5
condition:
- condition: state
entity_id: input_boolean.guest_mode
state: 'off'
- condition: state
entity_id: lock.all_locks
state: unlocked
action:
- if:
- condition: state
entity_id: schedule.front_door_auto_lock
state: 'off'
- condition: state
entity_id: lock.front_door
state: unlocked
- condition: state
entity_id: binary_sensor.front_door_window_door_is_open
state: 'off'