-
Notifications
You must be signed in to change notification settings - Fork 27
/
Copy pathsensors.yaml
executable file
·610 lines (559 loc) · 23.4 KB
/
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
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
- platform: yr
# - platform: yweather
# woeid: 12767389
- platform: uptime
name: "HA runtime in minutes"
unit_of_measurement: minutes
- platform: magicseaweed
name: Virgina Beach Surf Report
api_key: !secret magicseaweed_api_key
spot_id: 396
monitored_conditions:
- swell_forecast
- platform: noaa_tides
station_id: 8639207
- platform: zestimate
api_key: !secret zestimate_api
zpid:
- !secret zestimate_zpid
# - platform: hue_custom
# ip_address: 192.168.1.121
# token: fCPelyl8nOBO4kA3n9nAffH61H-NLWmWOkbHdyeD
# Time-Date Sensor
- platform: time_date
display_options:
- 'time'
- 'date'
- 'date_time'
- 'time_date'
# - platform: illuminance
# entity_id: sensor.dark_sky_icon
# Pauls commute to Work with Google API
- platform: google_travel_time
name: Time to Work
api_key: !secret google_maps_api_key
origin: person.paul
destination: sensor.dest_address
# Pauls commute to home
- platform: google_travel_time
name: Time to Work No Tolls
api_key: !secret google_maps_api_key
origin: person.paul
destination: sensor.dest_address
options:
avoid: tolls
#
# # Tracys commute to Home
# - platform: google_travel_time
# name: Tracys Time to Home
# api_key: !secret google_maps_api_key
# origin: person.tracy
# destination: zone.home
#
# # Commute to CACI
# - platform: google_travel_time
# name: Time to CACI
# api_key: !secret google_maps_api_key
# origin: device_tracker.paul
# destination: zone.caci
#
# # Commute to Base
# - platform: google_travel_time
# name: Time to Base
# api_key: !secret google_maps_api_key
# origin: device_tracker.paul
# destination: zone.base
#
# # Commute to AVIS
# - platform: google_travel_time
# name: Time to AVIS Tracy
# api_key: !secret google_maps_api_key
# origin: device_tracker.tracy
# destination: zone.avis
#
# Pauls commute to home
- platform: waze_travel_time
name: Pauls Time to Home
origin: person.paul
destination: zone.home
region: 'US'
# Pauls commute to home without Tolls
- platform: waze_travel_time
name: Pauls Time to Home No HOV
origin: person.paul
destination: zone.home
region: 'US'
avoid_toll_roads: true
avoid_subscription_roads: true
# Tracys commute to Home
- platform: waze_travel_time
name: Tracys Time to Home
origin: person.tracy
destination: zone.home
region: 'US'
# # Commute to Work without Tolls
# - platform: waze_travel_time
# name: Time to Work No HOV
# origin: person.paul
# destination: sensor.dest_address
# region: 'US'
# avoid_toll_roads: true
# avoid_subscription_roads: true
# - platform: waze_travel_time
# name: Time to Work
# origin: person.paul
# destination: sensor.dest_address
# region: 'US'
# Commute to CACI
- platform: waze_travel_time
name: Time to CACI
origin: person.paul
destination: zone.caci
region: 'US'
# Commute to Base
- platform: waze_travel_time
name: Time to Base
origin: person.paul
destination: zone.base
region: 'US'
# Commute to AVIS
- platform: waze_travel_time
name: Time to AVIS Tracy
origin: person.tracy
destination: zone.avis
region: 'US'
# Time to get to Soul Mate
- platform: waze_travel_time
name: Time to get to Soul Mate
origin: person.paul
destination: person.tracy
region: 'US'
- platform: rest
resource: https://api.weather.gov/alerts/active/count
name: NWS Alert Count
value_template: >
{% if value_json.zones.VAZ098 is defined %}
{{ value_json.zones.VAZ098 }}
{% else %}
0
{% endif %}
headers:
User-Agent: Homeassistant
Accept: application/ld+json
scan_interval: 60
- platform: rest
resource: https://api.weather.gov/alerts/active?zone=VAZ098
name: NWS Alert Event
value_template: >
{% if value_json.features[0] is defined %}
{{ value_json['features'][0]['properties'].event }}
{% else %}
None
{% endif %}
json_attributes:
- features
headers:
User-Agent: Homeassistant
Accept: application/geo+json
scan_interval: 60
- platform: template
sensors:
dest_address:
value_template: >-
{%- if is_state("input_select.work_location", "Base") -%}
1915 Forrestal Dr, Norfolk, VA 23551, USA
{%- elif is_state("input_select.work_location", "CACI") -%}
1301 Executive Blvd, Chesapeake, VA 23320, USA
{%- else -%}
Unknown
{%- endif %}
security_system_state:
value_template: '{{ states.input_select.security_system.state }}'
friendly_name: 'Security System'
icon_template: >
{%- if is_state("input_select.security_system", "Disarmed") -%}
mdi:home-lock-open
{%- elif is_state("input_select.security_system", "Armed (Home)") -%}
mdi:home-lock
{%- elif is_state("input_select.security_system", "Armed (Away)") -%}
mdi:security-lock
{%- else -%}
mdi:help
{%- endif -%}
house_mode:
value_template: '{{ states.input_select.house_mode.state }}'
friendly_name: 'House Mode'
icon_template: >
{%- if is_state('input_select.house_mode', 'Home') -%}
mdi:home-account
{%- elif is_state('input_select.house_mode', 'Away') -%}
mdi:run-fast
{%- elif is_state('input_select.house_mode', 'Night') -%}
mdi:weather-night
{%- else -%}
mdi:help
{%- endif -%}
time_to_leave_for_work:
value_template: >
{% set t = strptime(states.sensor.time.state,'%H:%M') %}
{{ ( t.hour + t.minute / 60 ) > ( state_attr('input_datetime.work_time_paul', 'timestamp')/3600 - states.sensor.time_to_work.state | int / 60) }}
friendly_name: 'Time to Leave for Work'
time_to_leave_for_work_10:
value_template: >
{% set t = strptime(states.sensor.time.state,'%H:%M') %}
{{ ( t.hour + t.minute / 60 ) > ( state_attr('input_datetime.work_time_paul', 'timestamp')/3600 - 0.167 - states.sensor.time_to_work.state | int / 60) }}
friendly_name: 'Time to Leave for Work 10'
time_to_leave_for_work_15:
value_template: >
{% set t = strptime(states.sensor.time.state,'%H:%M') %}
{{ ( t.hour + t.minute / 60 ) > ( state_attr('input_datetime.work_time_paul', 'timestamp')/3600 - 0.25 - states.sensor.time_to_work.state | int / 60) }}
friendly_name: 'Time to Leave for Work 15'
time_to_leave_for_caci:
value_template: >
{% set t = strptime(states.sensor.time.state,'%H:%M') %}
{{ ( t.hour + t.minute / 60 ) > ( state_attr('input_datetime.work_time_paul', 'timestamp')/3600 - states.sensor.time_to_caci.state | int / 60) }}
friendly_name: 'Time to Leave for CACI'
time_to_leave_for_caci_10:
value_template: >
{% set t = strptime(states.sensor.time.state,'%H:%M') %}
{{ ( t.hour + t.minute / 60 ) > ( state_attr('input_datetime.work_time_paul', 'timestamp')/3600 - 0.167 - states.sensor.time_to_caci.state | int / 60) }}
friendly_name: 'Time to Leave for CACI 10'
time_to_leave_for_caci_15:
value_template: >
{% set t = strptime(states.sensor.time.state,'%H:%M') %}
{{ ( t.hour + t.minute / 60 ) > ( state_attr('input_datetime.work_time_paul', 'timestamp')/3600 - 0.25 - states.sensor.time_to_caci.state | int / 60) }}
friendly_name: 'Time to Leave for CACI 15'
time_to_leave_for_base:
value_template: >
{% set t = strptime(states.sensor.time.state,'%H:%M') %}
{{ ( t.hour + t.minute / 60 ) > ( state_attr('input_datetime.work_time_paul', 'timestamp')/3600 - states.sensor.time_to_base.state | int / 60) }}
friendly_name: 'Time to leave for Base'
time_to_leave_for_base_10:
value_template: >
{% set t = strptime(states.sensor.time.state,'%H:%M') %}
{{ ( t.hour + t.minute / 60 ) > ( state_attr('input_datetime.work_time_paul', 'timestamp')/3600 - 0.167 - states.sensor.time_to_base.state | int / 60) }}
friendly_name: 'Time to leave for Base 10'
time_to_leave_for_base_15:
value_template: >
{% set t = strptime(states.sensor.time.state,'%H:%M') %}
{{ ( t.hour + t.minute / 60 ) > ( state_attr('input_datetime.work_time_paul', 'timestamp')/3600 - 0.25 - states.sensor.time_to_base.state | int / 60) }}
friendly_name: 'Time to leave for Base 15'
time_to_leave_for_avis:
value_template: >
{% set t = strptime(states.sensor.time.state,'%H:%M') %}
{{ ( t.hour + t.minute / 60 ) > ( 7.33 - states.sensor.time_to_avis_tracy.state | int / 60) }}
friendly_name: 'Time to Leave for Avis'
pauls_traffic_density_to_caci:
friendly_name: Traffic to CACI
icon_template: 'mdi:car-multiple'
value_template: >
{% if states("sensor.time_to_caci") | int >= 32 %}
Heavy
{% elif states("sensor.time_to_caci") | int < 32 and states("sensor.time_to_caci") | int >= 27 %}
Moderate
{% elif states("sensor.time_to_caci") | int < 27 and states("sensor.time_to_caci") | int >= 2 %}
Normal
{% else %}
You're Here
{% endif %}
pauls_traffic_density_to_base:
friendly_name: Traffic to Base
icon_template: 'mdi:car-multiple'
value_template: >-
{% if states("sensor.time_to_base") | float >= 36 %}
Heavy
{% elif states("sensor.time_to_base") | float < 36 and states("sensor.time_to_base") | float >= 30 %}
Moderate
{% elif states("sensor.time_to_base") | float < 30 and states("sensor.time_to_base") | float >= 2 %}
Normal
{% else %}
You're Here
{% endif %}
tracys_traffic_density_to_avis:
friendly_name: Traffic to Avis
icon_template: 'mdi:car-multiple'
value_template: >-
{% if states("sensor.time_to_avis_tracy") | float >= 20 %}
Heavy
{% elif states("sensor.time_to_avis_tracy") | float < 20 and states("sensor.time_to_avis_tracy") | float >= 15 %}
Moderate
{% elif states("sensor.time_to_avis_tracy") | float < 15 and states("sensor.time_to_avis_tracy") | float >= 2 %}
Normal
{% else %}
You're Here
{% endif %}
pauls_traffic_density_to_work:
friendly_name: Traffic to Work
icon_template: 'mdi:car-multiple'
value_template: >
{% if (state_attr('sensor.time_to_work','duration_in_traffic') | replace(" mins","") | replace(" min","") | int == state_attr('sensor.time_to_work','duration') | replace(" mins","") | replace(" min","") | int) %}
At Work
{% elif (state_attr('sensor.time_to_work','duration_in_traffic') | replace(" mins","") | replace(" min","") | int / state_attr('sensor.time_to_work','duration') | replace(" mins","") | replace(" min","") | int) >= 1.2 %}
Heavy
{% elif (state_attr('sensor.time_to_work','duration_in_traffic') | replace(" mins","") | replace(" min","") | int / state_attr('sensor.time_to_work','duration') | replace(" mins","") | replace(" min","") | int) >= 1.2 and (state_attr('sensor.time_to_work','duration_in_traffic') | replace(" mins","") | replace(" min","") | int / state_attr('sensor.time_to_work','duration') | replace(" mins","") | replace(" min","") | int) <= 1.1 %}
Moderate
{% elif (state_attr('sensor.time_to_work','duration_in_traffic') | replace(" mins","") | replace(" min","") | int / state_attr('sensor.time_to_work','duration') | replace(" mins","") | replace(" min","") | int) < 1.1 and (state_attr('sensor.time_to_work','duration_in_traffic') | replace(" mins","") | replace(" min","") | int / state_attr('sensor.time_to_work','duration') | replace(" mins","") | replace(" min","") | int) > 0.1 %}
Normal
{% else %}
At Work
{% endif %}
pauls_hov_time_saving_to_work:
friendly_name: HOV Time Savings to Work
icon_template: 'mdi:clock'
value_template: >
{{ (states.sensor.time_to_work_no_tolls.state) | int - (states.sensor.time_to_work.state) |int}}
pauls_hov_time_saving_to_home:
friendly_name: HOV Time Savings to Home
icon_template: 'mdi:clock'
value_template: >
{{ (states.sensor.pauls_time_to_home.state) | int - (states.sensor.pauls_time_to_home.state) |int}}
car_wash_test:
value_template: >
{% set D0 = states('sensor.dark_sky_precip_probability') | int %}
{% set D1 = states('sensor.dark_sky_precip_probability_1d') | int %}
{% set D2 = states('sensor.dark_sky_precip_probability_2d') | int %}
{% set D3 = states('sensor.dark_sky_precip_probability_3d') | int %}
{% set D4 = states('sensor.dark_sky_precip_probability_4d') | int %}
{% set D5 = states('sensor.dark_sky_precip_probability_5d') | int %}
{% if D0 > 50 %} off
{% elif D1 > 50 %} off
{% elif D2 > 60 %} off
{% elif D3 > 70 %} off
{% elif D4 > 73 %} off
{% elif D5 > 76 %} off
{% elif 'rain' in states('sensor.dark_sky_icon') %} off
{% elif states('sensor.dark_sky_humidity') | int > 89 or states('sensor.motion_sensor_outdoor_relative_humidity') | int > 89 %} off
{% elif (D1+D2+D3+D4+D5) > 100 %} off
{% else %} on
{% endif %}
car_wash:
value_template: >-
{% if is_state('sensor.car_wash_test','on') %}
Yes
{% else %}
No
{% endif %}
#entity_picture_template: >-
# {% if is_state('sensor.car_wash_test', 'on') %}
# /local/custom_icons/car-wash-yellow-FDD835.png
# {% else %}
# /local/custom_icons/car-wash-blue-44739E.png
# {% endif %}
# battery_attic_water_sensor:
# friendly_name: "Attic Water Detector Battery"
# value_template: "{% if states.zwave.water_sensor_attic %}
# {{ states.zwave.water_sensor_attic.attributes.battery_level }}
# {% else %}
# unknown
# {% endif %}"
# unit_of_measurement: '%'
# icon_template: >-
# {% set battery_level = states('sensor.battery_attic_water_sensor')|int('unknown') %}
# {% set battery_round = (battery_level|int / 10)|int * 10 %}
# {% if battery_level == 'unknown' %}
# mdi:battery-unknown
# {% else %}
# {% if battery_round >= 100 %}
# mdi:battery
# {% elif battery_round > 0 %}
# mdi:battery-{{ battery_round }}
# {% else %}
# mdi:battery-alert
# {% endif %}
# {% endif %}
#
# battery_smoke_detector:
# friendly_name: "Attic Smoke Detector Battery"
# value_template: "{% if states.zwave.smoke_detector_attic %}
# {{ states.zwave.smoke_detector_attic.attributes.battery_level }}
# {% else %}
# unknown
# {% endif %}"
# unit_of_measurement: '%'
# icon_template: >-
# {% set battery_level = states('sensor.battery_smoke_detector')|int('unknown') %}
# {% set battery_round = (battery_level|int / 10)|int * 10 %}
# {% if battery_level == 'unknown' %}
# mdi:battery-unknown
# {% else %}
# {% if battery_round >= 100 %}
# mdi:battery
# {% elif battery_round > 0 %}
# mdi:battery-{{ battery_round }}
# {% else %}
# mdi:battery-alert
# {% endif %}
# {% endif %}
#
# open_close_sensor_livingroom_window_back_battery:
# friendly_name: "Living Room Back Window Open Close Sensor Battery"
# value_template: "{% if states.zwave.open_close_living_room_window %}
# {{ states.zwave.open_close_living_room_window.attributes.battery_level }}
# {% else %}
# unknown
# {% endif %}"
# unit_of_measurement: '%'
# icon_template: >-
# {% set battery_level = states('sensor.open_close_sensor_livingroom_window_back_battery')|int('unknown') %}
# {% set battery_round = (battery_level|int / 10)|int * 10 %}
# {% if battery_level == 'unknown' %}
# mdi:battery-unknown
# {% else %}
# {% if battery_round >= 100 %}
# mdi:battery
# {% elif battery_round > 0 %}
# mdi:battery-{{ battery_round }}
# {% else %}
# mdi:battery-alert
# {% endif %}
# {% endif %}
#
# open_close_sensor_office_window_battery:
# friendly_name: "Office Window Open Close Sensor Battery"
# value_template: "{% if states.zwave.open_close_office_window %}
# {{ states.zwave.open_close_office_window.attributes.battery_level }}
# {% else %}
# unknown
# {% endif %}"
# unit_of_measurement: '%'
# icon_template: >-
# {% set battery_level = states('sensor.open_close_sensor_office_window_battery')|int('unknown') %}
# {% set battery_round = (battery_level|int / 10)|int * 10 %}
# {% if battery_level == 'unknown' %}
# mdi:battery-unknown
# {% else %}
# {% if battery_round >= 100 %}
# mdi:battery
# {% elif battery_round > 0 %}
# mdi:battery-{{ battery_round }}
# {% else %}
# mdi:battery-alert
# {% endif %}
# {% endif %}
# entity_id: sensor.time
attic_smoke_detector:
value_template: >
{% set statemap = {
"0" : "Idle",
"1" : "Fire",
"2" : "C02",
"12" : "Testing",
"13" : "Idle" } %}
{% set key = states("sensor.smoke_detector_attic_alarm_type") %}
{{ statemap[key] if key in statemap.keys() else "Unknown" }}
friendly_name: 'Attic Smoke Alarm'
entity_id: sensor.smoke_detector_attic_alarm_type
last_alexa:
entity_id:
- media_player.kitchen
- media_player.office
- media_player.old_dot
- media_player.bedroom
- media_player.frog
- media_player.livingroom
- media_player.garage
- media_player.guestroom
- media_player.ashleysroom
- media_player.car_echo
value_template: >
{{ states.media_player | selectattr('attributes.last_called','eq',True) | map(attribute='entity_id') | first }}
last_motion:
friendly_name: 'Last Motion'
icon_template: 'mdi:walk'
entity_id:
- binary_sensor.motion_sensor_closet
- binary_sensor.motion_sensor_frog
- binary_sensor.motion_sensor_front_door_motion
- binary_sensor.motion_sensor_garage_motion
- binary_sensor.motion_sensor_hallway_motion
- binary_sensor.motion_sensor_kitchen_motion
- binary_sensor.motion_sensor_living_room_motion
- binary_sensor.motion_sensor_office_motion
value_template: >
{%- set sensors = [states.binary_sensor.motion_sensor_closet, states.binary_sensor.motion_sensor_frog, states.binary_sensor.motion_sensor_front_door_motion, states.binary_sensor.motion_sensor_garage_motion, states.binary_sensor.motion_sensor_hallway_motion, states.binary_sensor.motion_sensor_kitchen_motion, states.binary_sensor.motion_sensor_living_room_motion, states.binary_sensor.motion_sensor_office_motion] %}
{% for sensor in sensors %}
{% if as_timestamp(sensor.last_changed) == as_timestamp(sensors | map(attribute='last_changed') | max) %}
{%- set short_name = "(".join(sensor.name.split("(")[1:]) %}
{{ ")".join(short_name.split(")")[:-1]) }}
{% endif %}
{% endfor %}
downstairs_thermostat_temp:
friendly_name: "Downstairs Thermostat Temperature"
unit_of_measurement: '°F'
value_template: "{% if states.climate.downstairs %}
{{ states.climate.downstairs.attributes.current_temperature }}
{% else %}
unknown
{% endif %}"
icon_template: mdi:thermometer
entity_id: climate.downstairs
upstairs_thermostat_temp:
friendly_name: "Upstairs Thermostat Temperature"
unit_of_measurement: '°F'
value_template: "{% if states.climate.upstairs %}
{{ states.climate.upstairs.attributes.current_temperature }}
{% else %}
unknown
{% endif %}"
icon_template: mdi:thermometer
entity_id: climate.upstairs
downstairs_thermostat_humidity:
friendly_name: "Downstairs Thermostat humidity"
unit_of_measurement: '%'
value_template: "{% if states.climate.downstairs %}
{{ states.climate.downstairs.attributes.current_humidity }}
{% else %}
unknown
{% endif %}"
icon_template: mdi:water-percent
entity_id: climate.downstairs
upstairs_thermostat_humidity:
friendly_name: "Upstairs Thermostat humidity"
unit_of_measurement: '%'
value_template: "{% if states.climate.upstairs %}
{{ states.climate.upstairs.attributes.current_humidity }}
{% else %}
unknown
{% endif %}"
icon_template: mdi:water-percent
entity_id: climate.upstairs
# offline_devices:
# value_template: >
# {%- macro wildcard(entity_ids, reject) %}
# {%- for entity_id in entity_ids %}
# {%- if reject not in entity_id %}
# {{- entity_id }}{{ '' if loop.last else ',' }}
# {%- endif %}
# {%- endfor %}
# {%- endmacro %}
# {% set entity_ids = states | selectattr('state','eq','unavailable') | map(attribute='name') | list %}
# {% set entity_ids = wildcard(entity_ids, 'shuffle').split(',') | reject('eq','') %}
# {{ wildcard(entity_ids, 'repeat').split(',') | reject('eq','') | join(', ') }}
# entity_id: sensor.time
weather_icon:
entity_id: sensor.dark_sky_icon
friendly_name_template: >
{{states('sensor.weather_icon').split('weather')[1]|replace('-',' ')|title}}
value_template: >
{% set mapper_icon =
{'partly-cloudy-night': 'night-partly-cloudy',
'clear-day': 'sunny',
'clear-night': 'night',
'sunny': 'sunny',
'rainy': 'rainy',
'rain': 'rainy',
'snow': 'snowy',
'sleet': 'snowy-rainy',
'wind': 'windy',
'fog': 'fog',
'cloudy': 'cloudy',
'partlycloudy': 'partly-cloudy',
'partly-cloudy-day': 'partly-cloudy',
'hail': 'hail',
'thunderstorm': 'lightning',
'tornado': 'hurricane'} %}
{% set icon = states('sensor.dark_sky_icon') %}
{% set weather = mapper_icon[icon] if icon in mapper_icon else 'sunny-alert' %}
mdi:weather-{{weather}}
icon_template: >
{{states('sensor.weather_icon')}}