-
Notifications
You must be signed in to change notification settings - Fork 12
/
location_automations.yaml
executable file
·1047 lines (989 loc) · 27.2 KB
/
location_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: zone_to_dropdown
alias: 'Zone to Dropdown'
initial_state: 'true'
trigger:
platform: state
entity_id: device_tracker.seans_iphone_14
action:
service: input_select.select_option
entity_id: input_select.sean_last_zone_dropdown
data_template:
option: '{{ states.device_tracker.seans_iphone_14.state }}'
- id: zone_to_dropdown_home
alias: 'Zone to Dropdown - home'
initial_state: 'true'
trigger:
platform: state
entity_id: device_tracker.seans_iphone_14
from: 'home'
action:
service: input_select.select_option
data:
entity_id: input_select.sean_last_zone_dropdown
option: home
- id: at_home
alias: 'At Home'
initial_state: 'true'
trigger:
platform: state
entity_id: device_tracker.seans_iphone_14
to: 'home'
# for: "00:00:05"
action:
service: input_select.select_option
data:
entity_id: input_select.sean_location_dropdown
option: Home
- id: left_home
alias: 'Left Home'
initial_state: 'true'
trigger:
platform: state
entity_id: device_tracker.seans_iphone_14
from: 'home'
to: 'not_home'
for: "00:00:05"
action:
service: input_select.select_option
data:
entity_id: input_select.sean_location_dropdown
option: Left Home
- id: heading_to_work
alias: 'Heading To Work'
initial_state: 'true'
trigger:
platform: state
entity_id: input_select.sean_last_zone_dropdown
condition:
- condition: and
conditions:
- condition: time
before: '17:00:00'
weekday:
- mon
- tue
- wed
- thu
- fri
- condition: template
value_template: >
{{ trigger.from_state is not none and trigger.to_state is not none and
trigger.from_state.state in ['home','Billa','Posta'] and
trigger.to_state.state in ['ToCenter','ToAndel','ToWineFood','BioStore','Lazarska','SmichovskeNad'] }}
action:
service: input_select.select_option
data:
entity_id: input_select.sean_location_dropdown
option: Heading to Work
- id: at_work
alias: 'At Work'
initial_state: 'true'
trigger:
platform: state
entity_id: device_tracker.seans_iphone_14
to: 'Work'
action:
service: input_select.select_option
data:
entity_id: input_select.sean_location_dropdown
option: At Work
- id: at_piano_class
alias: at_piano_class
initial_state: 'true'
trigger:
platform: state
entity_id: device_tracker.seans_iphone_14
to: 'PianoClass'
action:
service: input_select.select_option
data:
entity_id: input_select.sean_location_dropdown
option: At Piano Class
- id: at_cerny_kohout
alias: at_cerny_kohout
initial_state: 'true'
trigger:
platform: state
entity_id: device_tracker.seans_iphone_14
to: 'CernyKohout'
action:
service: input_select.select_option
data:
entity_id: input_select.sean_location_dropdown
option: At Černy Kohout
- id: at_hlubocepy_center
alias: at_hlubocepy_center
initial_state: 'true'
trigger:
platform: state
entity_id: device_tracker.seans_iphone_14
to: 'HlubocepyCenter'
for:
minutes: 5
action:
service: input_select.select_option
data:
entity_id: input_select.sean_location_dropdown
option: In Old Hlubočepy
- id: in_udoli
alias: in_udoli
initial_state: 'true'
trigger:
- platform: state
entity_id: device_tracker.seans_iphone_14
to: 'Udoli Turnaround'
- platform: state
entity_id: device_tracker.seans_iphone_14
to: 'UdoliBetweenBridges'
- platform: state
entity_id: device_tracker.seans_iphone_14
to: 'UdoliBoat'
- platform: state
entity_id: device_tracker.seans_iphone_14
to: 'UdoliGoats'
- platform: state
entity_id: device_tracker.seans_iphone_14
to: 'UdoliLake'
- platform: state
entity_id: device_tracker.seans_iphone_14
to: 'UdoliMilitary'
- platform: state
entity_id: device_tracker.seans_iphone_14
to: 'UdoliStart'
- platform: state
entity_id: device_tracker.seans_iphone_14
to: 'UdoliTrain+Cave'
action:
service: input_select.select_option
data:
entity_id: input_select.sean_location_dropdown
option: In Udoli
# platform: template
# value_template: >
# {{ "Udoli" in states('device_tracker.seans_iphone_14') }}
- id: to_udoli
alias: to_udoli
initial_state: 'true'
trigger:
platform: template
value_template: >
{{ "ToUdoli" in states('device_tracker.seans_iphone_14') and is_state('sensor.sean_direction_of_travel', 'away_from') }}
action:
service: input_select.select_option
data:
entity_id: input_select.sean_location_dropdown
option: To Udoli
- id: to_from_udoli
alias: to_from_udoli
initial_state: 'true'
trigger:
platform: template
value_template: >
{{ "ToUdoli" in states('device_tracker.seans_iphone_14') and is_state('sensor.sean_direction_of_travel', 'stationary') }}
action:
service: input_select.select_option
data:
entity_id: input_select.sean_location_dropdown
option: To/from Udoli
- id: from_udoli
alias: from_udoli
initial_state: 'true'
trigger:
platform: template
value_template: >
{{ "ToUdoli" in states('device_tracker.seans_iphone_14') and is_state('sensor.sean_direction_of_travel', 'towards') }}
action:
service: input_select.select_option
data:
entity_id: input_select.sean_location_dropdown
option: From Udoli
- id: left_work_1
alias: 'Left Work 1'
initial_state: 'true'
trigger:
platform: state
entity_id: device_tracker.seans_iphone_14
to: 'not_home'
condition:
- condition: and
conditions:
- condition: time
after: '18:00:00'
weekday:
- mon
- tue
- wed
- thu
- fri
- condition: state
entity_id: 'input_select.sean_last_zone_dropdown'
state: 'Work'
action:
service: input_select.select_option
data:
entity_id: input_select.sean_location_dropdown
option: Left Work
- id: heading_home_work_1
alias: 'Heading Home From Work 1'
initial_state: 'true'
trigger:
platform: state
entity_id: input_select.sean_last_zone_dropdown
condition:
condition: and
conditions:
- condition: template
value_template: >
{{ trigger.from_state is not none and trigger.to_state is not none and
trigger.from_state.state in ['Work'] and
trigger.to_state.state in ['Andel', 'Lazarska', 'BioStore', 'ToWineFood', 'SmichovskeNad', 'Zbrovska', 'KarlovoNamesti'] }}
- condition: time
after: '18:00:00'
weekday:
- mon
- tue
- wed
- thu
- fri
action:
service: input_select.select_option
data:
entity_id: input_select.sean_location_dropdown
option: Heading Home
- id: heading_home_work_2
alias: 'Heading Home From Work 2'
initial_state: 'true'
trigger:
platform: state
entity_id: input_select.sean_last_zone_dropdown
condition:
condition: template
value_template: >
{{ trigger.from_state is not none and trigger.to_state is not none and
trigger.from_state.state in ['Work', 'Lazarska', 'Andel', 'BioStore', 'KarlovoNamesti'] and
trigger.to_state.state in ['SmichovskeNad', 'WineFood', 'ToAndel', 'ToWineFood', 'ToCenter', 'Zbrovska' ] }}
action:
service: input_select.select_option
data:
entity_id: input_select.sean_location_dropdown
option: Heading Home
- id: heading_home_from_hornbach
alias: 'Heading Home From Hornbach'
initial_state: 'true'
trigger:
platform: state
entity_id: input_select.sean_last_zone_dropdown
from: 'HornbachP5'
to: 'FromHornbachP5'
condition:
condition: time
weekday:
- sat
- sun
action:
service: input_select.select_option
data:
entity_id: input_select.sean_location_dropdown
option: Heading Home
- id: heading_home_from_ikea
alias: 'Heading Home From Ikea'
initial_state: 'true'
trigger:
platform: state
entity_id: input_select.sean_last_zone_dropdown
condition:
- condition: and
conditions:
- condition: time
weekday:
- sat
- sun
- condition: template
value_template: >
{{ trigger.from_state is not none and trigger.to_state is not none and
trigger.from_state.state in ['Ikea'] and
trigger.to_state.state in ['FromP6HomeBackWay', 'FromP6HomeHighway', 'ToP6'] }}
action:
service: input_select.select_option
data:
entity_id: input_select.sean_location_dropdown
option: Heading Home
- id: heading_home_from_hornbach_p6
alias: 'Heading Home From Hornbach P6'
initial_state: 'true'
trigger:
platform: state
entity_id: input_select.sean_last_zone_dropdown
condition:
- condition: and
conditions:
- condition: time
weekday:
- sat
- sun
- condition: template
value_template: >
{{ trigger.from_state is not none and trigger.to_state is not none and
trigger.from_state.state in ['HornbachP6'] and
trigger.to_state.state in ['FromP6HomeBackWay', 'FromP6HomeHighway', 'ToP6', 'FromHornbachP6', 'ToHornbachP6'] }}
action:
service: input_select.select_option
data:
entity_id: input_select.sean_location_dropdown
option: Heading Home
- id: heading_to_andel_from_p6
alias: 'Heading Home From P6'
initial_state: 'true'
trigger:
platform: state
entity_id: input_select.sean_last_zone_dropdown
condition:
- condition: and
conditions:
- condition: time
weekday:
- sat
- sun
- condition: template
value_template: >
{{ trigger.from_state is not none and trigger.to_state is not none and
trigger.from_state.state in ['Ikea', 'HornbachP6', 'FromP6HomeBackWay', 'FromP6HomeHighway', 'ToP6', 'FromHornbachP6', 'ToHornbachP6'] and
trigger.to_state.state in ['ToAndelFromP6'] }}
action:
service: input_select.select_option
data:
entity_id: input_select.sean_location_dropdown
option: Heading Home
- id: heading_home_from_winefood
alias: 'Heading Home From WineFood'
initial_state: 'true'
trigger:
platform: state
entity_id: input_select.sean_last_zone_dropdown
condition:
- condition: and
conditions:
- condition: time
weekday:
- sat
- sun
- condition: template
value_template: >
{{ trigger.from_state is not none and trigger.to_state is not none and
trigger.from_state.state in ['WineFood'] and
trigger.to_state.state in ['SmichovskeNad', 'ToWineFood', 'ToCenter'] }}
action:
service: input_select.select_option
data:
entity_id: input_select.sean_location_dropdown
option: Heading Home
- id: heading_home_from_andel
alias: 'Heading Home From Andel'
initial_state: 'true'
trigger:
platform: state
entity_id: input_select.sean_last_zone_dropdown
condition:
- condition: and
conditions:
- condition: time
weekday:
- sat
- sun
- condition: template
value_template: >
{{ trigger.from_state is not none and trigger.to_state is not none and
trigger.from_state.state in ['Andel'] and
trigger.to_state.state in ['SmichovskeNad', 'ToAndel', 'BioStore', 'ToWineFood', 'ToCenter', 'WineFood'] }}
action:
service: input_select.select_option
data:
entity_id: input_select.sean_location_dropdown
option: Heading Home
- id: to_p6
alias: 'To Prague 6'
initial_state: 'true'
trigger:
platform: state
entity_id: input_select.sean_last_zone_dropdown
condition:
- condition: and
conditions:
- condition: time
weekday:
- sat
- sun
- condition: template
value_template: >
{{ trigger.from_state is not none and trigger.to_state is not none and
trigger.from_state.state in ['home','Driving','Posta','Billa'] and
trigger.to_state.state in ['ToP6','FromP6HomeBackWay','FromP6HomeHighway'] }}
action:
service: input_select.select_option
data:
entity_id: input_select.sean_location_dropdown
option: Heading to P6
- id: heading_home_1
alias: 'Almost Home 1'
initial_state: 'true'
trigger:
platform: state
entity_id: input_select.sean_last_zone_dropdown
to: 'ToCenter'
condition:
condition: state
entity_id: 'input_select.sean_location_dropdown'
state: 'Heading Home'
action:
service: input_select.select_option
data:
entity_id: input_select.sean_location_dropdown
option: Almost Home
- id: to_center_1
alias: 'Heading To Center'
initial_state: 'true'
trigger:
platform: state
entity_id: input_select.sean_last_zone_dropdown
condition:
- condition: and
conditions:
- condition: time
weekday:
- sat
- sun
- condition: template
value_template: >
{{ trigger.from_state is not none and trigger.to_state is not none and
trigger.from_state.state in ['home','HlubocepyCenter','ToUdoli'] and
trigger.to_state.state in ['ToCenter','Zlichov'] }}
trigger:
platform: state
entity_id: input_select.sean_last_zone_dropdown
from: 'home'
to: 'ToCenter'
condition:
condition: time
weekday:
- sat
- sun
action:
service: input_select.select_option
data:
entity_id: input_select.sean_location_dropdown
option: Heading to Center
- id: to_winefood_1
alias: 'Heading To WineFood'
initial_state: 'true'
trigger:
platform: state
entity_id: input_select.sean_last_zone_dropdown
from: 'ToCenter'
to: 'ToWineFood'
condition:
condition: time
weekday:
- sat
- sun
action:
service: input_select.select_option
data:
entity_id: input_select.sean_location_dropdown
option: Heading to WineFood
- id: to_andel
alias: 'Heading To Andel'
initial_state: 'true'
trigger:
platform: state
entity_id: input_select.sean_last_zone_dropdown
from: 'ToCenter'
to: 'ToAndel'
condition:
condition: time
weekday:
- sat
- sun
action:
service: input_select.select_option
data:
entity_id: input_select.sean_location_dropdown
option: Heading to Andel
- id: to_hornbach_p5
alias: 'Heading To Hornbach'
initial_state: 'true'
trigger:
platform: state
entity_id: input_select.sean_last_zone_dropdown
from: 'ToCenter'
to: 'ToHornbachP5'
condition:
condition: time
weekday:
- sat
- sun
action:
service: input_select.select_option
data:
entity_id: input_select.sean_location_dropdown
option: Heading to Hornbach
- id: at_andel
alias: 'At Andel'
initial_state: 'true'
trigger:
platform: state
entity_id: device_tracker.seans_iphone_14
to: 'Andel'
for:
minutes: 3
condition:
condition: or
conditions:
- condition: time
weekday:
- sat
- sun
- condition: time
after: '19:00:00'
action:
service: input_select.select_option
data:
entity_id: input_select.sean_location_dropdown
option: At Andel
- id: at_andel_weekdays
alias: 'At Andel Weekdays'
initial_state: 'true'
trigger:
platform: state
entity_id: device_tracker.seans_iphone_14
to: 'Andel'
for:
minutes: 15
condition:
condition: and
conditions:
- condition: time
weekday:
- mon
- tue
- wed
- thu
- fri
- condition: time
before: '19:00:00'
action:
service: input_select.select_option
data:
entity_id: input_select.sean_location_dropdown
option: At Andel
- id: at_winefood
alias: 'At WineFood'
initial_state: 'true'
trigger:
platform: state
entity_id: device_tracker.seans_iphone_14
to: 'WineFood'
for:
minutes: 3
condition:
condition: time
weekday:
- sat
- sun
action:
service: input_select.select_option
data:
entity_id: input_select.sean_location_dropdown
option: At WineFood
- id: at_hornbach
alias: 'At Hornbach'
initial_state: 'true'
trigger:
platform: state
entity_id: device_tracker.seans_iphone_14
to: 'HornbachP5'
action:
service: input_select.select_option
data:
entity_id: input_select.sean_location_dropdown
option: At Hornbach
- id: at_hornbach_2
alias: 'At Hornbach'
initial_state: 'true'
trigger:
platform: state
entity_id: device_tracker.seans_iphone_14
to: 'HornbachP6'
action:
service: input_select.select_option
data:
entity_id: input_select.sean_location_dropdown
option: At Hornbach
- id: at_billa
alias: 'At Billa'
initial_state: 'true'
trigger:
platform: state
entity_id: device_tracker.seans_iphone_14
to: 'Billa'
for:
minutes: 3
action:
service: input_select.select_option
data:
entity_id: input_select.sean_location_dropdown
option: At Billa
- id: driving
alias: 'Driving'
initial_state: 'true'
trigger:
platform: state
entity_id: device_tracker.seans_iphone_14
condition:
- condition: and
conditions:
- condition: time
weekday:
- sat
- sun
- condition: template
value_template: >
{{ trigger.from_state is not none and trigger.to_state is not none and
trigger.from_state.state in ['home','Posta','Billa','Ikea','HornbachP6','HornbachP5','Andel'] and
trigger.to_state.state in ['Away'] }}
action:
service: input_select.select_option
data:
entity_id: input_select.sean_location_dropdown
option: Driving
- id: at_ikea
alias: 'At Ikea Zlicin'
initial_state: 'true'
trigger:
platform: state
entity_id: device_tracker.seans_iphone_14
to: 'IkeaZlicin'
for:
minutes: 3
action:
service: input_select.select_option
data:
entity_id: input_select.sean_location_dropdown
option: At Ikea
- id: at_posta
alias: 'At Posta'
initial_state: 'true'
trigger:
platform: state
entity_id: device_tracker.seans_iphone_14
to: 'Posta'
action:
service: input_select.select_option
data:
entity_id: input_select.sean_location_dropdown
option: At Posta
- id: alena_left_yoga
alias: 'Alena left yoga'
initial_state: 'true'
trigger:
platform: state
entity_id: device_tracker.alenas_iphone
from: 'Yoga'
to: 'not_home'
condition:
- condition: template
value_template: "{{ not is_state('device_tracker.seans_iphone_14', 'Traveling') }}"
action:
service: notify.mobile_app_sean_iphone_14
data:
title: "Alena Left Yoga"
message: "Alena Left Yoga"
data:
push:
thread-id: "location"
- id: alenas_is_home
alias: alenas_is_home
initial_state: 'true'
trigger:
platform: state
entity_id: device_tracker.alenas_iphone
to: 'home'
condition:
- condition: and
conditions:
- condition: state
entity_id: device_tracker.seans_iphone_14
state: 'home'
- condition: template
value_template: "{{ (as_timestamp(now())-as_timestamp(states.device_tracker.seans_iphone_14.last_changed)) > 120 }}"
action:
service: notify.mobile_app_sean_iphone_14
data:
title: "Alena's Home"
message: "Alena's Almost Arrived"
data:
push:
thread-id: "location"
- id: traveling
alias: 'Traveling'
initial_state: 'true'
trigger:
platform: state
entity_id: device_tracker.seans_iphone_14
to: 'Airport'
for:
minutes: 10
action:
service: input_select.select_option
data:
entity_id: input_select.sean_location_dropdown
option: Traveling
- id: heading_home_from_airport
alias: 'Heading Home From The Airport'
initial_state: 'true'
trigger:
platform: state
entity_id: input_select.sean_last_zone_dropdown
condition:
condition: template
value_template: >
{{ trigger.from_state is not none and trigger.to_state is not none and
trigger.from_state.state in ['Airport'] and
trigger.to_state.state in ['HomeFromAirport', 'FromP6HomeHighway', 'FromP6HomeBackWay', 'ToP6', 'FromHornbachP6'] }}
action:
service: input_select.select_option
data:
entity_id: input_select.sean_location_dropdown
option: Heading Home
- id: at_little_gym
alias: 'At Little Gym'
initial_state: 'true'
trigger:
platform: state
entity_id: device_tracker.seans_iphone_14
to: 'LittleGym'
for:
minutes: 3
action:
service: input_select.select_option
data:
entity_id: input_select.sean_location_dropdown
option: At Little Gym
- id: heading_home_from_little_gym
alias: 'Heading Home From Little Gym'
initial_state: 'true'
trigger:
platform: state
entity_id: input_select.sean_last_zone_dropdown
condition:
condition: template
value_template: >
{{ trigger.from_state is not none and trigger.to_state is not none and
trigger.from_state.state in ['LittleGym'] and
trigger.to_state.state in ['SmichovskeNad', 'ToAndel', 'BioStore', 'ToWineFood', 'ToCenter', 'Andel', 'WineFood'] }}
action:
service: input_select.select_option
data:
entity_id: input_select.sean_location_dropdown
option: Heading Home
- id: at_parklane_valdejnska
alias: 'At Parklane Valdejnska'
initial_state: 'true'
trigger:
platform: state
entity_id: device_tracker.seans_iphone_14
to: 'ParklaneValdejnska'
for:
minutes: 3
action:
service: input_select.select_option
data:
entity_id: input_select.sean_location_dropdown
option: At Parklane Valdejnska
- id: heading_home_from_parklane_valdejnska
alias: 'Heading Home From Parklane Valdejnska'
initial_state: 'true'
trigger:
platform: state
entity_id: input_select.sean_last_zone_dropdown
condition:
condition: template
value_template: >
{{ trigger.from_state is not none and trigger.to_state is not none and
trigger.from_state.state in ['ParklaneValdejnska'] and
trigger.to_state.state in ['SmichovskeNad', 'ToAndel', 'BioStore', 'ToWineFood', 'ToCenter', 'Andel','WineFood'] }}
action:
service: input_select.select_option
data:
entity_id: input_select.sean_location_dropdown
option: Heading Home
#- id: turn_off_automations_when_away
# alias: 'Turn off automations when away'
#
# initial_state: 'true'
# trigger:
# platform: state
# entity_id: device_tracker.seans_iphone_14
# to: 'Traveling'
# action:
# - service: automation.turn_off
# entity_id: automation.alena_left_yoga
#
#- id: turn_on_automations_when_home
# alias: 'Turn on automations when home'
#
# initial_state: 'true'
# trigger:
# platform: state
# entity_id: device_tracker.seans_iphone_14
# from: 'Traveling'
# action:
# - service: automation.turn_on
# entity_id: automation.alena_left_yoga
- alias: 'Good Time For Ferry to Work'
initial_state: 'true'
trigger:
platform: state
entity_id: device_tracker.seans_iphone_14
to: 'NearFerryToWork'
condition:
condition: template
value_template: >
{{ ((now().strftime('%M')|int <= 56 and
now().strftime('%M')|int >= 48) or
(now().strftime('%M')|int <= 16 and
now().strftime('%M')|int >= 08) or
(now().strftime('%M')|int <= 36 and
now().strftime('%M')|int >= 28)) and (not is_state('sensor.sean_activity', 'Automotive')) }}
action:
service: notify.mobile_app_sean_iphone_14
data:
title: "Ferry Notification"
message: "It's a good time to grab the ferry to work"
data:
push:
thread-id: "location"
- alias: 'Good Time For Ferry from Work'
initial_state: 'true'
trigger:
platform: state
entity_id: device_tracker.seans_iphone_14
to: 'NearFerryFromWork'
condition:
condition: template
value_template: >
{{ (now().strftime('%M')|int <= 60 and
now().strftime('%M')|int >= 52) or
(now().strftime('%M')|int <= 20 and
now().strftime('%M')|int >= 12) or
(now().strftime('%M')|int <= 40 and
now().strftime('%M')|int >= 32) }}
action:
service: notify.mobile_app_sean_iphone_14
data:
title: "Ferry Notification"
message: "It's a good time to grab the ferry from work"
data:
push:
thread-id: "location"
- id: alenas_heading_home
alias: alenas_heading_home
initial_state: 'true'
trigger:
platform: state
entity_id: sensor.alena_location
to: 'Heading Home'
for:
minutes: 1
condition:
condition: state
entity_id: device_tracker.seans_iphone_14
state: 'home'
action:
service: notify.mobile_app_sean_iphone_14
data:
title: "Alena's Heading Home"
message: "Alena is Heading Home and should arrive in about {{ states('sensor.alena_driving_time_to_home') }} minutes if she's driving"
data:
push:
thread-id: "location"
- id: traveling_2
alias: 'Traveling 2'
initial_state: 'true'
trigger:
platform: numeric_state
entity_id: proximity.sean_home
above: 120
action:
service: input_select.select_option
data:
entity_id: input_select.sean_location_dropdown
option: Traveling
- id: notify_udoli_getting_dark_sean
alias: notify_udoli_getting_dark_sean
initial_state: 'true'
trigger:
- platform: sun
event: sunset
offset: "-00:10:00"
condition:
condition: template
value_template: >
{{ "Udoli" in states('device_tracker.seans_iphone_14') }}
action:
service: notify.mobile_app_sean_iphone_14
data:
title: "Getting Dark in Udoli"
message: "The sun is setting. It will be dark soon. It's time to leave the udoli"
data:
push:
sound:
name: "News_Flash.caf"
critical: 1
volume: 1.0
thread-id: "location"