-
Notifications
You must be signed in to change notification settings - Fork 12
/
location_template_sensors.yaml
367 lines (352 loc) · 19.9 KB
/
location_template_sensors.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
- platform: template
sensors:
sean_location:
value_template: '{{ states.input_select.sean_location_dropdown.state }}'
friendly_name: "Papa Is:"
icon_template: >-
{% if is_state('input_select.sean_location_dropdown', 'Home') %}
mdi:home
{% elif is_state('input_select.sean_location_dropdown', 'At Work') %}
mdi:briefcase
{% elif is_state('input_select.sean_location_dropdown', 'At Andel') %}
mdi:cart
{% elif is_state('input_select.sean_location_dropdown', 'At WineFood') %}
mdi:cart
{% elif is_state('input_select.sean_location_dropdown', 'At Hornbach') %}
mdi:cart
{% elif is_state('input_select.sean_location_dropdown', 'At Ikea') %}
mdi:cart
{% elif is_state('input_select.sean_location_dropdown', 'At Billa') %}
mdi:cart
{% elif is_state('input_select.sean_location_dropdown', 'At BioStore') %}
mdi:cart
{% elif is_state('input_select.sean_location_dropdown', 'At Posta') %}
mdi:email
{% elif is_state('input_select.sean_location_dropdown', 'At Yoga') %}
mdi:human-handsup
{% elif is_state('input_select.sean_location_dropdown', 'Traveling') %}
mdi:airplane
{% elif is_state('input_select.sean_location_dropdown', 'At Parklane Valdejnska') %}
mdi:school
{% elif is_state('input_select.sean_location_dropdown', 'At Little Gym') %}
mdi:human-handsup
{% else %}
mdi:train-car
{% endif %}
- platform: template
sensors:
alena_location:
friendly_name: "Mama Is:"
value_template: >-
{% if is_state('device_tracker.alena_s_iphone', 'home') %}
Home
{% elif is_state('device_tracker.alena_s_iphone', 'Andel') %}
At Andel
{% elif is_state('device_tracker.alena_s_iphone', 'WineFood') %}
At WineFood
{% elif is_state('device_tracker.alena_s_iphone', 'Hornbach') %}
At Hornbach
{% elif is_state('device_tracker.alena_s_iphone', 'Ikea') %}
At Ikea
{% elif is_state('device_tracker.alena_s_iphone', 'Billa') %}
At Billa
{% elif is_state('device_tracker.alena_s_iphone', 'BioStore') %}
At Bio Store
{% elif is_state('device_tracker.alena_s_iphone', 'Posta') %}
At Posta
{% elif is_state('device_tracker.alena_s_iphone', 'Yoga') %}
At Yoga
{% elif is_state('device_tracker.alena_s_iphone', 'LittleGym') %}
At Little Gym
{% elif is_state('device_tracker.alena_s_iphone', 'ParklaneValdejnska') %}
At Parklane Valdejnska
{% elif is_state('device_tracker.alena_s_iphone', 'CMCp6') %}
At CMC in P6
{% elif is_state('device_tracker.alena_s_iphone', 'CMCp4') %}
At CMC in P4
{% elif is_state('device_tracker.alena_s_iphone', 'CMCp5') %}
At CMC in P5
{% elif is_state('device_tracker.alena_s_iphone', 'EUCp4') %}
At EUC in P4
{% elif is_state('device_tracker.alena_s_iphone', 'EUCp1') %}
At EUC in P1
{% elif is_state('device_tracker.alena_s_iphone', 'Zlichov') %}
At Zlichov
{% elif is_state('device_tracker.alena_s_iphone', 'Malostranska') %}
At Malostranska
{% elif states('proximity.alena_home')|float > 120 %}
Traveling
{% elif is_state('sensor.alena_direction_of_travel', 'away_from') %}
Leaving Home
{% elif is_state('sensor.alena_direction_of_travel', 'stationary') %}
Somewhere
{% elif is_state('sensor.alena_direction_of_travel', 'towards') %}
Heading Home
{% else %}
Somewhere
{% endif %}
icon_template: >-
{% if is_state('device_tracker.alena_s_iphone', 'home') %}
mdi:home
{% elif is_state('device_tracker.alena_s_iphone', 'Andel') %}
mdi:cart
{% elif is_state('device_tracker.alena_s_iphone', 'WineFood') %}
mdi:cart
{% elif is_state('device_tracker.alena_s_iphone', 'Hornbach') %}
mdi:cart
{% elif is_state('device_tracker.alena_s_iphone', 'Ikea') %}
mdi:cart
{% elif is_state('device_tracker.alena_s_iphone', 'Billa') %}
mdi:cart
{% elif is_state('device_tracker.alena_s_iphone', 'BioStore') %}
mdi:cart
{% elif is_state('device_tracker.alena_s_iphone', 'Posta') %}
mdi:email
{% elif is_state('device_tracker.alena_s_iphone', 'Yoga') %}
mdi:human-handsup
{% elif is_state('device_tracker.alena_s_iphone', 'LittleGym') %}
mdi:human-handsup
{% elif is_state('device_tracker.alena_s_iphone', 'Traveling') %}
mdi:airplane
{% elif is_state('device_tracker.alena_s_iphone', 'ParklaneValdstejnska') %}
mdi:school
{% elif is_state('device_tracker.alena_s_iphone', 'CMCp6') %}
mdi:stethoscope
{% elif is_state('device_tracker.alena_s_iphone', 'CMCp4') %}
mdi:stethoscope
{% elif is_state('device_tracker.alena_s_iphone', 'CMCp5') %}
mdi:stethoscope
{% elif is_state('device_tracker.alena_s_iphone', 'EUCp4') %}
mdi:stethoscope
{% elif is_state('device_tracker.alena_s_iphone', 'EUCp1') %}
mdi:stethoscope
{% elif is_state('device_tracker.alena_s_iphone', 'Zlichov') %}
mdi:tram
{% elif is_state('device_tracker.alena_s_iphone', 'Malostranska') %}
mdi:tram
{% elif is_state('sensor.alena_direction_of_travel', 'stationary') %}
mdi:help
{% elif is_state('sensor.alena_direction_of_travel', 'away_from') %}
mdi:car
{% elif is_state('sensor.alena_direction_of_travel', 'towards') %}
mdi:car
{% elif states('proximity.alena_home')|float > 120 %}
mdi:airplane
{% else %}
mdi:help
{% endif %}
- platform: template
sensors:
sophie_location:
friendly_name: "Sophie Is:"
value_template: >-
{% if is_state('device_tracker.sophie', 'home') %}
Home
{% elif is_state('device_tracker.sophie', 'Andel') %}
At Andel
{% elif is_state('device_tracker.sophie', 'WineFood') %}
At WineFood
{% elif is_state('device_tracker.sophie', 'Parklane Valdstejnska') %}
At School
{% elif is_state('device_tracker.sophie', 'Hornbach') %}
At Hornbach
{% elif is_state('device_tracker.sophie', 'Ikea') %}
At Ikea
{% elif is_state('device_tracker.sophie', 'Billa') %}
At Billa
{% elif is_state('device_tracker.sophie', 'BioStore') %}
At Bio Store
{% elif is_state('device_tracker.sophie', 'Posta') %}
At Posta
{% elif is_state('device_tracker.sophie', 'Yoga') %}
At Yoga
{% elif is_state('device_tracker.sophie', 'LittleGym') %}
At Little Gym
{% elif is_state('device_tracker.sophie', 'Airport') %}
At Airport
{% elif is_state('device_tracker.sophie', 'ParklaneValdstejnska') %}
At School
{% elif is_state('device_tracker.sophie', 'CMCp6') %}
At CMC in P6
{% elif is_state('device_tracker.sophie', 'CMCp4') %}
At CMC in P4
{% elif is_state('device_tracker.sophie', 'CMCp5') %}
At CMC in P5
{% elif is_state('device_tracker.sophie', 'EUCp4') %}
At EUC in P4
{% elif is_state('device_tracker.sophie', 'EUCp1') %}
At EUC in P1
{% elif is_state('device_tracker.sophie', 'Zlichov') %}
At Zlichov
{% elif is_state('device_tracker.sophie', 'Malostranska') %}
At Malostranska
{% elif states('proximity.sophie_home')|float > 120 %}
Traveling
{% elif is_state('sensor.sophie_direction_of_travel', 'away_from') %}
Leaving Home
{% elif is_state('sensor.sophie_direction_of_travel', 'stationary') %}
Somewhere
{% elif is_state('sensor.sophie_direction_of_travel', 'towards') %}
Heading Home
{% endif %}
icon_template: >-
{% if is_state('device_tracker.sophie', 'home') %}
mdi:home
{% elif is_state('device_tracker.sophie', 'Parklane Valdstejnska') %}
mdi:school
{% elif is_state('device_tracker.sophie', 'Andel') %}
mdi:cart
{% elif is_state('device_tracker.sophie', 'WineFood') %}
mdi:cart
{% elif is_state('device_tracker.sophie', 'Hornbach') %}
mdi:cart
{% elif is_state('device_tracker.sophie', 'Ikea') %}
mdi:cart
{% elif is_state('device_tracker.sophie', 'Billa') %}
mdi:cart
{% elif is_state('device_tracker.sophie', 'BioStore') %}
mdi:cart
{% elif is_state('device_tracker.sophie', 'Posta') %}
mdi:email
{% elif is_state('device_tracker.sophie', 'Yoga') %}
mdi:human-handsup
{% elif is_state('device_tracker.sophie', 'LittleGym') %}
mdi:human-handsup
{% elif is_state('device_tracker.sophie', 'Airport') %}
mdi:airplane
{% elif is_state('device_tracker.sophie', 'ParklaneValdstejnska') %}
mdi:school
{% elif is_state('device_tracker.sophie', 'CMCp6') %}
mdi:stethoscope
{% elif is_state('device_tracker.sophie', 'CMCp4') %}
mdi:stethoscope
{% elif is_state('device_tracker.sophie', 'CMCp5') %}
mdi:stethoscope
{% elif is_state('device_tracker.sophie', 'EUCp4') %}
mdi:stethoscope
{% elif is_state('device_tracker.sophie', 'EUCp1') %}
mdi:stethoscope
{% elif is_state('device_tracker.sophie', 'Zlichov') %}
mdi:tram
{% elif is_state('device_tracker.sophie', 'Malostranska') %}
mdi:tram
{% elif states('proximity.sophie_home')|float > 120 %}
mdi:airplane
{% elif is_state('sensor.sophie_direction_of_travel', 'stationary') %}
mdi:help
{% else %}
mdi:train-car
{% endif %}
- platform: template
sensors:
alena_eta_description:
friendly_name: "Alena ETA description"
value_template: >-
{% if is_state('sensor.alena_direction_of_travel', 'away_from') %}Alena is heading away from home. But if she were to turn around and start driving home now, it would take her approximately {{ states('sensor.alena_driving_time_to_home') }} minutes if she's driving in a car.
{% elif is_state('sensor.alena_location', 'Somewhere') %}Alena is somewhere I don't know. She hasn't started heading home yet, but if she were to start driving home now, it would take her approximately {{ states('sensor.alena_driving_time_to_home') }} minutes if she's driving in a car.
{% elif is_state('sensor.alena_direction_of_travel', 'towards') %}Alena is heading towards home, if she's driving, she should be home in about {{ states('sensor.alena_driving_time_to_home') }} minutes.
{% elif is_state('sensor.alena_location','Home') %}
{% else %}Alena is at {{ states('sensor.alena_location') }}. She hasn't started heading home yet. But if she were to start driving home now, it would take her approximately {{ states('sensor.alena_driving_time_to_home') }} minutes if she's driving in a car.
{% endif %}
- platform: template
sensors:
sean_eta_description:
friendly_name: "Sean ETA description"
value_template: >-
{% if now().weekday() in (0,1,2,3,4,) %}
{% if states('sensor.sean_location') in ['Almost Home','Heading Home','Waiting for Tram','Left Work'] %}Sean is {{ states('sensor.sean_location') }} . If he's coming by tram, it should take approximately {{ states('sensor.sean_tram_time_to_home') }} minutes to arrive.
{% elif states('sensor.sean_location') in ['Left Home','Heading to Work','Almost at Work','Heading to Center','Heading to Andel','Heading to Hornbach','Heading to WineFood','Heading to P6','Driving','Traveling'] %} Sean is {{ states('sensor.sean_location') }} . He's not heading towards home, but if he were to turn around now and start coming home, it would take approximately {{ states('sensor.sean_tram_time_to_home') }} minutes for him to arrive.
{% elif is_state('sensor.sean_location', 'Home') %}
{% else %} Sean is {{ states('sensor.sean_location') }}. He hasn't started heading home yet. But if he were to start taking the tram home now, it would take him approximately {{ states('sensor.sean_tram_time_to_home') }} minutes.
{% endif %}
{% else %}
{% if states('sensor.sean_location') in ['Almost Home','Heading Home','Waiting for Tram','Left Work'] %}Sean is {{ states('sensor.sean_location') }} . If he's coming by car, it should take approximately {{ states('sensor.sean_driving_time_to_home') }} minutes to arrive.
{% elif states('sensor.sean_location') in ['Left Home','Heading to Work','Almost at Work','Heading to Center','Heading to Andel','Heading to Hornbach','Heading to WineFood','Heading to P6','Driving','Traveling'] %} Sean is {{ states('sensor.sean_location') }} . He's not heading towards home, but if he were to turn around now and start coming home by car, it would take approximately {{ states('sensor.sean_driving_time_to_home') }} minutes to arrive.
{% elif is_state('sensor.sean_location', 'Home') %}
{% else %}Sean is {{ states('sensor.sean_location') }}. He hasn't started heading home yet. But if he were to start driving home now, it would take him approximately {{ states('sensor.sean_driving_time_to_home') }} minutes to arrive if he were coming by car.
{% endif %}
{% endif %}
- platform: template
sensors:
sophie_eta_description:
friendly_name: "Sophie ETA description"
value_template: >-
{% if now().weekday() in (1,2,3,4,5,) %}
{% if is_state('sensor.sophie_direction_of_travel', 'away_from') %} Sophie is heading away from home. But if she were to turn around and start heading home now, it would take her approximately {{ states('sensor.sophie_tram_time_to_home') }} minutes if she's in a tram.
{% elif is_state('sensor.sophie_location', 'Somewhere') %} Sophie is somewhere I don't know. She hasn't started heading home yet, but if she were to start driving home now, it would take her approximately {{ states('sensor.sophie_tram_time_to_home') }} minutes if she's in a tram.
{% elif is_state('sensor.sophie_direction_of_travel', 'towards') %} Sophie is heading towards home, if she's in a tram, she should be home in about {{ states('sensor.sophie_tram_time_to_home') }} minutes.
{% elif is_state('device_tracker.sophie', 'home') %}
{% else %} Sophie is {{ states('sensor.sophie_location') }}. She hasn't started heading home yet. But if she were to start heading home now, it would take her approximately {{ states('sensor.sophie_tram_time_to_home') }} minutes if she's in a tram.
{% endif %}
{% else %}
{% if is_state('sensor.sophie_direction_of_travel', 'away_from') %} Sophie is heading away from home. But if she were to turn around and start driving home now, it would take her approximately {{ states('sensor.sophie_driving_time_to_home') }} minutes if she's driving in a car.
{% elif is_state('sensor.sophie_location', 'Somewhere') %} Sophie is somewhere I don't know. She hasn't started heading home yet, but if she were to start driving home now, it would take her approximately {{ states('sensor.sophie_driving_time_to_home') }} minutes if she's driving in a car.
{% elif is_state('sensor.sophie_direction_of_travel', 'towards') %} Sophie is heading towards home, if she's driving, she should be home in about {{ states('sensor.sophie_driving_time_to_home') }} minutes.
{% elif is_state('device_tracker.sophie', 'home') %}
{% else %} Sophie is {{ states('sensor.sophie_location') }}. She hasn't started heading home yet. But if she were to start driving home now, it would take her approximately {{ states('sensor.sophie_driving_time_to_home') }} minutes if she's driving in a car.
{% endif %}
{% endif %}
- platform: template
sensors:
alena_eta:
friendly_name: "Alena ETA"
value_template: >-
{% if is_state('sensor.alena_location','Home') %} Alena is at home.
{% elif is_state('sensor.alena_direction_of_travel', 'towards') %} Alena ETA: {{ states('sensor.alena_driving_time_to_home') }} minutes by car.
{% else %} Alena isn't heading home
{% endif %}
- platform: template
sensors:
sean_eta:
friendly_name: "Sean ETA"
value_template: >-
{% if now().weekday() in (1,2,3,4,5,) %}
{% if states('sensor.sean_location') in ['Almost Home','Heading Home','Waiting for Tram','Left Work'] %} Sean ETA: in {{ states('sensor.sean_tram_time_to_home') }} minutes by tram.
{% elif is_state('sensor.sean_location', 'Home') %} Sean is at home.
{% else %} Sean isn't heading home
{% endif %}
{% else %}
{% if states('sensor.sean_location') in ['Almost Home','Heading Home','Waiting for Tram','Left Work'] %} Sean ETA: {{ states('sensor.sean_driving_time_to_home') }} minutes by car.
{% elif is_state('sensor.sean_location', 'Home') %} Sean is at home.
{% else %} Sean isn't heading home.
{% endif %}
{% endif %}
- platform: template
sensors:
sophie_eta:
friendly_name: "Sophie ETA"
value_template: >-
{% if now().weekday() in (1,2,3,4,5,) %}
{% if is_state('sensor.sophie_direction_of_travel', 'towards') %} Sophie ETA: {{ states('sensor.sophie_tram_time_to_home') }} minutes by tram.
{% elif is_state('device_tracker.sophie', 'home') %} Sophie is at home.
{% else %} Sophie isn't heading home
{% endif %}
{% else %}
{% if is_state('sensor.sophie_direction_of_travel', 'towards') %} Sophie ETA: {{ states('sensor.sophie_driving_time_to_home') }} minutes by car.
{% elif is_state('device_tracker.sophie', 'home') %} Sophie is at home.
{% else %} Sophie isn't heading home
{% endif %}
{% endif %}
- platform: template
sensors:
sean_commute:
friendly_name: "Sean Commute"
value_template: >-
Sean Route to Work: {{ state_attr('sensor.transport_time_to_work', 'route') }} (ETA: {{ states('sensor.transport_time_to_work') }} minutes)
# Sean Route to Work:
# {{ state_attr('sensor.transport_time_to_work', 'route')|replace(';',' ') }}
# (ETA: {{ states('sensor.transport_time_to_work') }} minutes)
- platform: template
sensors:
sean_direction_of_travel:
friendly_name: "Sean is Heading"
value_template: "{{ state_attr('proximity.sean_home', 'dir_of_travel') }}"
alena_direction_of_travel:
friendly_name: "Alena is Heading"
value_template: "{{ state_attr('proximity.alena_home', 'dir_of_travel') }}"
sophie_direction_of_travel:
friendly_name: "Sophie is Heading"
value_template: "{{ state_attr('proximity.sophie_home', 'dir_of_travel') }}"
all_direction_of_travel:
friendly_name: "All are Heading"
value_template: "{{ state_attr('proximity.all_home', 'dir_of_travel') }}"