forked from sfgabe/home_assistant
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathautomations.yaml
executable file
·3650 lines (3431 loc) · 101 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
- alias: Backup HA Configuration Files
id: backup_config_files
trigger:
platform: time_pattern
hours: 1
minutes: 1
seconds: 0
condition:
condition: time
weekday:
- wed
action:
- service: shell_command.backup_configuration
#Set Theme
- alias: 'Set Theme to Midnight'
initial_state: 'on'
trigger:
- platform: homeassistant
event: start
action:
- service: frontend.set_theme
data:
name: midnight
- alias: Occupancy On
trigger:
- platform: state
entity_id: binary_sensor.people_home
from: "off"
to: "on"
action:
- service: input_boolean.turn_on
data:
entity_id: input_boolean.occupancy
- alias: Occupancy Off
trigger:
- platform: state
entity_id: binary_sensor.people_home
from: "on"
to: "off"
action:
- service: input_boolean.turn_off
data:
entity_id: input_boolean.occupancy
- alias: Turn Off Lights on Leaving Home Zone
id: gabe_out_of_home_zone_lights_off
trigger:
# - platform: state
# entity_id: device_tracker.huawei_mate_9_92528f2b1a5
# from: 'home'
# to: 'not_home'
- platform: state
entity_id: binary_sensor.people_home
from: 'on'
to: 'off'
for:
hours: 0
minutes: 15
seconds: 0
- platform: numeric_state
entity_id: sensor.home_occupancy_confidence
below: 51
for:
hours: 0
minutes: 15
seconds: 0
action:
- service: light.turn_off
entity_id:
- light.bedroom_desk
- light.bed_light
- light.desk
- light.entry_light
- light.kitchen
- light.kitchen_2
- light.table
- light.big_o
- light.et_figure
- service: media_player.media_pause
entity_id: media_player.gabes_music_server
- service: media_player.turn_off
entity_id: media_player.volumio_mpd
- service: browser_mod.navigate
data:
navigation_path: /lovelace/15
deviceID:
- browser_note_kiosk
# - service: input_select.select_option
# data_template:
# entity_id: input_select.alexa_bedroom_ac
# option: "85"
# - service: input_select.select_option
# data_template:
# entity_id: input_select.alexa_livingroom_ac
# option: "85"
- alias: Turn On Lights on Enter Home Zone
id: gabe_arrive_in_home_zone_lights_on
trigger:
- platform: state
entity_id: binary_sensor.people_home
from: 'off'
to: 'on'
action:
- service: light.turn_on
entity_id: light.entry_light
# - service: climate.set_temperature
# data:
# entity_id: climate.bedroom_therm
# temperature: 74
# - service: climate.set_temperature
# data:
# entity_id: climate.living_room_therm
# temperature: 75
- service: script.turn_on
entity_id: script.welcome_lights_on
- alias: Welcome on Enter Home Zone
id: gabe_arrive_in_home_zone_welcome
trigger:
- platform: state
entity_id: binary_sensor.people_home
to: 'on'
# condition:
# - condition: state
# entity_id: input_select.gabe_status_dropdown
# state: "Just Arrived"
# condition: template
# value_template: '{{ as_timestamp(now()) - as_timestamp(states.automation.gabe_arrive_in_home_zone_welcome.attributes.last_triggered) | int > 10800 }}'
action:
- delay: '00:05:00'
- service: script.turn_on
entity_id: script.thundercloud_celebrate
- service: rest_command.kiosk_sound_welcome
- service: media_player.play_media
data:
entity_id: media_player.gabe_s_alexa
media_content_type: sound
media_content_id: amzn_sfx_trumpet_bugle_04
- delay: '00:00:10'
- service: script.janet_speech_engine
data:
call_greeting_gabe: 1
- service: light.turn_on
entity_id: light.et_figure
- delay: '00:05:00'
- service: light.turn_off
entity_id: light.et_figure
- alias: Mom welcome
id: mom_arrive_in_home_zone_welcome
trigger:
- platform: zone
entity_id: person.berny
zone: zone.home
event: enter
# condition:
# condition: template
# value_template: '{{ as_timestamp(now()) - as_timestamp(states.automation.mom_arrive_in_home_zone_welcome.attributes.last_triggered) | int > 10800 }}'
action:
- delay: '00:02:30'
- service: script.janet_speech_engine
data:
call_greeting_berny: 1
- service: script.turn_on
entity_id: script.thundercloud_celebrate
- service: light.turn_on
entity_id: light.et_figure
- delay: '00:05:00'
- service: light.turn_off
entity_id: light.et_figure
- alias: Aaron welcome
id: aaron_arrive_in_home_zone_welcome
trigger:
- platform: zone
entity_id: device_tracker.magickal_guy
zone: zone.home
event: enter
action:
- delay: '00:02:30'
- service: script.janet_speech_engine
data:
call_introduction: 1
call_greeting_aaron: 1
- service: script.turn_on
entity_id: script.thundercloud_celebrate
- service: light.turn_on
entity_id: light.et_figure
- delay: '00:05:00'
- service: light.turn_off
entity_id: light.et_figure
#Morning Greeting
- alias: 'Morning Greeting'
id: morning_greeting_update
trigger:
platform: state
entity_id: input_boolean.bed_occupancy
from: 'on'
to: 'off'
condition:
condition: and
conditions:
- condition: time
before: '10:30:00'
after: '07:30:00'
- condition: state
entity_id: input_boolean.alarm_went_off
state: 'on'
- condition: template
value_template: '{{ as_timestamp(now()) - as_timestamp(states.automation.morning_greeting.attributes.last_triggered) | int > 10800 }}'
action:
- service: script.turn_on
entity_id: script.kiosk_good_morning
#Download News once a day
#- alias: 'download_npr_news'
# trigger:
# - platform: time
# at: '06:16:00'
# action:
# - service: downloader.download_file
# data_template:
# url: "{{ states('sensor.npr_news_mp3_link') }}"
# filename: "npr_news.mp3"
# overwrite: true
#Dim Kiosk with light
- alias: 'Dim Kiosk Screen'
id: dim_kiosk_screen
trigger:
platform: state
entity_id: light.entry_light
from: 'on'
to: 'off'
action:
- service: rest_command.kiosk_screen_dim
#Bright Kiosk with light
- alias: 'Brighten Kiosk Screen'
id: brihten_kiosk_screen
trigger:
platform: state
entity_id: light.entry_light
from: 'off'
to: 'on'
action:
- service: rest_command.kiosk_screen_mid
- alias: Turn off kiosk charger
trigger:
platform: template
value_template: "{{ 80 < states.binary_sensor.browser_note_kiosk.attributes.battery_level }}"
action:
service: switch.turn_off
entity_id: switch.2437254184f3eb69e784
- alias: Turn on kiosk charger
trigger:
platform: template
value_template: "{{ 20 > states.binary_sensor.browser_note_kiosk.attributes.battery_level }}"
action:
service: switch.turn_on
entity_id: switch.2437254184f3eb69e784
#- alias: Home Assistant Start
# trigger:
# platform: homeassistant
# event: start
# action:
# - delay: '00:00:10'
# - service: notify.kiosk
# data:
# message: 'Home Assistant has started'
- alias: Start Up
trigger:
- event: start
platform: homeassistant
action:
- delay: '00:00:10'
- service: media_player.play_media
data:
entity_id: media_player.volumio_mpd
media_content_id: 'REMOTEURL/sounds/battle.mp3'
media_content_type: 'music'
- delay: '00:00:01'
- service: notify.html5_push
data:
data:
renotify: 1
icon: REMOTEURL/icons/smarthome.png
badge: REMOTEURL/icons/badge_smarthome.png
timestamp: '%m'
url: https://thisisgabes.asuscomm.com:8008
vibrate: 700, 700, 700
message: "Home Assistant restarted at {{ as_timestamp(now()) | timestamp_custom('%H:%M', true) }}"
title: "Hello World!"
target:
- "Gabes Mate"
- "Macbook"
- delay:
seconds: 6
- service: script.janet_speech_engine
data:
call_greeting: 1
- delay:
seconds: 5
- service: script.janet_speech_engine
data:
call_introduction: 1
- delay:
seconds: 10
- service: alexa_media.update_last_called
- delay:
seconds: 5
- service: notify.alexa_media
data:
data:
type: tts
target:
- media_player.gabe_s_alexa
message: 'Alexa Tee Tee Ess is Connected'
#Birdfeed
- id: birdfeed_audio
alias: birdfeed_audio
initial_state: true
trigger:
- entity_id: media_player.mpd
platform: state
to: "playing"
action:
service: mqtt.publish
data_template:
topic: 'birdfeed/reading'
payload_template: "{{ states.media_player.mpd.attributes['media_content_id']}}"
#SSL Expiry
- alias: ssl_expiry_notify
trigger:
platform: numeric_state
entity_id: sensor.ssl_certificate_expiry
below: 2
condition:
condition: time
after: '13:00:00'
action:
- service: notify.html5_push
data:
data:
renotify: 1
icon: REMOTEURL/icons/ssl.png
badge: REMOTEURL/icons/badge_calendar.png
timestamp: '%m'
url: https://thisisgabes.asuscomm.com:8008/lovelace/10
vibrate: 700, 700, 700
message: "Your SSL cert expires in {{ states.sensor.ssl_certificate_expiry.state }} days."
title: "Beep! Boop!"
target:
- "Gabes Mate"
- "Macbook"
- service: script.janet_speech_engine
data:
message: "Hey Gabe, I just want to let you know that your website SSL certificate expires in {{ states.sensor.ssl_certificate_expiry.state }} days. You have instructions on how to renew it saved in your evernote app."
- service: persistent_notification.create
data:
message: "Your SSL cert expires in {{ states.sensor.ssl_certificate_expiry.state }} days."
title: "Beep! Boop!"
- alias: Set Harmony activity
trigger:
platform: state
entity_id: input_select.harmony
action:
service: remote.turn_on
entity_id: remote.gabes_harmony_hub
data_template:
activity: >
{% if is_state("input_select.harmony", "Speaker") %}
29883813
{% elif is_state("input_select.harmony", "Fishtank Evening") %}
25723108
{% elif is_state("input_select.harmony", "Watch Roku") %}
26106880
{% elif is_state("input_select.harmony", "Watch a Movie") %}
26106724
{% elif is_state("input_select.harmony", "Fishtank Morning") %}
25723061
{% else %}
-1
{% endif %}
# This next automation is to update the input_select when the Harmony's
# activity was changed from somewhere else, e.g. using its physical remote.
- alias: Update Harmony input_select
trigger:
platform: state
entity_id: remote.gabes_harmony_hub
action:
service: input_select.select_option
data_template:
entity_id: input_select.harmony
option: "{{ states.remote.harmony_hub.attributes.current_activity }}"
## Reef Tides Wavemaker
- alias: Turn on Wavemaker at high tide
trigger:
platform: template
value_template: '{{ strptime(states.sensor.time_utc.state , "%H:%M") == strptime(states.sensor.reef_time_high_tide.state , "%H:%M") }}'
action:
service: switch.turn_on
entity_id: switch.06200940dc4f22cbb94b_2
- alias: Turn off Wavemaker at low tide
trigger:
platform: template
value_template: '{{ strptime(states.sensor.time_utc.state , "%H:%M") == strptime(states.sensor.reef_time_low_tide.state , "%H:%M") }}'
action:
service: script.turn_on
entity_id: script.reef_waves_lowtide_fade_script
## Amazon Tides Wavemaker
- alias: Turn on Amazon Waves at high tide
trigger:
platform: template
value_template: '{{ strptime(states.sensor.time.state , "%k:%M") == strptime(states.sensor.amazonnexthightide.state , "%k:%M") }}'
action:
service: script.turn_on
entity_id: script.freshwater_waves_on_script
- alias: Turn on Amazon Waves again at low tide
trigger:
platform: template
value_template: '{{ strptime(states.sensor.time.state , "%k:%M") == strptime(states.sensor.amazonnextlowtide.state , "%k:%M") }}'
action:
service: script.turn_on
entity_id: script.freshwater_waves_on_script
#Sunrise Sunset on Reef Tank Diurnal Phasing
- alias: Set sunrise and set with reef-pi
trigger:
platform: time
at: '04:15:00'
action:
- service: rest_command.set_diurnal_reef_lights
- alias: Turn Off Reef Lights Outlet at Sunset
trigger:
platform: template
value_template: "{{ strptime(states.sensor.time.state , '%k:%M') == strptime(states.sensor.reeftime_sunset_adjustment.state , '%k:%M') }}"
action:
- service: script.turn_on
entity_id: script.reeftank_evening_outlet_kessil
- alias: Turn On Reef Lights Outlet at Sunrise
trigger:
platform: template
value_template: "{{ strptime(states.sensor.time.state , '%H:%M') == strptime(states.sensor.reeftime_sunrise_adjustment.state , '%H:%M') }}"
action:
- service: script.turn_on
entity_id: script.reeftank_morning_outlet_kessil
- alias: Kessil Color
trigger:
platform: state
entity_id: input_number.kessil_color
condition:
condition: template
value_template: "{{ trigger.to_state.state != trigger.from_state.state }}"
action:
service: switch.turn_on
entity_id: switch.kessil_color_level
- alias: Kessil Brightness
trigger:
platform: state
entity_id: input_number.kessil_brightness
condition:
condition: template
value_template: "{{ trigger.to_state.state != trigger.from_state.state }}"
action:
service: switch.turn_on
entity_id: switch.kessil_brightness_level
- alias: Garden Brightness
trigger:
platform: state
entity_id: input_number.garden_brightness
condition:
condition: template
value_template: "{{ trigger.to_state.state != trigger.from_state.state }}"
action:
service: switch.turn_on
entity_id: switch.garden_brightness_level
#Moonrise Moonset on Tanks
- alias: Stop Reef Moon
trigger:
platform: template
value_template: "{{ strptime(states.sensor.time.state , '%H:%M') == strptime(states.sensor.reeftime_sunrise_adjustment.state , '%H:%M') }}"
condition:
condition: numeric_state
entity_id: sensor.reef_weather_moon_phase_0d
above: .35
below: .65
action:
- service: script.turn_on
entity_id: script.reeftank_moon_off
- alias: Start Reef Moon
trigger:
platform: template
value_template: "{{ strptime(states.sensor.time.state , '%k:%M') == strptime(states.sensor.reeftime_sunset_adjustment.state , '%k:%M') }}"
condition:
condition: or
conditions:
- condition: numeric_state
entity_id: sensor.reef_weather_moon_phase_0d
above: .38
below: .48
- condition: numeric_state
entity_id: sensor.reef_weather_moon_phase_0d
above: .53
below: .63
action:
- service: script.turn_on
entity_id: script.reeftank_moon_on
- service: script.turn_on
entity_id: script.reeftank_moon_up
- alias: Stronger Fade Up of Reef Moon
trigger:
platform: template
value_template: "{{ strptime(states.sensor.time.state , '%k:%M') == strptime(states.sensor.reeftime_sunset_adjustment.state , '%k:%M') }}"
condition:
condition: or
conditions:
- condition: numeric_state
entity_id: sensor.reef_weather_moon_phase_0d
above: .48
below: .49
- condition: numeric_state
entity_id: sensor.reef_weather_moon_phase_0d
above: .51
below: .53
action:
- service: script.turn_on
entity_id: script.reeftank_moon_on
- service: script.turn_on
entity_id: script.reeftank_moon_up_stronger
- alias: Reef Full Moon
trigger:
platform: template
value_template: "{{ strptime(states.sensor.time.state , '%k:%M') == strptime(states.sensor.reeftime_sunset_adjustment.state , '%k:%M') }}"
condition:
condition: numeric_state
entity_id: sensor.reef_weather_moon_phase_0d
above: .49
below: .51
action:
- service: script.turn_on
entity_id: script.reeftank_moon_on
- service: script.turn_on
entity_id: script.reeftank_full_moon
- alias: Freshwater Lights and O2 On at Sunrise
trigger:
platform: template
value_template: "{{ strptime(states.sensor.time.state , '%H:%M') == strptime(states.sensor.amazonsunrisetides.state , '%H:%M') }}"
action:
- service: script.turn_on
entity_id: script.octotank_morning_on
- alias: Freshwater Lights and O2 Off at Sunset
trigger:
platform: template
value_template: "{{ strptime(states.sensor.time.state , '%H:%M') == strptime(states.sensor.amazonsunsettides.state , '%H:%M') }}"
action:
- service: script.turn_on
entity_id: script.octotank_evening_off
# Amazon Feeder
- alias: Activate Feeder Script Morning
trigger:
platform: time
at: '09:15:00'
action:
- service: script.turn_on
entity_id: script.freshwater_feeder_script
#- alias: Activate Feeder Script MidDay
# trigger:
# platform: time
# at: '12:15:00'
# action:
# - service: script.turn_on
# entity_id: script.freshwater_feeder_script
- alias: Activate Feeder Script Afternoon
trigger:
platform: time
at: '17:30:00'
action:
- service: script.turn_on
entity_id: script.freshwater_feeder_script
## Amazon Temp Regulation
# This automation script runs when a value is received via Amazon sensor: monthly_amazon_temp
- alias: Set Amazon Thermostat Max Daytime Selector
trigger:
platform: template
#summer temp
# value_template: "{{ states.sensor.monthly_amazon_temp_lowmed.state != states.climate.octo_tank_therm.attributes.temperature.state }}"
#winter temp
value_template: "{{ states.sensor.monthly_amazon_temp_med.state != states.climate.octo_tank_therm.attributes.temperature.state }}"
condition:
condition: state
entity_id: switch.06200940dc4f22cbb432_4
state: 'on'
action:
service: climate.set_temperature
data_template:
entity_id: climate.octo_tank_therm
#summer temp
# temperature: '{{ states.sensor.monthly_amazon_temp_lowmed.state | float }}'
#winter temp
temperature: '{{ states.sensor.monthly_amazon_temp_med.state | float }}'
# This automation script runs when a value is received via Amazon sensor: monthly_amazon_temp
- alias: Set Amazon Thermostat Max Night Selector
trigger:
platform: template
#summer temp
# value_template: "{{ states.sensor.monthly_amazon_temp_min.state != states.climate.octo_tank_therm.attributes.temperature.state }}"
#winter temp
value_template: "{{ states.sensor.monthly_amazon_temp_lowmed.state != states.climate.octo_tank_therm.attributes.temperature.state }}"
condition:
condition: state
entity_id: switch.06200940dc4f22cbb432_4
state: 'off'
action:
service: climate.set_temperature
data_template:
entity_id: climate.octo_tank_therm
#summer temp
# temperature: '{{ states.sensor.monthly_amazon_temp_min.state | float }}'
#winter temp
temperature: '{{ states.sensor.monthly_amazon_temp_lowmed.state | float }}'
# This automation script runs when a value is received via Reef sensor: reef_low_avg_daily_temp
- alias: Set Reef Thermostat Max Daytime Selector
trigger:
platform: template
#summer temp
# value_template: "{{ states.sensor.reef_high_avg_daily_temp.state != states.climate.reef_tank_therm.attributes.temperature.state }}"
#winter temp
value_template: "{{ states.sensor.noaa_daily_max_reef_temp.state != states.climate.reef_tank_therm.attributes.temperature.state }}"
condition:
condition: state
entity_id: input_boolean.reef_temp_daytime_state
state: 'on'
action:
service: climate.set_temperature
data_template:
entity_id: climate.reef_tank_therm
#summer temp
# temperature: '{{ states.sensor.reef_high_avg_daily_temp.state | float }}'
#winter temp
temperature: '{{ states.sensor.noaa_daily_max_reef_temp.state | float }}'
# This automation script runs when a value is received via Reef sensor: noaa_daily_min_reef_temp
- alias: Set Reef Thermostat Max Nighttime Selector
trigger:
platform: template
#summer temp
# value_template: "{{ states.sensor.noaa_daily_min_reef_temp.state != states.climate.reef_tank_therm.attributes.temperature.state }}"
#winter temp
value_template: "{{ states.sensor.reef_low_avg_daily_temp.state != states.climate.reef_tank_therm.attributes.temperature.state }}"
condition:
condition: state
entity_id: input_boolean.reef_temp_nightime_state
state: 'on'
action:
service: climate.set_temperature
data_template:
entity_id: climate.reef_tank_therm
#summer temp
# temperature: '{{ states.sensor.noaa_daily_min_reef_temp.state | float }}'
#winter temp
temperature: '{{ states.sensor.reef_low_avg_daily_temp.state | float }}'
- alias: Regulate Reef Heater To Off on Low Misread
trigger:
platform: template
value_template: '{{ 32 == states.sensor.onlyreefcontrolpitemp.state }}'
action:
service: switch.turn_off
entity_id: switch.06200940dc4f22cbb94b_3
- alias: Nightly Top OffOn
trigger:
- platform: time
at: '23:24:00'
action:
service: switch.turn_on
entity_id: switch.ato_scheduled
- alias: Nightly Top OffOff
trigger:
- platform: time
at: '23:26:00'
action:
service: switch.turn_off
entity_id: switch.ato_scheduled
- alias: Nightly Doser On
trigger:
- platform: time
at: '23:12:00'
action:
service: switch.turn_on
entity_id: switch.doser_scheduled
- alias: Nightly Doser Off
trigger:
- platform: time
at: '23:16:00'
action:
service: switch.turn_off
entity_id: switch.doser_scheduled
#Turn on sump pump every 20 min
#- alias: Reef Sump Pump On Every Hour
# trigger:
# - platform: time_pattern
# minutes: '/20'
# condition:
# condition: state
# entity_id: sensor.reefcontrolpifloat
# state: 'OK'
# action:
# service: switch.turn_on
# entity_id: switch.2437254184f3eb695276
#Update Reef temps once a day
- alias: 'download_noaa_temps'
trigger:
- platform: time
at: '01:16:00'
action:
- service: downloader.download_file
data_template:
url: "https://coralreefwatch.noaa.gov/vs/data/great_nicobar.txt"
filename: "east_java_bali.txt"
overwrite: true
#Turn on sump pump every 3 min
- alias: Reef Sump Pulse
trigger:
- platform: time_pattern
minutes: '/4'
condition:
condition: state
entity_id: sensor.reefcontrolpifloat
state: 'OK'
action:
service: script.turn_on
entity_id: script.reeftank_sump_pulse
#Turn sump pump off on low
- alias: Reef Sump Pump Low Off
trigger:
platform: state
entity_id: sensor.reefcontrolpifloat
from: 'OK'
to: 'Low'
action:
service: switch.turn_off
entity_id: switch.2437254184f3eb695276
#Turn sump pump off on low timer
- alias: Reef Sump Pump Low Timer
trigger:
platform: state
entity_id: sensor.reefcontrolpifloat
to: 'Low'
for:
minutes: 5
action:
service: switch.turn_off
entity_id: switch.2437254184f3eb695276
#Alert if plants need water
- alias: ferns_needs_water
trigger:
platform: state
entity_id: binary_sensor.water_plant_alarm_ferns
to: 'on'
for:
minutes: 10
condition:
condition: and
conditions:
- condition: time
before: '22:30:00'
after: '09:30:00'
- condition: template
value_template: '{{ as_timestamp(now()) - as_timestamp(states.automation.ferns_needs_water.attributes.last_triggered) | int > 43200 }}'
action:
- service: notify.html5_push
data:
data:
renotify: 1
icon: REMOTEURL/icons/plant.png
badge: REMOTEURL/icons/badge_plant.png
timestamp: '%m'
url: https://thisisgabes.asuscomm.com:8008/lovelace/6
vibrate: 700, 700, 700
message: "Your bedroom ferns need water. Soil moisture is currently at {{ states.sensor.plant_monitor_soil_moisture.state }}%"
title: "I'm thirsty!"
target:
- "Gabes Mate"
- "Macbook"
# - service: ifttt.trigger
# data_template: {"event":"plant_needs_water", "value1":"Bedroom Ferns", "value2":"{{ states.sensor.plant_monitor_soil_moisture.state }}"}
- service: persistent_notification.create
data:
message: "Your bedroom ferns need water. Soil moisture is currently at {{ states.sensor.plant_monitor_soil_moisture.state }}%"
title: "Bedroom Ferns Water Alert!"
- service: script.janet_speech_engine
data:
call_plant_alert: 1
call_bedroom_plant_warning: 1
- alias: plant_needs_water
trigger:
platform: numeric_state
entity_id: sensor.garden_monitor_soil_moisture
below: 10
condition:
condition: and
conditions:
- condition: time
before: '22:30:00'
after: '09:30:00'
- condition: template
value_template: '{{ as_timestamp(now()) - as_timestamp(states.automation.plant_needs_water.attributes.last_triggered) | int > 43200 }}'
action:
- service: notify.html5_push
data:
data:
renotify: 1
icon: REMOTEURL/icons/plant.png
badge: REMOTEURL/icons/badge_plant.png
timestamp: '%m'
url: https://thisisgabes.asuscomm.com:8008/lovelace/6
vibrate: 700, 700, 700
message: "Your herb garden needs water. Soil moisture is currently at {{ states.sensor.garden_monitor_soil_moisture.state }}%"
title: "I'm thirsty!"
target:
- "Gabes Mate"
- "Macbook"
# - service: ifttt.trigger
# data_template: {"event":"plant_needs_water", "value1":"Hydroponic Garden", "value2":"{{ states.sensor.garden_monitor_soil_moisture.state }}"}
- service: persistent_notification.create
data:
message: "Your herb garden needs water. Soil moisture is currently at {{ states.sensor.garden_monitor_soil_moisture.state }}%"
title: "Hydroponic Garden Water Alert!"
- alias: empty_garden_drain
trigger:
platform: state
entity_id: binary_sensor.water_alarm_garden_res
to: 'on'
for:
minutes: 10
condition:
condition: and
conditions:
- condition: time
before: '22:30:00'
after: '09:30:00'
- condition: template
value_template: '{{ as_timestamp(now()) - as_timestamp(states.automation.empty_garden_drain.attributes.last_triggered) | int > 43200 }}'
action:
- service: notify.html5_push
data:
data:
renotify: 1
icon: REMOTEURL/icons/plant.png
badge: REMOTEURL/icons/badge_pipe.png
timestamp: '%m'
url: https://thisisgabes.asuscomm.com:8008/lovelace/6
vibrate: 700, 700, 700
message: "Empty the drainage reservoir soon. It is currently at {{ states.sensor.garden_monitor_water_level.state }}%"
title: "Empty me!"
target:
- "Gabes Mate"
- "Macbook"
# - service: ifttt.trigger
# data_template: {"event":"empty_garden_drain", "value1":"Hydroponic Garden", "value2":"{{ states.sensor.garden_monitor_water_level.state }}"}
- service: persistent_notification.create
data:
message: "Empty the drainage reservoir soon. It is currently at {{ states.sensor.garden_monitor_water_level.state }}%"
title: "Hydroponic Garden Reservoir Alert!"
## Alert if Garden Bot is down
- alias: garden_bot_alert
trigger:
platform: state
entity_id: device_tracker.octocam
condition:
- condition: template
value_template: "{{ trigger.to_state.state != trigger.from_state.state }}"
action:
- service: ifttt.trigger
data_template: {"event":"change_of_ip", "value1":"GardenBot changed state to {{ states.device_tracker.octocam.state }}"}
#Alert if public IP Changes
- alias: ip_change_alert
trigger:
platform: state
entity_id: sensor.ip_address
condition:
- condition: template
value_template: "{{ trigger.to_state.state != trigger.from_state.state }}"
action:
- service: ifttt.trigger
data_template: {"event":"change_of_ip", "value1":"{{ states.sensor.ip_address.state }}"}
#Text Message if theres mail
- alias: usps_mail_alert
trigger:
platform: zone
entity_id: device_tracker.huawei_mate_9_92528f2b1a5
zone: zone.home
event: enter
condition:
condition: or
conditions:
- condition: numeric_state
entity_id: sensor.usps_mail
above: '0'
- condition: numeric_state
entity_id: sensor.usps_packages
above: '0'
action:
- service: script.turn_on
entity_id: script.usps_sms_notification
#Text Message if there's mail refresher on
- alias: usps_mail_alert_automation_on
trigger:
- platform: numeric_state
entity_id: sensor.usps_mail
above: '0'
- platform: numeric_state
entity_id: sensor.usps_packages
above: '0'
action:
- service: automation.turn_on
entity_id: automation.usps_mail_alert
#Text Message if there's mail refresher off
- alias: usps_mail_alert_automation_off
trigger:
- platform: numeric_state
entity_id: sensor.usps_mail
below: '1'
action:
- service: automation.turn_off
entity_id: automation.usps_mail_alert
#3d Printer Finished Alert
- alias: octoprint_finished
trigger:
platform: numeric_state
entity_id: sensor.octoprint_job_percentage
above: 96
condition:
condition: and
conditions:
- condition: time
before: '22:30:00'
after: '09:30:00'
- condition: template
value_template: '{{ as_timestamp(now()) - as_timestamp(states.automation.octoprint_finished.attributes.last_triggered) | int > 3000 }}'
action:
- service: camera.snapshot
data:
entity_id: camera.octopi3dprinter
filename: '/www/snapshots/3dprinter_{{ now().strftime("%Y%m%d-%H") }}.jpg'
- service: notify.html5_push
data:
data: