-
Notifications
You must be signed in to change notification settings - Fork 52
/
Copy pathautomations.yaml
1272 lines (1264 loc) · 34.2 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: update_Readme
alias: Update README
trigger:
- platform: time
at: '11:00:00'
- platform: time
at: '21:00:00'
- platform: homeassistant
event: start
action:
- delay:
hours: 0
minutes: 5
seconds: 0
milliseconds: 0
- action: readme.generate
data: {}
initial_state: true
- alias: Set dark theme for night
id: dark_theme
initial_state: true
trigger:
- platform: time
at: '21:00:00'
- platform: homeassistant
event: start
condition:
condition: time
after: '20:59:00'
before: 08:59:00
action:
- action: frontend.set_theme
data:
name: Google Dark Theme
- alias: Set light theme for day
id: light_theme
initial_state: true
trigger:
- platform: time
at: 08:00:00
- platform: homeassistant
event: start
condition:
condition: time
after: 07:59:00
before: '20:59:00'
action:
action: frontend.set_theme
data:
name: default
- alias: Security Arm/Disarm
id: arm_disarm
initial_state: true
trigger:
platform: state
entity_id: input_boolean.security_status
action:
- action: script.turn_on
data:
entity_id: "{% if trigger.to_state.state == 'on' %}\n script.security_arm\n{%
elif trigger.to_state.state == 'off' %}\n script.security_disarm\n{% endif
%}\n"
- alias: House Occupied/Empty
id: occupied_empty
initial_state: true
trigger:
- platform: state
entity_id: group.trackers
to: not_home
for:
minutes: 1
- platform: state
entity_id: group.trackers
to: home
condition:
condition: state
entity_id: input_boolean.guest_mode
state: 'off'
action:
- action: script.turn_on
data:
entity_id: "{% if trigger.to_state.state == 'home' %}\n script.home_occupied\n{%
elif trigger.to_state.state == 'not_home' %}\n script.home_empty\n{% endif
%}\n"
- delay: 00:02:00
- alias: Mount/Umount /Plex
id: mount_unmount_plex
initial_state: true
trigger:
- platform: state
entity_id: switch.nas
from: 'off'
to: 'on'
for:
seconds: 30
- platform: state
entity_id: switch.nas
from: 'on'
to: 'off'
for:
seconds: 30
action:
action: "{% if trigger.to_state.state == 'on' %}\n shell_command.mount_plex\n{%
elif trigger.to_state.state == 'off' %}\n shell_command.umount_plex\n{% endif
%}\n"
- alias: Notify when AC Offline
id: notify_ac_offline
initial_state: true
trigger:
- platform: state
entity_id: binary_sensor.thermostat_online
to: 'off'
for: 00:30:00
action:
- action: script.notify_wrapper
data:
message: The thermostat appears to be offline...
- alias: Notify AC Equipment Event Occurs
id: notify_ac_equipment_event
initial_state: true
trigger:
- platform: state
entity_id: sensor.thermostat_active_equipment_event
condition: '{{ trigger.to_state.state not in [ ''unavailable'', '''' ] and trigger.from_state.state
not in [ ''unavailable'', '''' ] }}'
action:
- action: script.notify_wrapper
data:
message: 'AC Equipment Event: {{ trigger.to_state.state }}'
- alias: Notify when AC setting changes
id: ac_notify_change
initial_state: true
trigger:
- platform: state
entity_id: sensor.thermostat_setpoint
- platform: state
entity_id: sensor.thermostat_operating_mode
condition:
condition: and
conditions:
- condition: state
entity_id: input_boolean.ac_change_notification
state: 'on'
- '{{ trigger.from_state.state != trigger.to_state.state }}'
action:
- action: script.notify_wrapper
data:
message: '{% if trigger.entity_id == ''sensor.thermostat_setpoint'' %}Setpoint{%
elif trigger.entity_id == ''sensor.thermostat_mode'' %}Mode{% endif %}: {{
states(''sensor.thermostat_setpoint'') }}. Mode: {{ states(''sensor.thermostat_operating_mode'')
}}'
- alias: HTML5 or Android push notification action button clicked
id: html5_android_push
trigger:
- platform: event
event_type: html5_notification.clicked
- platform: event
event_type: mobile_app_notification_action
action:
action: "{% if trigger.event.data.action == 'turn_ac_off' %}\n script.turn_ac_off\n{%
endif %}\n"
- alias: Clear Alexa Recording History
id: alexa_history
trigger:
platform: time_pattern
hours: /12
action:
- action: alexa_media.clear_history
- id: update_last_datetimes
alias: Update 'Last' Datetimes
trigger:
- platform: state
entity_id:
- input_boolean.kitchen_motion
- binary_sensor.living_room_motion
- binary_sensor.hallway_motion
- binary_sensor.garage_person_occupancy
- binary_sensor.433_motion_master_bathroom
from: 'off'
to: 'on'
action:
- if: '{{ trigger.entity_id == ''binary_sensor.garage_person_occupancy'' }}'
then:
- action: input_datetime.set_datetime
data:
entity_id: input_datetime.garage_motion_last
datetime: '{{ now().strftime(''%Y-%m-%d %H:%M:%S'') }}'
else:
- action: input_datetime.set_datetime
data:
entity_id: input_datetime.{{trigger.entity_id | regex_replace(find='binary_sensor.',
replace='') | regex_replace(find='input_boolean.', replace='') | regex_replace(find='sensor.',
replace='') }}_last
datetime: '{{ now().strftime(''%Y-%m-%d %H:%M:%S'') }}'
- alias: Door Lock Alerts
id: door_lock_alerts
initial_state: true
trigger:
platform: state
entity_id:
- lock.front_door
- lock.garage_exterior_door
- lock.back_door
to: unlocked
condition: '{{ states(''input_boolean.door_notify'') == ''on''}}'
action:
- action: script.notify_wrapper
data:
message: '{{ trigger.to_state.name }} Unlocked'
data:
priority: 1
- id: terraform_cloud_webhook
alias: Terraform Cloud Webhook
trigger:
- platform: webhook
webhook_id: SECRET
local_only: false
allowed_methods:
- POST
action:
- action: notify.signal_self
data:
message: '{{ trigger.json.notifications[0].message }}: {{ trigger.json.run_url
}}'
initial_state: true
- alias: Panic Script Webhook Trigger
id: panic_script_webhook
initial_state: true
trigger:
platform: webhook
webhook_id: SECRET
local_only: false
action:
- action: media_player.volume_set
data:
entity_id: media_player.master
volume_level: 0.3
- action: notify.alexa_media_master
data:
data:
type: tts
message: Help is on the way
- alias: Bluebubbles Server Webhook
id: bluebubbles_server_webhook
initial_state: true
trigger:
platform: webhook
webhook_id: SECRET
local_only: false
action:
- action: input_text.set_value
target:
entity_id: input_text.bluebubbles_url
data:
value: '{{ trigger.json.data }}'
- alias: Cellular Message Health
id: cellular_message_health
trigger:
- platform: time
id: reset
at: 00:00:00
- platform: time
id: send_test_message
at: 09:00:00
- platform: webhook
id: mark_healthy
webhook_id: SECRET
local_only: false
- platform: time
id: evaluate_status
at: 09:05:00
action:
- if: '{{ trigger.id == ''reset'' }}'
then:
- action: input_boolean.turn_on
entity_id: input_boolean.cellular_message_test_pending
- if: '{{ trigger.id == ''send_test_message'' }}'
then:
- action: notify.cellular_message
data:
message: t
- if: '{{ trigger.id == ''mark_healthy'' }}'
then:
- action: input_boolean.turn_off
entity_id: input_boolean.cellular_message_test_pending
- if: '{{ trigger.id == ''evaluate_status'' }}'
then:
- if: '{{ is_state(''input_boolean.cellular_message_test_pending'', ''on'') }}'
then:
- action: notify.signal_homeassistant
data:
message: Modem Healtcheck Failed, Power Cycling
- action: esphome.cellular_modem_power_toggle
- alias: Cellular Modem Power Toggle
id: cellular_modem_power_toggle
mode: single
initial_state: true
trigger:
- platform: webhook
webhook_id: SECRET
local_only: false
- platform: state
entity_id: sensor.cellular_modem_power
from: 'on'
to: 'off'
action:
- action: esphome.cellular_modem_power_toggle
- alias: Power off NAS after backup
id: nas_poweroff_post_backup
initial_state: true
trigger:
platform: state
entity_id: binary_sensor.backups_complete
to: 'on'
condition:
condition: time
after: 03:00:00
before: 05:00:00
weekday:
- wed
action:
action: homeassistant.turn_off
entity_id:
- switch.nas
- binary_sensor.backups_complete
- alias: React to Spotify Starting to Play
id: spotify_reaction
initial_state: true
trigger:
- platform: state
entity_id: media_player.spotify
attribute: source
to: Office
- platform: state
entity_id: media_player.spotify
attribute: source
to: Everywhere
- platform: state
entity_id: media_player.spotify
to: playing
- platform: state
entity_id: media_player.spotify
attribute: source
to: Kitchen
condition: '{{ states(''media_player.spotify'') == ''playing''}}'
action:
- if: '{{ states(''media_player.spotify'') == ''playing'' and states(''switch.andrew_office_speakers'')
== ''off'' and state_attr(''media_player.spotify'', ''source'') in [''Everywhere'',
''Office''] }}'
then:
- action: homeassistant.turn_on
entity_id: switch.andrew_office_speakers
- id: speakers_with_xbox
alias: Turn on speakers and tv when XBOX powers on
triggers:
- entity_id:
- binary_sensor.xbox_power
to: 'on'
trigger: state
for:
hours: 0
minutes: 0
seconds: 5
conditions:
- condition: template
value_template: '{{ states(''input_boolean.goodnight'') == ''off'' and states(''group.trackers'')
== ''home'' }}'
actions:
- action: homeassistant.turn_on
entity_id:
- switch.living_room_speakers
- switch.tv
initial_state: true
- id: tv_off_with_xbox_off
alias: Turn off speakers when tv OR xbox powers off
triggers:
- entity_id:
- switch.tv
to: 'off'
trigger: state
for:
hours: 0
minutes: 0
seconds: 5
enabled: false
- entity_id:
- binary_sensor.xbox_power
to: 'off'
trigger: state
for:
hours: 0
minutes: 0
seconds: 30
conditions:
- condition: template
value_template: '{{ states(''input_boolean.goodnight'') == ''off'' and states(''group.trackers'')
== ''home'' }}'
actions:
- action: homeassistant.turn_off
entity_id:
- switch.living_room_speakers
- switch.tv
initial_state: true
- id: desk_lamp_macbook_active
alias: Desk Lamp on when MacBook Active
trigger:
- platform: state
entity_id: binary_sensor.weasel_active
to: 'on'
condition:
- condition: template
value_template: '{{ states(''person.andrew'') == ''home'' }}'
action:
- if:
- condition: template
value_template: '{{ states(''sun.sun'') == ''below_horizon'' or (states(''cover.office_blind_left'')
== ''closed'' and states(''cover.office_blind_right'') == ''closed'') }}'
then:
- action: homeassistant.turn_on
entity_id: light.andrew_desk_lamp
- action: homeassistant.turn_on
entity_id:
- switch.andrew_monitor
- media_player.kitchen_photo_frame
- media_player.office_photo_frame
- condition: time
after: 08:00:00
before: '21:00:00'
- action: input_boolean.turn_off
metadata: {}
data: {}
target:
entity_id: input_boolean.goodnight
initial_state: true
- alias: Desk Lamp and Monitor off
id: desk_lamp_and_monitor_off
initial_state: true
trigger:
- platform: state
entity_id: binary_sensor.weasel_active
to: 'off'
for: 00:30:00
- platform: state
entity_id: binary_sensor.andrew_phone_car_connected
to: 'on'
action:
- action: homeassistant.turn_off
entity_id: light.andrew_desk_lamp
- action: homeassistant.turn_off
entity_id: switch.andrew_monitor
- alias: Nexus off After Monitor
id: nexus_7_off_after_monitor
initial_state: true
trigger:
platform: state
entity_id: switch.andrew_monitor
to: 'off'
for: 00:00:30
action:
- action: homeassistant.turn_off
entity_id: switch.nexus_7_screen
- alias: Master Closet Light with Motion
id: closet_motion_light
trigger:
- platform: state
entity_id: binary_sensor.master_closet_motion_sensor
to: 'on'
mode: restart
action:
- action: homeassistant.turn_on
entity_id: switch.master_closet_light
- delay: 00:05:00
- action: homeassistant.turn_off
entity_id: switch.master_closet_light
- alias: Sensor Battery Alerts
id: sensor_battery_alert
trigger:
- platform: state
id: binary
from: 'off'
to: 'on'
entity_id:
- binary_sensor.flume_sensor_home_battery
- binary_sensor.compost_battery
- binary_sensor.433_weather_battery
- binary_sensor.deep_freeze_battery
- platform: numeric_state
id: value
entity_id:
- sensor.1_battery_level
- sensor.2_battery_level
- sensor.3_battery_level
- sensor.back_bedroom_remote_battery_level
- sensor.guest_bedroom_remote_battery_level
- sensor.front_door_battery
- sensor.back_door_battery
- sensor.garage_exterior_door_battery_level
- sensor.back_bathroom_toilet_water_detector_battery_level
- sensor.guest_bathroom_toilet_water_detector_battery_level
- sensor.master_bathroom_water_detector_battery_level
- sensor.kitchen_sink_water_detector_battery_level
- sensor.dishwasher_water_detector_battery_level
- sensor.motion_1_battery_level
- sensor.living_room_motion_battery_level
- sensor.hallway_motion_battery
- sensor.master_closet_motion_battery_level
- sensor.office_blind_left_battery
- sensor.office_blind_right_battery
- sensor.guest_bedroom_blind_left_battery
- sensor.guest_bedroom_blind_right_battery
- sensor.master_bedroom_blind_left_battery
- sensor.master_bedroom_blind_right_battery
- sensor.dining_room_blind_left_battery
- sensor.dining_room_blind_center_battery
- sensor.dining_room_blind_right_battery
- sensor.netatmo_home_attic_battery_percent
- sensor.meater_battery_level
below: 10
action:
- action: script.notify_wrapper
data:
message: "{% if trigger.id == \"value\" %}\n {{ trigger.to_state.name }} battery
level at {{ trigger.to_state.state }}%\n{% elif trigger.id == \"binary\" %}\n
\ {{ trigger.to_state.name }} battery level low!\n{% endif %}\n"
- alias: Update CloudFlare Firewall Rule
id: update_cloudflare_firewall_rule
trigger:
- platform: state
entity_id: sensor.myip
condition: '{{ trigger.to_state.state not in ["unknown","unavailable"] }}'
action:
- action: shell_command.update_cloudflare_firewall
data:
old: '{{ trigger.from_state.state }}'
new: '{{ trigger.to_state.state }}'
- alias: Disarm When Opening Garage
id: disarm_when_garage_opened
trigger:
- platform: event
event_type: call_service
event_data:
domain: cover
action: open_cover
service_data:
entity_id: cover.garage_door
action:
- action: input_boolean.turn_off
entity_id: input_boolean.security_status
- alias: Commit Frigate Config
id: commit_frigate_config
trigger:
platform: event
event_type: folder_watcher
event_data:
event_type: modified
file: config.yml
action:
- action: shell_command.commit_frigate_changes
- alias: Compost Turn Reset
id: compost_turn_reset
trigger:
- platform: state
entity_id: input_boolean.compost_turn
to: 'on'
action:
- delay: 00:01:00
- action: homeassistant.turn_off
entity_id: input_boolean.compost_turn
- alias: Internet Reachability GSM Alert
id: internet_gsm_alert
trigger:
- platform: state
entity_id: binary_sensor.internet_reachability
from: 'on'
to: 'off'
id: binary
- platform: state
entity_id: binary_sensor.internet_reachability
from: 'off'
to: 'on'
id: binary
- platform: state
id: gateway
entity_id: sensor.pfsense_gateway_wan_dhcp
from: 'True'
to: 'False'
- platform: state
id: gateway
entity_id: sensor.pfsense_gateway_wan_dhcp
from: 'False'
to: 'True'
action:
- if: '{{ trigger.id == ''binary'' }}'
then:
- action: notify.cellular_message
data:
message: '{% if trigger.from_state.state == "on" %} Home internet is down
{% else %} Home internet has recovered {% endif %}
'
data:
priority: '{% if now().hour > 9 and now().hour < 22 and is_state(''person.andrew'',
''home'') %}1{% else %}0{% endif %}'
- if: '{{ trigger.id == ''gateway'' }}'
then:
- action: notify.cellular_message
data:
message: '{% if trigger.from_state.state == "True" %} PFSense gateway down
{% else %} PFSense gateway has recovered {% endif %}
'
data:
priority: '{% if now().hour > 9 and now().hour < 22 and is_state(''person.andrew'',
''home'') %}1{% else %}0{% endif %}'
- id: webhook_debugger
alias: Webhook Debugger
trigger:
- platform: webhook
webhook_id: hihihi
local_only: false
action:
- action: persistent_notification.create
data:
message: "{% if 'data' in trigger %}\n Data: {{ dict(trigger.data)|tojson }}\n{%
elif 'json' in trigger %}\n JSON: {{ dict(trigger.json)|tojson }}\n{% else
%} {% endif %} {% if 'query' in trigger and trigger.query|length > 0 %}\n
\ Query: {{ dict(trigger.query)|tojson }}\n{% endif %}"
- id: bluebubbles_to_sms
alias: BlueBubbles to SMS
trigger:
- platform: webhook
webhook_id: hihihi
local_only: false
action:
- if: '{{ trigger.json.data.isFromMe == false and trigger.json.data.handle.address
!= ''+PHONE_NUMBER'' }}'
then:
- action: notify.donotreply_SECRET
data:
target: 5128798125@msg.fi.google.com
message: '{{ trigger.json.data.handle.address }}: {{ trigger.json.data.text
}}'
title: BlueBubbles FWD
- alias: Watchtower Updates
id: watchertower_run_update
trigger:
- platform: time
at: '15:00:00'
- platform: time
at: '20:00:00'
condition:
condition: and
conditions:
- condition: time
weekday:
- sun
- '{{ states(''person.andrew'') == ''home''}}'
action:
- action: homeassistant.turn_on
entity_id: switch.docker_watchtower
- id: update_utility_costs
alias: Update Utility Costs
trigger:
- platform: time_pattern
hours: /12
- platform: time
at: '23:59:30'
action:
- action: python_script.compute_utility_costs
data:
meter_entity: sensor.water_usage
alias: Water
- alias: Electricity
action: python_script.compute_utility_costs
data:
meter_entity: sensor.electricity_usage
mode: single
- id: reset_utility_meters
alias: Reset Utility Meters
trigger:
- platform: time
at: 00:00:00
enabled: true
condition:
- condition: template
value_template: '{{ now().day == 1 }}'
action:
- action: python_script.utility_meter_reset
data:
meter_entity: sensor.water_usage
cycle_reset_entity_id: sensor.utilities_cycle_end
- action: python_script.utility_meter_reset
data:
meter_entity: sensor.electricity_usage
cycle_reset_entity_id: sensor.utilities_cycle_end
- alias: Update USPS Mail Camera Path on Hass Restart
id: usps_mail_path_update
trigger:
- platform: state
entity_id: sensor.mail_updated
- platform: homeassistant
event: start
action:
- action: local_file.update_file_path
data_template:
entity_id: camera.mail_usps
file_path: '{{ states(''sensor.mail_image_system_path'') }}'
- alias: Fingerprint Door Unlock
id: fingerprint_door_unlock
trigger:
platform: state
entity_id: sensor.fingerprint_state
to: Authorized finger
condition: '{{ states(''sensor.fingerprint_last_finger_id'') in [''1'',''2''] }}'
action:
- action: lock.unlock
entity_id: lock.back_door
- action: script.notify_wrapper
data:
message: Front door unlocked by {% if states('sensor.fingerprint_last_finger_id')
== '1' %}Andrew right index{% elif states('sensor.fingerprint_last_finger_id')
== '2' %}Andrew left index{% else %}Unknown{% endif %}!
- alias: Signal Webhook Message BVST
id: signal_webhook_message_bvst
mode: queued
initial_state: true
trigger:
- platform: webhook
webhook_id: SECRET
id: contact
local_only: false
- platform: webhook
webhook_id: SECRET
id: insurance
local_only: false
action:
- if: '{{ trigger.id == ''contact'' }}'
then:
- action: notify.signal_bvst
data:
message: '{{ trigger.json[''message''] }}'
- if: '{{ trigger.id == ''insurance'' }}'
then:
- action: notify.signal_bvst_ins
data:
message: '{{ trigger.json[''message''] }}'
- alias: Restart AppDaemon
id: restart_appdaemon
trigger:
platform: time
at: 01:30:00
action:
- action: switch.turn_off
entity_id: switch.docker_appdaemon
- delay: 00:00:30
- action: switch.turn_on
entity_id: switch.docker_appdaemon
- alias: Restart cellular_message_relay_sim7080g
id: restart_cellular_message_relay_sim7080g
trigger:
platform: time
at: 01:35:00
action:
- action: switch.turn_off
entity_id: switch.docker_cellular_message_relay_sim7080g
- delay: 00:00:45
- action: switch.turn_on
entity_id: switch.docker_cellular_message_relay_sim7080g
- alias: Deep Freeze Temperature
id: deep_freeze_temperature
initial_state: true
trigger:
platform: numeric_state
entity_id:
- sensor.deep_freeze_temperature
above: 25
for:
minutes: 10
action:
- action: script.notify_wrapper
data:
message: The deep freeze has been above 25°F for 10 minutes and is currently
{{ trigger.to_state.state }}°F
data:
priority: 2
- alias: Garage Fan
id: garage_fan
initial_state: true
trigger:
platform: state
entity_id: cover.garage_door
to:
- open
- closed
action:
- action: "{% if trigger.from_state.state == \"closed\" and trigger.to_state.state
== \"open\" %}\n switch.turn_on\n{% elif trigger.from_state.state == \"open\"
and trigger.to_state.state == \"closed\" %}\n switch.turn_off\n{% endif %}\n"
entity_id: switch.garage_fan
- alias: Door Chime
id: door_chime
initial_state: true
trigger:
- platform: state
entity_id:
- cover.garage_door
from: closed
to: open
condition: '{{ states(''group.trackers'') == ''home''}}'
action:
- action: notify.alexa_media_kitchen
data:
data:
type: tts
method: speak
message: <audio src="soundbank://soundlibrary/alarms/beeps_and_bloops/bell_02"/>
- alias: Startup Notificiation
id: startup_notification
initial_state: true
trigger:
- platform: homeassistant
event: start
action:
- action: notify.signal_self
data:
message: 'Home Assistant v{{ states(''sensor.ha_version'')}} has started!
'
- id: coffee_maker_alarm_clock
alias: Coffee Maker on With Alarm Clock
trigger:
- platform: state
entity_id: sensor.andrew_phone_last_notification
attribute: channel_id
to: Firing
id: alarm
alias: Phone Alarm
- platform: event
id: respond
event_type: mobile_app_notification_action
event_data:
action: confirm_coffee_on
alias: Mobile Notification Response
- alias: Mobile Notification Response
platform: event
id: make
event_type: mobile_app_notification_action
event_data:
action: confirm_make_latte
condition:
- condition: and
conditions:
- condition: template
value_template: '{{ states(''binary_sensor.workday_sensor'') == ''on'' }}'
alias: Workday?
enabled: false
- condition: time
after: 05:30:00
before: '10:00:00'
enabled: true
alias: Morning?
- condition: template
value_template: '{{ states(''person.andrew'') == ''home'' }}'
alias: Andrew Home?
action:
- if:
- condition: trigger
id:
- alarm
then:
- wait_template: '{{ is_state(''sensor.andrew_phone_charger_type'', ''none'')
}}'
timeout: 00:05:00
- action: notify.mobile_app_andrew_phone
data:
message: Turn on Coffee Maker?
data:
persistent: true
tag: persistent
actions:
- action: confirm_coffee_on
title: 'Yes'
- action: ignore_coffee_on
title: 'No'
alias: Send Notification
- alias: Turn on Coffee Maker
if:
- condition: trigger
id:
- respond
then:
- action: switch.turn_on
data: {}
target:
entity_id: switch.coffee_maker_power_with_cleaning
alias: Turn on Coffee Maker
- wait_for_trigger:
- platform: state
entity_id:
- sensor.coffee_maker_status
to: Idle
for:
hours: 0
minutes: 1
seconds: 0
timeout:
hours: 0
minutes: 2
seconds: 0
milliseconds: 0
alias: Wait For Idle Status
- action: notify.mobile_app_andrew_phone
data:
message: Make Double Latte?
data:
persistent: true
tag: persistent
actions:
- action: confirm_make_latte
title: 'Yes'
- action: ignore_make_latte
title: 'No'
alias: Send Make Late Question
- alias: Make Double Latte
if:
- condition: trigger
id:
- make
then:
- action: script.andrew_double_latte
data: {}
initial_state: true
- id: coffee_maker_off
alias: Coffee Maker Off
trigger:
- platform: time
at: '10:00:00'
condition:
- condition: template
value_template: '{{ states(''switch.coffee_maker'') == ''on'' }}'
action:
- action: switch.turn_off
data: {}
target:
entity_id: switch.coffee_maker_power_without_cleaning
- action: notify.signal_homeassistant
data:
message: 'Turned coffee maker off!
'
initial_state: true
- alias: Turn off AC Fan
id: turn_off_ac_fan
trigger:
- platform: state
entity_id: sensor.thermostat_state
to: Idle Fan
for:
minutes: 30
action:
- action: script.notify_wrapper
data:
message: AC fan on idle for 30 minutes, setting back to auto
- action: climate.set_fan_mode
entity_id: climate.thermostat
data:
fan_mode: auto
- alias: Plant Light Corner Brightness
id: plant_corner_brightness
trigger:
- platform: state
entity_id: light.plant_light_corner
to: 'on'
for: 00:00:10
action:
- repeat:
count: 3
sequence:
- action: light.turn_on
entity_id: light.plant_light_corner
data:
brightness: 255
- delay: 00:00:05
- alias: Rain Notifications
id: rain_notifications
mode: restart
trigger:
- platform: state
entity_id: sensor.neighbor_5in1_rain_last_1_hour
from:
- unknown
- unavailable
- '0.0'
- '0.00'
- '0'
action:
- if:
- '{{ float(trigger.to_state.state, default=-1) > 0.00 }}'
then:
- action: notify.signal_homeassistant