-
Notifications
You must be signed in to change notification settings - Fork 12
/
other_automations.yaml
executable file
·1009 lines (940 loc) · 28.3 KB
/
other_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: bike_day
alias: 'Bike Day'
initial_state: 'true'
trigger:
platform: time
at: '11:00:00'
condition:
- condition: and
conditions:
- condition: state
entity_id: 'sensor.bike_day'
state: 'yes'
- condition: template
value_template: "{{ not is_state('sensor.sean_location', 'Traveling') }}"
- condition: time
weekday:
- mon
- tue
- wed
- thu
- fri
action:
service: notify.mobile_app_sean_s_iphone_x
data:
title: "Bike Day"
message: "It's a good day to ride your bike to work today!"
data:
push:
category: weather
thread-id: "info"
entity_id: weather.openweathermap
- id: posta_state_change
alias: 'Posta state change'
initial_state: 'true'
trigger:
platform: state
entity_id: sensor.cp_packages_coming_today
condition:
condition: state
entity_id: 'sensor.cp_packages_coming_today'
state: 'Delivery'
action:
service: variable.set_variable
data:
variable: posta_variable
attributes_template: >
{
"from": "{{ state_attr('sensor.cp_packages_coming_today', 'from') }}",
"date": "{{ state_attr('sensor.cp_packages_coming_today', 'date') }}",
"subject": "{{ state_attr('sensor.cp_packages_coming_today', 'subject') }}"
}
data_template:
value: >
{{ states('sensor.cp_packages_coming_today')}}
#,
# "body": "{{ state_attr('sensor.cp_packages_coming_today', 'body') }}"
# }
- id: posta_variable_reset
alias: 'Posta Variable Reset'
initial_state: 'true'
trigger:
platform: time
at: '00:00:01'
action:
service: variable.set_variable
data:
variable: posta_variable
value: no_delivery
attributes:
from: ''
date: ''
subject: ''
body: ''
icon: mdi:truck-delivery
- id: dpd_state_change
alias: 'DPD state change'
initial_state: 'true'
trigger:
platform: state
entity_id: sensor.dpd_packages_coming_today
condition:
condition: state
entity_id: 'sensor.dpd_packages_coming_today'
state: 'Delivery'
action:
service: variable.set_variable
data:
variable: dpd_variable
attributes_template: >
{
"from": "{{ state_attr('sensor.dpd_packages_coming_today', 'from') }}",
"date": "{{ state_attr('sensor.dpd_packages_coming_today', 'date') }}",
"subject": "{{ state_attr('sensor.dpd_packages_coming_today', 'subject') }}"
}
data_template:
value: >
{{ states('sensor.dpd_packages_coming_today')}}
#,
# "body": "{{ state_attr('sensor.dpd_packages_coming_today', 'body') }}"
- id: dpd_variable_reset
alias: 'DPD Variable Reset'
initial_state: 'true'
trigger:
platform: time
at: '00:00:01'
action:
service: variable.set_variable
data:
variable: dpd_variable
value: no_delivery
attributes:
from: ''
date: ''
subject: ''
body: ''
icon: mdi:truck-delivery
- id: dhl_state_change
alias: 'DHL state change'
initial_state: 'true'
trigger:
platform: state
entity_id: sensor.dhl_packages_coming_today
condition:
condition: state
entity_id: 'sensor.dhl_packages_coming_today'
state: 'Delivery'
action:
service: variable.set_variable
data:
variable: dhl_variable
attributes_template: >
{
"from": "{{ state_attr('sensor.dhl_packages_coming_today', 'from') }}",
"date": "{{ state_attr('sensor.dhl_packages_coming_today', 'date') }}",
"subject": "{{ state_attr('sensor.dhl_packages_coming_today', 'subject') }}"
}
data_template:
value: >
{{ states('sensor.dhl_packages_coming_today')}}
#,
# "body": "{{ state_attr('sensor.dhl_packages_coming_today', 'body') }}"
- id: dhl_variable_reset
alias: 'DHL Variable Reset'
initial_state: 'true'
trigger:
platform: time
at: '00:00:01'
action:
service: variable.set_variable
data:
variable: dhl_variable
value: no_delivery
attributes:
from: ''
date: ''
subject: ''
body: ''
icon: mdi:truck-delivery
- id: gls_state_change
alias: 'GLS state change'
initial_state: 'true'
trigger:
platform: state
entity_id: sensor.gls_packages_coming_today
condition:
condition: state
entity_id: 'sensor.gls_packages_coming_today'
state: 'Delivery'
action:
service: variable.set_variable
data:
variable: gls_variable
attributes_template: >
{
"from": "{{ state_attr('sensor.gls_packages_coming_today', 'from') }}",
"date": "{{ state_attr('sensor.gls_packages_coming_today', 'date') }}",
"subject": "{{ state_attr('sensor.gls_packages_coming_today', 'subject') }}"
}
data_template:
value: >
{{ states('sensor.gls_packages_coming_today')}}
#,
# "body": "{{ state_attr('sensor.gls_packages_coming_today', 'body') }}"
- id: gls_variable_reset
alias: 'GLS Variable Reset'
initial_state: 'true'
trigger:
platform: time
at: '00:00:01'
action:
service: variable.set_variable
data:
variable: gls_variable
value: no_delivery
attributes:
from: ''
date: ''
subject: ''
body: ''
icon: mdi:truck-delivery
- id: power_out
alias: 'Power is out'
initial_state: 'true'
trigger:
platform: state
entity_id: sensor.house_electricity
to: 'power_out'
action:
service: notify.whole_family
data:
title: "Power is Out at Home"
message: "There's been a power cut at home. Electricity is now off"
data:
push:
thread-id: "error"
- id: power_restored
alias: 'Power is restored'
initial_state: 'true'
trigger:
platform: state
entity_id: sensor.house_electricity
to: 'power_on'
action:
service: notify.whole_family
data:
title: "Power Restored at Home"
message: "Electricity has been powered back on at home"
data:
push:
thread-id: "location"
- id: moldy_conditions
alias: 'Moldy Conditions'
initial_state: 'true'
trigger:
platform: state
entity_id: binary_sensor.popp_unknown_type_0004_id_0014_sensor
to: 'on'
action:
service: notify.sean_alena
data:
title: "Mold Detector"
message: "There are conditions for mold formation under the sink right now"
data:
push:
thread-id: "error"
- id: internet_upload_limited
alias: 'Internet Upload is Limited'
trigger:
platform: numeric_state
entity_id: sensor.speedtest_upload
below: 0.25
action:
service: notify.mobile_app_sean_s_iphone_x
data:
title: "Internet is Severely Limited"
message: "The upload speed of the internet is below 250kbit"
data:
push:
thread-id: "error"
- id: internet_upload_normal
alias: 'Internet Upload is Normal'
trigger:
platform: numeric_state
entity_id: sensor.speedtest_upload
above: 1
action:
service: notify.mobile_app_sean_s_iphone_x
data:
title: "Internet is Normal"
message: "The upload speed of the internet is above 1 mbit"
data:
push:
thread-id: "error"
- id: sophie_up_late
alias: 'Sophie up late'
initial_state: 'true'
trigger:
- platform: state
entity_id: binary_sensor.sophies_room_zone_10
to: 'on'
condition:
condition: or
conditions:
- condition: and
conditions:
- condition: time
after: '22:30:00'
before: '5:00:00'
- condition: template
value_template: "{{ not is_state('device_tracker.sean_s_iphone_x', 'Traveling') }}"
- condition: template
value_template: "{{ now().strftime('%m')|int > 6 or now().strftime('%m')|int < 9 }}"
- condition: and
conditions:
- condition: time
after: '21:30:00'
before: '5:00:00'
- condition: template
value_template: "{{ not is_state('device_tracker.sean_s_iphone_x', 'Traveling') }}"
- condition: template
value_template: "{{ now().strftime('%m')|int > 8 or now().strftime('%m')|int < 7 }}"
action:
service: notify.mobile_app_sean_s_iphone_x
data:
title: "Sophie is Up Late"
message: "Sophie is Up Late"
data:
push:
thread-id: "info"
# - condition: time
# after: '21:30:00'
# before: '5:00:00'
# - condition: template
# value_template: "{{ not is_state('device_tracker.sean_s_iphone_x', 'Traveling') }}"
# - condition: template
# value_template: "{{ now().strftime('%m')|int = 8 or now().strftime('%m')|int = 7 }}"
- id: 'update_airvisualnode_home_data'
alias: 'Update AirVisual node home data'
trigger:
minutes: '/5'
platform: time_pattern
action:
- service: shell_command.update_avnodehome_data
initial_state: 'on'
- id: 'update_airvisualnode_hlubocepy_data'
alias: 'Update AirVisual node Hlubocepy data'
trigger:
minutes: '/5'
platform: time_pattern
action:
- service: shell_command.update_avnodehlubocepy_data
initial_state: 'on'
#- alias: Turn off sophie up late in summer
# initial_state: 'on'
# trigger:
# - platform: homeassistant
# event: start
# condition:
# condition: template
# value_template: >
# {{ now().strftime('%m')|int <= 8 and
# now().strftime('%m')|int >= 7 }}
# action:
# - delay: '00:02:00'
# - service: automation.turn_off
# entity_id:
# - automation.sophie_up_late
- id: bio_odpad_day_tomorrow_sean
alias: 'Bio Odpad Day'
initial_state: 'true'
trigger:
platform: time
at: '21:00:00'
condition:
- condition: and
conditions:
- condition: state
entity_id: 'sensor.bio_odpad_day'
state: 'Tomorrow'
- condition: template
value_template: "{{ not is_state('sensor.sean_location', 'Traveling') }}"
action:
service: notify.mobile_app_sean_s_iphone_x
data:
title: "Bio Odpad Tomorrow"
message: "Bio odpad should be taken out tonight or tomorrow for collection on {% if now().weekday() in (5,) %}Monday{% elif now().weekday() in (6,) %}Tuesday{% elif now().weekday() in (0,) %}Wednesday{% elif now().weekday() in (1,) %}Thursday{% elif now().weekday() in (2,) %}Friday{% elif now().weekday() in (3,) %}Saturday{% elif now().weekday() in (4,) %}Sunday{% endif %} morning"
data:
push:
thread-id: "info"
- id: bio_odpad_day_tomorrow_alena
alias: 'Bio Odpad Day'
initial_state: 'true'
trigger:
platform: time
at: '15:00:00'
condition:
- condition: and
conditions:
- condition: state
entity_id: 'sensor.bio_odpad_day'
state: 'Tomorrow'
action:
service: notify.mobile_app_alena_s_iphone_x
data:
title: "Bio Odpad Tomorrow"
message: "Bio odpad should be taken out today or tomorrow for collection on {% if now().weekday() in (5,) %}Monday{% elif now().weekday() in (6,) %}Tuesday{% elif now().weekday() in (0,) %}Wednesday{% elif now().weekday() in (1,) %}Thursday{% elif now().weekday() in (2,) %}Friday{% elif now().weekday() in (3,) %}Saturday{% elif now().weekday() in (4,) %}Sunday{% endif %} morning"
data:
push:
thread-id: "info"
- id: trash_day_tomorrow_sean
alias: 'Trash Day'
initial_state: 'true'
trigger:
platform: time
at: '21:00:00'
condition:
- condition: and
conditions:
- condition: state
entity_id: 'sensor.trash_day'
state: 'Tomorrow'
- condition: template
value_template: "{{ not is_state('sensor.sean_location', 'Traveling') }}"
action:
service: notify.mobile_app_sean_s_iphone_x
data:
title: "Trash Tomorrow"
message: "Trash should be taken out tonight or tomorrow for collection on {% if now().weekday() in (5,) %}Monday{% elif now().weekday() in (6,) %}Tuesday{% elif now().weekday() in (0,) %}Wednesday{% elif now().weekday() in (1,) %}Thursday{% elif now().weekday() in (2,) %}Friday{% elif now().weekday() in (3,) %}Saturday{% elif now().weekday() in (4,) %}Sunday{% endif %} morning"
data:
push:
thread-id: "info"
- id: trash_day_tomorrow_alena
alias: 'Trash Day'
initial_state: 'true'
trigger:
platform: time
at: '15:00:00'
condition:
- condition: and
conditions:
- condition: state
entity_id: 'sensor.trash_day'
state: 'Tomorrow'
action:
service: notify.mobile_app_alena_s_iphone_x
data:
title: "Trash Tomorrow"
message: "Trash should be taken out today or tomorrow for collection on {% if now().weekday() in (5,) %}Monday{% elif now().weekday() in (6,) %}Tuesday{% elif now().weekday() in (0,) %}Wednesday{% elif now().weekday() in (1,) %}Thursday{% elif now().weekday() in (2,) %}Friday{% elif now().weekday() in (3,) %}Saturday{% elif now().weekday() in (4,) %}Sunday{% endif %} morning"
data:
push:
thread-id: "info"
- id: bio_odpad_day_today_sean
alias: 'Bio Odpad Day'
initial_state: 'true'
trigger:
platform: time
at: '21:00:00'
condition:
- condition: and
conditions:
- condition: state
entity_id: 'sensor.bio_odpad_day'
state: 'Today'
- condition: template
value_template: "{{ not is_state('sensor.sean_location', 'Traveling') }}"
action:
service: notify.mobile_app_sean_s_iphone_x
data:
title: "Bio Odpad Today"
message: "Bio odpad should be taken out tonight for collection on {% if now().weekday() in (6,) %}Monday{% elif now().weekday() in (0,) %}Tuesday{% elif now().weekday() in (1,) %}Wednesday{% elif now().weekday() in (2,) %}Thursday{% elif now().weekday() in (3,) %}Friday{% elif now().weekday() in (4,) %}Saturday{% elif now().weekday() in (5,) %}Sunday{% endif %} morning"
data:
push:
thread-id: "info"
- id: bio_odpad_day_today_alena
alias: 'Bio Odpad Day'
initial_state: 'true'
trigger:
platform: time
at: '15:00:00'
condition:
- condition: and
conditions:
- condition: state
entity_id: 'sensor.bio_odpad_day'
state: 'Today'
action:
service: notify.mobile_app_alena_s_iphone_x
data:
title: "Bio Odpad Today"
message: "Bio odpad should be taken out today for collection on {% if now().weekday() in (6,) %}Monday{% elif now().weekday() in (0,) %}Tuesday{% elif now().weekday() in (1,) %}Wednesday{% elif now().weekday() in (2,) %}Thursday{% elif now().weekday() in (3,) %}Friday{% elif now().weekday() in (4,) %}Saturday{% elif now().weekday() in (5,) %}Sunday{% endif %} morning"
data:
push:
thread-id: "info"
#- id: trash_day_today_sean
# alias: 'Trash Day'
# initial_state: 'true'
# trigger:
# - platform: time
# at: '21:00:00'
# - platform: time
# at: '22:00:00'
# - platform: time
# at: '23:00:00'
# condition:
# - condition: and
# conditions:
# - condition: state
# entity_id: 'sensor.trash_day'
# state: 'Today'
# - condition: template
# value_template: "{{ not is_state('sensor.sean_location', 'Traveling') }}"
# action:
# service: notify.mobile_app_sean_s_iphone_x
# data:
# title: "Trash Day Today"
# message: "Trash should be taken out tonight for collection on {% if now().weekday() in (6,) %}Monday{% elif now().weekday() in (0,) %}Tuesday{% elif now().weekday() in (1,) %}Wednesday{% elif now().weekday() in (2,) %}Thursday{% elif now().weekday() in (3,) %}Friday{% elif now().weekday() in (4,) %}Saturday{% elif now().weekday() in (5,) %}Sunday{% endif %} morning"
# data:
# push:
# thread-id: "info"
- id: trash_day_today_alena
alias: 'Trash Day'
initial_state: 'true'
trigger:
platform: time
at: '15:00:00'
condition:
- condition: and
conditions:
- condition: state
entity_id: 'sensor.trash_day'
state: 'Today'
action:
service: notify.mobile_app_alena_s_iphone
data:
title: "Trash Day Today"
message: "Trash should be taken out today for collection on {% if now().weekday() in (6,) %}Monday{% elif now().weekday() in (0,) %}Tuesday{% elif now().weekday() in (1,) %}Wednesday{% elif now().weekday() in (2,) %}Thursday{% elif now().weekday() in (3,) %}Friday{% elif now().weekday() in (4,) %}Saturday{% elif now().weekday() in (5,) %}Sunday{% endif %} morning"
data:
push:
thread-id: "info"
- alias: 'update_bio_odpad_sensor'
trigger:
platform: time
at: '00:00:01'
action:
- service: homeassistant.update_entity
entity_id: sensor.bio_odpad_day
- alias: 'update_trash_sensor'
trigger:
platform: time
at: '00:00:01'
action:
- service: homeassistant.update_entity
entity_id: sensor.trash_day
- id: update_morning_commute_sensor
alias: "Update morning commute sensor"
initial_state: 'on'
trigger:
- platform: time_pattern
seconds: 17
condition:
- condition: time
after: '10:00:00'
before: '13:00:00'
- condition: time
weekday:
- mon
- tue
- wed
- thu
- fri
action:
- service: homeassistant.update_entity
entity_id: sensor.transport_time_to_work
- id: basement_flooding
alias: 'Basement Flooding'
initial_state: 'true'
trigger:
platform: state
entity_id: binary_sensor.basement_is_flooding
to: 'on'
action:
- service: notify.sean_alena
data:
title: "Basement Flooding"
message: "The basement is flooding"
data:
push:
sound:
name: "Update.caf"
critical: 1
volume: 1.0
thread-id: "error"
- data:
data:
type: tts
message: "Attention! The basement is flooding! Attention! The basement is flooding!"
service: notify.alexa_media_alexa_kitchen_bar
- data:
data:
type: tts
message: "Attention! The basement is flooding! Attention! The basement is flooding!"
service: notify.alexa_media_alexa_master_closet
- id: automatic_theme_change
alias: Automatic Theme Change
initial_state: 'true'
trigger:
- platform: homeassistant
event: start
- platform: state
entity_id: sun.sun
to: above_horizon
- platform: sun
event: sunset
offset: "+00:30:00"
action:
- service_template: frontend.set_theme
data_template:
name: >
{% if states.sun.sun.state == "above_horizon" %}
Google Light Theme
{% else %}
midnight
{% endif %}
# name: >
# {% if states.sun.sun.state == "above_horizon" %}
# clear
# {% else %}
# clear-dark
# {% endif %}
- id: backup_snapshots_to_dropbox_nightly
alias: "Nightly Backup of Snapshots to Dropbox"
initial_state: 'true'
trigger:
platform: time
at: '4:00:00'
action:
- service: hassio.addon_stdin
data:
addon: "7be23ff5_dropbox_sync"
input:
command: "upload"
- id: preserve_sophies_room_aqi
alias: 'Preserve Sophies Room AQI to Variable'
initial_state: 'true'
trigger:
platform: state
entity_id: sensor.sophies_room_aqi
condition:
condition: template
value_template: "{{ not is_state('sensor.sophies_room_aqi', 0) }}"
action:
service: variable.set_variable
data:
variable: sophies_room_aqi
data_template:
value: >
{{ states('sensor.sophies_room_aqi')}}
- id: preserve_sebastians_room_aqi
alias: 'Preserve Sebastians Room AQI to Variable'
initial_state: 'true'
trigger:
platform: state
entity_id: sensor.sebastians_room_aqi
condition:
condition: template
value_template: "{{ not is_state('sensor.sebastians_room_aqi', 0) }}"
action:
service: variable.set_variable
data:
variable: sebastians_room_aqi
data_template:
value: >
{{ states('sensor.sebastians_room_aqi')}}
- id: preserve_sophies_room_aqi_description
alias: 'Preserve Sophies Room AQI description to Variable'
initial_state: 'true'
trigger:
platform: state
entity_id: sensor.sophies_room_aqi_description
condition:
condition: template
value_template: "{{ not is_state('sensor.sophies_room_aqi_description', '0 (Good)') }}"
action:
service: variable.set_variable
data:
variable: sophies_room_aqi_description
data_template:
value: >
{{ states('sensor.sophies_room_aqi_description')}}
- id: preserve_sebastians_room_aqi_description
alias: 'Preserve Sebastians Room AQI description to Variable'
initial_state: 'true'
trigger:
platform: state
entity_id: sensor.sebastians_room_aqi_description
condition:
condition: template
value_template: "{{ not is_state('sensor.sebastians_room_aqi_description', '0 (Good)') }}"
action:
service: variable.set_variable
data:
variable: sebastians_room_aqi_description
data_template:
value: >
{{ states('sensor.sebastians_room_aqi_description')}}
- id: state_holiday_1_week
alias: 'Notify - 1 Week to State Holiday'
initial_state: 'true'
trigger:
platform: time
at: '15:00:00'
condition:
condition: template
value_template: '{{ state_attr("sensor.czech_holidays_event_0", "eta") == 7 }}'
action:
service: notify.mobile_app_sean_s_iphone_x
data:
title: "State Holiday Coming Up"
message: "In one week, it is {{ states('sensor.czech_holidays_event_0')}}"
data:
push:
thread-id: "info"
- id: state_holiday_tomorrow
alias: 'Notify - 1 Day to State Holiday'
initial_state: 'true'
trigger:
platform: time
at: '15:00:00'
condition:
condition: template
value_template: '{{ state_attr("sensor.czech_holidays_event_0", "eta") == 1 }}'
action:
service: notify.mobile_app_sean_s_iphone_x
data:
title: "State Holiday Coming Up"
message: "Tomorrow it is {{ states('sensor.czech_holidays_event_0')}}"
data:
push:
thread-id: "info"
- id: state_holiday_today
alias: 'Notify - Today is State Holiday'
initial_state: 'true'
trigger:
platform: time
at: '10:45:00'
condition:
condition: template
value_template: '{{ state_attr("sensor.czech_holidays_event_0", "eta") == 0 }}'
action:
service: notify.mobile_app_sean_s_iphone_x
data:
title: "State Holiday Today"
message: "Today it is {{ states('sensor.czech_holidays_event_0')}}, you don't need to go to work!"
data:
push:
thread-id: "info"
- id: mini_countryman_clima_on
alias: 'Turn on Car Clima'
initial_state: 'true'
trigger:
platform: state
entity_id: input_boolean.mini_countryman_clima
to: 'on'
action:
service: bmw_connected_drive.activate_air_conditioning
data:
vin: !secret mini_countryman_vin
- id: mini_countryman_clima_off
alias: 'Turn off Car Clima'
initial_state: 'true'
trigger:
platform: state
entity_id: binary_sensor.cooper_s_e_all4_door_lock_state
action:
service: input_boolean.turn_off
data:
entity_id: input_boolean.mini_countryman_clima
- id: preserve_yesterdays_coronavirus_cases
alias: "Preserve Yesterday's Coronavirus Cases"
initial_state: 'true'
trigger:
platform: time
at: '6:30:00'
action:
service: variable.set_variable
data:
variable: czechia_coronavirus_yesterday
data_template:
value: >
{{ states('sensor.czechia_coronavirus_confirmed')}}
- id: calculate_coronavirus_delta_yesterday
alias: "Calculate Change in Coronavirus Cases Yesterday"
initial_state: 'true'
trigger:
platform: time
at: '6:00:00'
action:
service: variable.set_variable
data:
variable: czechia_coronavirus_new_yesterday
data_template:
value: >
{{ (states('sensor.czechia_coronavirus_confirmed'))|int - (states('variable.czechia_coronavirus_yesterday'))|int }}
- id: calculate_coronavirus_delta_today
alias: "Calculate Change in Coronavirus Cases Today"
initial_state: 'true'
trigger:
platform: time_pattern
minutes: '/15'
action:
service: variable.set_variable
data:
variable: czechia_coronavirus_new_today
data_template:
value: >
{{ (states('sensor.czechia_coronavirus_confirmed'))|int - (states('variable.czechia_coronavirus_yesterday'))|int }}
- id: turn_on_trash_input_boolean
alias: "Turn On Trash Input Boolean"
initial_state: 'true'
trigger:
platform: state
entity_id: sensor.trash_day
to: 'Tomorrow'
action:
service: input_boolean.turn_on
data:
entity_id: input_boolean.trash_needs_taking_out
- id: turn_off_trash_input_boolean
alias: "Turn Off Trash Input Boolean"
initial_state: 'true'
trigger:
platform: state
entity_id: sensor.trash_day
to: 'false'
action:
service: input_boolean.turn_off
data:
entity_id: input_boolean.trash_needs_taking_out
- id: notification_turn_off_trash_input_boolean
alias: notification_turn_off_trash_input_boolean
trigger:
platform: event
event_type: ios.notification_action_fired
event_data:
actionName: TOOK_TRASH_OUT
action:
service: input_boolean.turn_off
data:
entity_id: input_boolean.trash_needs_taking_out
- id: reminders_label_update
alias: reminders_label_update
trigger:
- platform: time_pattern
minutes: '/30'
action:
- service: homeassistant.update_entity
entity_id: binary_sensor.reminders_label
- id: narnia_raid_degraded_daily_warning
alias: narnia_raid_degraded_daily_warning
initial_state: 'true'
trigger:
platform: time
at: '21:00:00'
condition:
condition: state
entity_id: 'sensor.narnia_raid_status'
state: 'Degraded'
action:
service: notify.mobile_app_sean_s_iphone_x
data:
title: "RAID Warning"
message: "The RAID Array on Narnia is Degraded"
data:
push:
thread-id: "error"
- id: run_speedtest
alias: run_speedtest
initial_state: 'true'
trigger:
platform: time_pattern
minutes: 60
action:
service: speedtestdotnet.speedtest
- id: update_trash_emergency_sensor
alias: update_trash_emergency_sensor
trigger:
platform: time_pattern
minutes: 5
action:
service: homeassistant.update_entity
entity_id: binary_sensor.trash_emergency
- id: server_room_flooding
alias: server_room_flooding
initial_state: 'true'
trigger:
platform: state
entity_id: binary_sensor.server_room_flood_sensor
to: 'on'
action:
- service: notify.sean_alena
data:
title: "Server Room Flooding"
message: "The server room is flooding!!"
data:
push:
sound:
name: "Update.caf"
critical: 1
volume: 1.0
thread-id: "error"
- data:
data:
type: tts
message: "Attention! The server room is flooding! Attention! The server room is flooding!"
service: notify.alexa_media_alexa_kitchen_bar
- data:
data:
type: tts
message: "Attention! The server room is flooding! Attention! The server room is flooding!"
service: notify.alexa_media_alexa_master_closet
- id: update_trash_display
alias: update_trash_display
trigger:
platform: time_pattern
minutes: 15
action:
service: homeassistant.update_entity
entity_id: binary_sensor.trash_display
- id: update_sebs_naptime
alias: update_sebs_naptime
trigger:
platform: time_pattern
minutes: 5
action:
service: homeassistant.update_entity
entity_id: binary_sensor.seb_naptime
- id: sebastian_is_up
alias: sebastian_is_up
initial_state: 'true'
trigger:
- platform: state
entity_id: binary_sensor.sebs_room_motion
to: 'on'
condition:
condition: or
conditions:
- condition: time
after: '22:00:00'
before: '7:00:00'
- condition: time
after: '14:00:00'