-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
automations.yaml
4544 lines (4538 loc) · 131 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: '1612565706408'
alias: Motion - Office
description: Turn on the office lights and monitors when motion is detected
trigger:
- type: motion
platform: device
device_id: e1e2966998a59721e9baf330ffbed4f1
entity_id: binary_sensor.office_motion
domain: binary_sensor
id: started
- type: no_motion
platform: device
device_id: e1e2966998a59721e9baf330ffbed4f1
entity_id: binary_sensor.office_motion
domain: binary_sensor
for:
hours: 0
minutes: 5
seconds: 0
id: stopped
condition: []
action:
- choose:
- conditions:
- condition: trigger
id: started
sequence:
- if:
- condition: state
entity_id: input_boolean.office_occupied
state: 'off'
then:
- if:
- condition: numeric_state
entity_id: zone.home
above: 0
below: 2
then:
- service: script.broadcast_message
data:
entity_id: media_player.office_speaker
message: "{% if states['binary_sensor.morning'].state == \"on\" %}Good
morning\n {% elif states['binary_sensor.afternoon'].state == \"on\"
%}Good afternoon\n {% else %}Good evening{% endif %} {% set people
= state_attr('zone.home', 'persons') %} {% set peoplestr\n= state_attr(people[0],
\"friendly_name\") %} {% set list1 = peoplestr.split(' ') %} {{ list1[0]
}}! {% if states['input_boolean.mission_control'].state == \"off\"
%} Welcome to Mission Control {% endif %}"
volume: 0.4
else:
- service: script.broadcast_message
data:
entity_id: media_player.office_speaker
message: "{% if states['binary_sensor.morning'].state == \"on\" %}Good
morning\n {% elif states['binary_sensor.afternoon'].state == \"on\"
%}Good afternoon\n {% else %}Good evening{% endif %} {% if states['input_boolean.mission_control'].state
== \"off\" %}\nWelcome to Mission Control {% endif %}"
volume: 0.4
- service: input_boolean.turn_on
data: {}
target:
entity_id: input_boolean.office_occupied
- service: switch.turn_on
data: {}
target:
entity_id:
- switch.monitors
- switch.plug_2
- switch.plug_3
- if:
- type: is_illuminance
condition: device
device_id: e1e2966998a59721e9baf330ffbed4f1
entity_id: sensor.office_motion_light_level
domain: sensor
below: 8
then:
- service: scene.turn_on
target:
entity_id: scene.office_cool_bright
metadata: {}
- service: input_boolean.turn_on
data: {}
target:
entity_id: input_boolean.mission_control
- conditions:
- condition: trigger
id: stopped
sequence:
- service: input_boolean.turn_off
data: {}
target:
entity_id: input_boolean.office_occupied
- service: switch.turn_off
data: {}
target:
entity_id:
- switch.monitors
- switch.plug_2
- switch.plug_3
- type: turn_off
device_id: 55263a0410c211eb93077d4d7438f169
entity_id: light.office
domain: light
mode: single
- id: '1612567868933'
alias: Motion - Office - Empty
description: Turn off monitors and lights if no motion is detected for 5 minutes
trigger:
- type: no_motion
platform: device
device_id: e1e2966998a59721e9baf330ffbed4f1
entity_id: binary_sensor.office_motion
domain: binary_sensor
for:
hours: 0
minutes: 5
seconds: 0
condition:
- condition: state
entity_id: input_boolean.office_occupied
state: 'on'
action:
- service: input_boolean.turn_off
data: {}
target:
entity_id: input_boolean.office_occupied
- service: switch.turn_off
data: {}
target:
entity_id:
- switch.monitors
- switch.plug_2
- switch.plug_3
- type: turn_off
device_id: 55263a0410c211eb93077d4d7438f169
entity_id: light.office
domain: light
mode: single
- id: '123'
alias: System - Config Check
description: Home Assistant Config Check
trigger: []
condition: []
action:
- service: script.check_config
data: {}
- delay:
hours: 0
minutes: 0
seconds: 30
milliseconds: 0
- alias: Restart on condition
choose:
- alias: validate and restart
conditions:
- condition: state
entity_id: sensor.config_result
state: invalid
sequence:
- service: notify.mark_ios_devices
data:
title: Home Assistant
message: Config Check invalid
data:
push:
interruption-level: active
group: Alarm
default: []
mode: single
- id: '9876543210'
alias: Backup - Midday
description: Incremental backup run every 12 hours and kept for 2 days
trigger:
- platform: time_pattern
hours: /12
condition:
- condition: time
after: 00:01:00
before: '23:59:00'
action:
- service: input_boolean.turn_off
metadata: {}
data: {}
target:
entity_id:
- input_boolean.backup_active
- input_boolean.backup_sync_active
- service: input_boolean.turn_on
data: {}
target:
entity_id: input_boolean.backup_active
- service: auto_backup.backup_partial
data:
name: Midday - {{ now().strftime('%A %-d %B %Y %-I:%M %p') }}
keep_days: 3
folders:
- homeassistant
- media
- share
- ssl
enabled: false
- service: hassio.addon_stdin
data:
addon: 15d21743_samba_backup
input: trigger
- delay:
hours: 0
minutes: 0
seconds: 15
milliseconds: 0
- wait_for_trigger:
- platform: state
entity_id:
- sensor.samba_backup
from: RUNNING
- wait_template: '{{ states(''sensor.samba_backup'') != ''RUNNING'' }}'
continue_on_timeout: false
enabled: false
- service: input_boolean.turn_off
data: {}
target:
entity_id: input_boolean.backup_active
enabled: false
- service: input_boolean.turn_on
data: {}
target:
entity_id: input_boolean.backup_sync_active
- service: script.dropbox_sync
data: {}
- wait_template: '{{ is_state(''sensor.dropback_sync'',''None'') }}'
continue_on_timeout: false
- service: input_boolean.turn_off
data: {}
target:
entity_id: input_boolean.backup_sync_active
enabled: false
- id: '9876543211'
alias: Backup - Midnight
description: Perform a full HASS backup once a day at 02:30, every day except Monday.
They are retained for 7 days
trigger:
- platform: time
at: 00:00:00
condition:
- condition: time
weekday:
- tue
- wed
- thu
- fri
- sat
- mon
enabled: false
action:
- service: input_boolean.turn_off
metadata: {}
data: {}
target:
entity_id:
- input_boolean.backup_active_midnight
- input_boolean.backup_sync_active_midnight
- service: input_boolean.turn_on
data: {}
target:
entity_id: input_boolean.backup_active_midnight
enabled: true
- service: auto_backup.backup_partial
data:
name: Midnight - {{ now().strftime('%A %-d %B %Y %-I:%M %p') }}
keep_days: 6
folders:
- homeassistant
- media
- share
- ssl
enabled: false
- service: hassio.addon_stdin
data:
addon: 15d21743_samba_backup
input: trigger
- delay:
hours: 0
minutes: 0
seconds: 15
milliseconds: 0
- wait_template: '{{ states(''sensor.samba_backup'') != ''RUNNING'' }}'
continue_on_timeout: false
- service: input_boolean.turn_off
data: {}
target:
entity_id: input_boolean.backup_active_midnight
enabled: false
- service: input_boolean.turn_on
data: {}
target:
entity_id: input_boolean.backup_sync_active_midnight
enabled: true
- service: script.dropbox_sync
data: {}
- wait_template: '{{ is_state(''sensor.dropback_sync'',''None'') }}'
continue_on_timeout: false
- service: input_boolean.turn_off
data: {}
target:
entity_id: input_boolean.backup_sync_active_midnight
enabled: false
- id: '9876543212'
alias: Backup - Weekly
description: Perform a full HASS backup every week, on a Monday at 02:30. It is
retained for 28 days
trigger:
- platform: time
at: 00:00:00
condition:
- condition: time
weekday:
- sun
action:
- service: input_boolean.turn_on
data: {}
target:
entity_id: input_boolean.backup_active_midnight
- service: auto_backup.backup_full
data:
name: Weekly - {{ now().strftime('%A %-d %B %Y %-I:%M %p') }}
keep_days: 29
enabled: false
- service: hassio.addon_stdin
data:
addon: 15d21743_samba_backup
input: trigger
- wait_template: '{{ states(''sensor.samba_backup'') != ''RUNNING'' }}'
continue_on_timeout: false
- service: input_boolean.turn_off
data: {}
target:
entity_id: input_boolean.backup_active_midnight
enabled: false
- service: input_boolean.turn_on
data: {}
target:
entity_id: input_boolean.backup_sync_active_midnight
- service: script.dropbox_sync
data: {}
- wait_template: '{{ is_state(''sensor.dropback_sync'',''None'') }}'
continue_on_timeout: false
- service: input_boolean.turn_off
data: {}
target:
entity_id: input_boolean.backup_sync_active_midnight
enabled: false
- id: '987654324'
alias: HASS - Update - Notification
description: A Home Assistant update is available!
trigger:
- platform: state
entity_id:
- update.home_assistant_core_update
- update.home_assistant_supervisor_update
from: 'off'
to: 'on'
action:
- service: notify.mobile_app_marks_iphone
data:
title: Home Assistant - Update Available
message: '{{ state_attr(trigger.entity_id, ''friendly_name'') }} version {{
state_attr(trigger.entity_id, ''latest_version'') }} has been released!'
data:
push:
interruption-level: active
group: Updates
initial_state: false
- id: '1640993226588'
alias: NAS - MAT-NAS-002 - Persistent Notification
description: There are app updates available for MAT-NAS-002
trigger:
- platform: state
entity_id:
- binary_sensor.mat_nas_002_security_status
to: unsafe
condition:
- type: is_unsafe
condition: device
device_id: bb7810ae10c211eb8f99effc3c654169
entity_id: binary_sensor.mat_nas_002_security_status
domain: binary_sensor
action:
- if:
- condition: state
entity_id: person.mark_matheson
state: home
then:
else:
- service: notify.mobile_app_marks_iphone
data:
title: MAT-NAS-002 Updates
message: Apps are {{state_attr('binary_sensor.mat_nas_002_security_status',
'update') }}
data:
push:
interruption-level: active
group: Updates
mode: single
initial_state: true
- id: '1640995213747'
alias: NAS - Updates - Notification
description: There are app updates available on a NAS
trigger:
- platform: state
entity_id:
- binary_sensor.piha_security_status
- binary_sensor.mat_nas_002_security_status
attribute: update
to: outOfDate
from: safe
condition: []
action:
- if:
- condition: state
entity_id: person.mark_matheson
state: home
then:
else:
- service: notify.mobile_app_marks_iphone
data:
message: '{{ state_attr(trigger.entity_id, ''name'') }} has app updates available'
data:
push:
interruption-level: active
group: Updates
- service: notify.persistent_notification
data:
message: '{{ state_attr(trigger.entity_id, ''name'') }} has app updates available'
title: NAS Updates Available
mode: single
initial_state: true
- id: '1641024889431'
alias: Presence - Bedtime
description: Activate lights and broadcast a message nearing bedtime
trigger:
- platform: time
at: '22:15:00'
condition:
- condition: state
entity_id: group.occupants
state: home
- condition: state
entity_id: input_boolean.gone_to_bed
state: 'off'
action:
- scene: scene.stairs_relax
enabled: false
- scene: scene.master_bedroom_dimmed
enabled: false
- service: scene.turn_on
target:
entity_id: scene.living_room_dimmed
metadata: {}
enabled: false
- service: script.broadcast_message
data:
entity_id: media_player.living_room_speaker
message: Hey {{ ["doofus", "moron", "idiot", "clown", "goose", "jackass", "ninny",
"dork", "nitwit", "turkey", "nincompoop", "knucklehead", "dummy", "ding-a-ling",
"dipstick", "ding-dong", "half-wit", "numbskull", "fathead", "butt-head",
"dumbbell", "chump", "dunce", "dodo"]|random }}, it's bedtime! Get your butt
up to bed.
volume: '{{ states(''input_number.volume_default'') }}'
mode: single
- id: '910112211'
alias: Alert - Office - Motion
description: Notification when motion is detected in the Office
trigger:
- type: motion
platform: device
device_id: e1e2966998a59721e9baf330ffbed4f1
entity_id: binary_sensor.office_motion
domain: binary_sensor
action:
- service: notify.mark_ios_devices
data:
title: ALERT
message: Motion detected in the {{ area_name(trigger.entity_id) }}
data:
push:
interruption-level: time-sensitive
group: Alert
mode: single
- id: '1641636320894'
alias: Alert - Stairs - Motion
description: ''
trigger:
- type: motion
platform: device
device_id: 4a5afeb4c9503bf0c19c50e47c75ed33
entity_id: binary_sensor.upstairs_2_iaszone
domain: binary_sensor
- type: motion
platform: device
device_id: 1d7d59d94c75d97244521d56052b20ad
entity_id: binary_sensor.downstairs_motion_iaszone
domain: binary_sensor
condition: []
action:
- service: notify.mark_ios_devices
data:
title: ALERT
message: Motion detected in the {{ area_name(trigger.entity_id) }}
data:
push:
interruption-level: time-sensitive
group: Alert
mode: single
- id: '1641638539739'
alias: Motion - Stairs - Empty
description: Turn off the stair light when the Stair motion detectors goes to an
off state (3 minutes after last motion)
trigger:
- type: no_motion
platform: device
device_id: 4a5afeb4c9503bf0c19c50e47c75ed33
entity_id: binary_sensor.upstairs_motion_iaszone
domain: binary_sensor
for:
hours: 0
minutes: 2
seconds: 0
- type: no_motion
platform: device
device_id: 1d7d59d94c75d97244521d56052b20ad
entity_id: binary_sensor.downstairs_motion_iaszone
domain: binary_sensor
for:
hours: 0
minutes: 2
seconds: 0
condition: []
action:
- type: turn_off
device_id: 55292fde10c211eba548dd2311283eaa
entity_id: light.stairs
domain: light
mode: single
- id: '1641696482993'
alias: Alarm - Leave Home
description: When all occupants leave home, set Synology Surveillance Station into
Away mode, turn off TV and lights
trigger:
- platform: state
entity_id:
- group.occupants
from: home
for:
hours: 0
minutes: 0
seconds: 0
to: not_home
condition: []
action:
- service: automation.trigger
data:
skip_condition: false
target:
entity_id: automation.check_all_doors
- service: light.turn_off
data: {}
target:
entity_id: light.lights_all
- type: turn_off
device_id: 2e53d475d3d4aff442d2df10d6f77b24
entity_id: switch.monitors
domain: switch
- service: remote.turn_off
data: {}
target:
entity_id: remote.sony_bravia_tv
- if:
- condition: state
entity_id: input_select.air_conditioning_mode
state: Winter
then:
- service: climate.set_preset_mode
data:
preset_mode: away
target:
entity_id:
- climate.bedroom_heater_controller
- climate.living_room_heater_controller
- climate.computer_fan_controller
else:
- service: switch.turn_off
data: {}
target:
entity_id:
- switch.plug_2_on_off
- switch.plug_3_on_off
- service: homeassistant.turn_off
data: {}
target:
entity_id:
- switch.mat_nas_002_home_mode
- switch.mat_nas_001_surveillance_station_home_mode
- service: alarm_control_panel.alarm_arm_away
data: {}
target:
entity_id: alarm_control_panel.home_alarm
- service: automation.turn_on
data: {}
target:
entity_id:
- automation.alarm_cameras_detected_motion
- automation.alarm_notify_living_room
- service: notify.mark_ios_devices
data:
title: ALARM
message: The alarm was armed in Away mode by presence detection at {{ states('sensor.date_and_time')
}}
data:
push:
interruption-level: time-sensitive
group: Alarm
enabled: false
mode: single
- id: '1641696997236'
alias: Alarm - Return Home
description: When an occupant returns home
trigger:
- platform: state
entity_id:
- group.occupants
to: home
for:
hours: 0
minutes: 0
seconds: 0
from: not_home
condition: []
action:
- if:
- condition: state
entity_id: input_select.air_conditioning_mode
state: Winter
then:
- service: climate.set_preset_mode
data:
preset_mode: home
target:
entity_id:
- climate.bedroom_heater_controller
- climate.living_room_heater_controller
- climate.computer_fan_controller
else:
- service: switch.turn_on
data: {}
target:
entity_id:
- switch.plug_2_on_off
- switch.plug_3_on_off
- service: homeassistant.turn_on
data: {}
target:
entity_id:
- switch.mat_nas_002_home_mode
- switch.mat_nas_001_surveillance_station_home_mode
- service: input_boolean.turn_on
data: {}
target:
entity_id: input_boolean.welcome_home
- service: alarm_control_panel.alarm_disarm
data:
code: '3971'
target:
entity_id: alarm_control_panel.home_alarm
- service: notify.mark_ios_devices
data:
title: ALARM
message: The alarm was disarmed by presence detection at {{ states('sensor.date_and_time')
}}
data:
push:
interruption-level: time-sensitive
group: Alarm
enabled: false
mode: single
- id: '1641706879888'
alias: Laundry - Finished - Notification
description: Notification that laundry has finished
trigger:
- platform: state
entity_id:
- sensor.washing_machine_status
to: 'Off'
for:
hours: 0
minutes: 0
seconds: 30
from: Running
variables:
trigger_message: Hey {{ ["doofus", "moron", "idiot", "clown", "goose", "jackass",
"ninny", "dork", "nitwit", "turkey", "nincompoop", "knucklehead", "dummy",
"ding-a-ling", "dipstick", "ding-dong", "half-wit", "numbskull", "fathead",
"butt-head", "dumbbell", "chump", "dunce", "dodo"]|random }}, the laundry
has finished and the {{ states('sensor.washing_machine_info') | lower }}.
Hang it on the line!
condition: []
action:
- if:
- condition: state
entity_id: person.mark_matheson
state: home
then:
- service: script.broadcast_message
data:
entity_id: media_player.media_player_all
message: '{{ trigger_message }}'
volume: '{{ states(''input_number.volume_default'') }}'
else:
- service: notify.mobile_app_marks_iphone
data:
message: '{{ trigger_message }}'
title: Laundry
data:
push:
interruption-level: time-sensitive
group: Laundry
mode: single
- id: '1642733157313'
alias: Alert - Kitchen - Door
description: Send notification if Kitchen door is opened
trigger:
- type: opened
platform: device
device_id: b37af0fb0e6264276fb476df525d4579
entity_id: binary_sensor.kitchen_door_open_closed
domain: binary_sensor
condition: []
action:
- service: notify.mark_ios_devices
data:
title: ALERT
message: '{{ state_attr(trigger.entity_id, ''friendly_name'') }} door has been
opened!'
data:
push:
interruption-level: time-sensitive
group: Alert
mode: single
- id: '1643240394812'
alias: Motion - Carport
description: Turn on the light in the Carport if motion detected after dark
trigger:
- type: motion
platform: device
device_id: 6e58e985d0d26c5577f6cbc01f5537fd
entity_id: binary_sensor.lumi_lumi_motion_ac02_motion
domain: binary_sensor
id: Started
- type: no_motion
platform: device
device_id: 6e58e985d0d26c5577f6cbc01f5537fd
entity_id: binary_sensor.lumi_lumi_motion_ac02_motion
domain: binary_sensor
id: Stopped
for:
hours: 0
minutes: 2
seconds: 0
condition: []
action:
- if:
- condition: trigger
id: Started
- condition: sun
after: sunset
before: sunrise
after_offset: '-1:00:00'
then:
- service: scene.turn_on
target:
entity_id: scene.carport_cool_bright
metadata: {}
else:
- service: light.turn_off
data: {}
target:
entity_id: light.carport_2
mode: single
- id: '1643411908559'
alias: Alert - Living Room - Motion
description: Notification when motion is detected in the Living Room
trigger:
- type: motion
platform: device
device_id: a674e14a85bab4e885d481a556aee691
entity_id: binary_sensor.living_room_motion
domain: binary_sensor
condition: []
action:
- service: notify.mark_ios_devices
data:
title: ALERT
message: Motion detected in the {{ area_name(trigger.entity_id) }}
data:
push:
interruption-level: time-sensitive
group: Alert
mode: single
- id: '1643690990974'
alias: Presence - Good Night
description: Run when I go to bed
trigger: []
condition: []
action:
- if:
- condition: numeric_state
entity_id: zone.home
above: 0
below: 2
then:
- service: script.broadcast_message
data:
entity_id: media_player.master_bedroom_speaker
message: Good night {%- set people = state_attr('zone.home', 'persons') -%}
{%- set peoplestr = state_attr(people[0], "friendly_name") -%} {% set list1
= peoplestr.split(' ') %} {{ list1[0] }}. It's {{ now().strftime('%H:%M')
}}. The maximum temperature tomorrow is expected to be {{ states['sensor.marsfield_temp_max_0'].state
}} degrees. The weather in Marsfield {% if 0 >= now().hour <= 6 %}today{%
else %}tomorrow{% endif %} is expected to be {% if 0 >= now().hour <= 6
%}{{ states('sensor.marsfield_extended_text_0') }}{% else %}{{ states('sensor.marsfield_extended_text_1')
}}{% endif %} Sunrise {% if 0 >= now().hour <= 6 %}this{% else %}tomorrow{%
endif %} morning is {{ states('sensor.nextsunrise') }}. Sleep well!
volume: '{{ states(''input_number.volume_bedtime'') }}'
else:
- service: script.broadcast_message
data:
entity_id: media_player.master_bedroom_speaker
message: Good night. It's {{ now().strftime('%H:%M') }}. The maximum temperature
tomorrow is expected to be {{ states['sensor.marsfield_temp_max_0'].state
}} degrees. The weather in Marsfield {% if 0 >= now().hour <= 6 %}today{%
else %}tomorrow{% endif %} is expected to be {% if 0 >= now().hour <= 6
%}{{ states('sensor.marsfield_extended_text_0') }}{% else %}{{ states('sensor.marsfield_extended_text_1')
}}{% endif %} Sunrise {% if 0 >= now().hour <= 6 %}this{% else %}tomorrow{%
endif %} morning is {{ states('sensor.nextsunrise') }}. Sleep well!
volume: '{{ states(''input_number.volume_bedtime'') }}'
- service: input_boolean.turn_off
data: {}
target:
entity_id:
- input_boolean.tv_mode
- service: input_boolean.turn_on
data: {}
target:
entity_id: input_boolean.gone_to_bed
- service: script.alarm_night
data: {}
mode: single
- id: '1643694520827'
alias: Presence - Good Morning
description: Good morning routine
trigger: []
condition: []
action:
- if:
- condition: numeric_state
entity_id: zone.home
above: 0
below: 2
then:
- service: script.broadcast_message
data:
entity_id: media_player.master_bedroom_speaker
message: "Good morning {%- set people = state_attr('zone.home', 'persons')
-%} {%- set\n peoplestr = state_attr(people[0], \"friendly_name\") -%} {%
set list1 =\n peoplestr.split(' ') %} {{ list1[0] }}. It's {{ now().strftime('%H:%M')
}}. {% if states['calendar.australia_nsw'] and state_attr('calendar.australia_nsw',
'start_time') == today %}Today is {{\n state_attr('calendar.australia_nsw',
'message') }}.{% endif %} {{ [\"Happy\",\n \"Let's attack\", \"Welcome to\",
\"Get up and embrace\", \"Have a great\"]|random\n }} {{ now().strftime('%A')
}}."
volume: '{{ states(''input_number.volume_bedtime'') }}'
else:
- service: script.broadcast_message
data:
entity_id: media_player.master_bedroom_speaker
message: Good morning. It's {{ now().strftime('%H:%M') }}. {% if states['calendar.australia_nsw']
and state_attr('calendar.australia_nsw', 'start_time') == today %}Today
is {{ state_attr('calendar.australia_nsw', 'message') }}.{% endif %} {{
["Happy", "Let's attack", "Welcome to", "Get up and embrace", "Have a great"]|random
}} {{ now().strftime('%A') }}.
volume: '{{ states(''input_number.volume_bedtime'') }}'
- service: input_boolean.turn_off
data: {}
target:
entity_id:
- input_boolean.gone_to_bed
- input_boolean.good_morning
- input_boolean.mission_control
- service: switch.turn_on
data: {}
target:
entity_id: switch.washing_machine_on_off
- service: script.alarm_disarm
data: {}
mode: single
- id: '1643931984578'
alias: Alert - Carport - Motion
description: Notification if motion detected in the Carport
trigger:
- type: motion
platform: device
device_id: 6e58e985d0d26c5577f6cbc01f5537fd
entity_id: binary_sensor.lumi_lumi_motion_ac02_motion
domain: binary_sensor
condition: []
action:
- service: notify.mark_ios_devices
data:
title: ALERT
message: Motion detected in the {{ area_name(trigger.entity_id) }}
data:
push:
interruption-level: time-sensitive
group: Alert
mode: single
- id: '1643945587705'
alias: Alert - Front Gate - Door
description: Send notification if Front gate is opened
trigger:
- type: opened
platform: device
device_id: 48009f8ce07ba0a2c677683c7b8113c4
entity_id: binary_sensor.front_gate_open_close
domain: binary_sensor
condition: []
action:
- service: notify.mark_ios_devices
data:
title: ALERT
message: '{{ state_attr(trigger.entity_id, ''friendly_name'') }} has been opened!'
data:
push:
interruption-level: time-sensitive
group: Alert
mode: single
- id: '1643946467716'
alias: Alert - Computer Cabinet - Door
description: Send notification if Computer Cabinet door is opened
trigger:
- type: opened
platform: device
device_id: 71ce8d4859084575b814c89ce9980a09
entity_id: binary_sensor.computer_cabinet_door_open_closed
domain: binary_sensor
condition: []
action:
- service: notify.mark_ios_devices
data:
title: ALERT
message: '{{ state_attr(trigger.entity_id, ''friendly_name'') }} door has been
opened!'
data:
push:
interruption-level: time-sensitive
group: Alert
mode: single
- id: '1643946873175'
alias: Alert - Fridge - Door
description: Send notification if Fridge door opened
trigger:
- type: opened
platform: device
device_id: f18beed3778382faaf0ec073cd02d4c1
entity_id: binary_sensor.fridge_door_open_closed
domain: binary_sensor
condition: []
action:
- service: notify.mark_ios_devices
data:
title: ALERT
message: '{{ state_attr(trigger.entity_id, ''friendly_name'') }} door has been
opened!'
data:
push:
interruption-level: time-sensitive
group: Alert
mode: single
- id: '1643948179138'
alias: Alert - Front Sliding - Door
description: Send notification if Front Sliding door is opened
trigger:
- type: opened
platform: device
device_id: 1a5adcdf74437226214d88c29bd35da9
entity_id: binary_sensor.front_sliding_door_open_closed
domain: binary_sensor
condition: []
action:
- service: notify.mark_ios_devices
data: