Sure thing. Definitely a TON of extra sensors and some to format/combine and such. I’m still fiddling w/ it - so could certainly reduce a bunch of these, put in a package, etc. - just haven’t done it. Crazy that the ‘old’ card is 95% the same as this one and how many sensors and such it took to rebuild what was already existing up until a few versions ago…
configuration.yaml
weather:
- platform: darksky
api_key: !secret darksky_api
mode: daily
sensor: !include sensors.yaml
sensor.yaml
- platform: template
sensors:
date_1d:
value_template: "{{ (as_timestamp(strptime(states('sensor.date_time'),'%Y-%m-%d, %H:%M')) + (1*86400)) | timestamp_custom('%a') }}"
icon_template: >
{% set farray = { 'clear-day':'mdi:weather-sunny',
'clear-night':'mdi:weather-night',
'partly-cloudy-day':'mdi:weather-partly-cloudy',
'partly-cloudy-night':'mdi:weather-night-partly-cloudy',
'cloudy':'mdi:weather-cloudy',
'wind':'mdi:weather-windy',
'fog':'mdi:weather-fog',
'rain':'mdi:weather-rainy',
'snow':'mdi:weather-snowy',
'sleet':'mdi:weather-snowy-rainy'} %}
{{ farray[states('sensor.darksky_weather_icon_1d')] }}
date_2d:
value_template: "{{ (as_timestamp(strptime(states('sensor.date_time'),'%Y-%m-%d, %H:%M')) + (2*86400)) | timestamp_custom('%a') }}"
icon_template: >
{% set farray = { 'clear-day':'mdi:weather-sunny',
'clear-night':'mdi:weather-night',
'partly-cloudy-day':'mdi:weather-partly-cloudy',
'partly-cloudy-night':'mdi:weather-night-partly-cloudy',
'cloudy':'mdi:weather-cloudy',
'wind':'mdi:weather-windy',
'fog':'mdi:weather-fog',
'rain':'mdi:weather-rainy',
'snow':'mdi:weather-snowy',
'sleet':'mdi:weather-snowy-rainy'} %}
{{ farray[states('sensor.darksky_weather_icon_2d')] }}
date_3d:
value_template: "{{ (as_timestamp(strptime(states('sensor.date_time'),'%Y-%m-%d, %H:%M')) + (3*86400)) | timestamp_custom('%a') }}"
icon_template: >
{% set farray = { 'clear-day':'mdi:weather-sunny',
'clear-night':'mdi:weather-night',
'partly-cloudy-day':'mdi:weather-partly-cloudy',
'partly-cloudy-night':'mdi:weather-night-partly-cloudy',
'cloudy':'mdi:weather-cloudy',
'wind':'mdi:weather-windy',
'fog':'mdi:weather-fog',
'rain':'mdi:weather-rainy',
'snow':'mdi:weather-snowy',
'sleet':'mdi:weather-snowy-rainy'} %}
{{ farray[states('sensor.darksky_weather_icon_3d')] }}
date_4d:
value_template: "{{ (as_timestamp(strptime(states('sensor.date_time'),'%Y-%m-%d, %H:%M')) + (4*86400)) | timestamp_custom('%a') }}"
icon_template: >
{% set farray = { 'clear-day':'mdi:weather-sunny',
'clear-night':'mdi:weather-night',
'partly-cloudy-day':'mdi:weather-partly-cloudy',
'partly-cloudy-night':'mdi:weather-night-partly-cloudy',
'cloudy':'mdi:weather-cloudy',
'wind':'mdi:weather-windy',
'fog':'mdi:weather-fog',
'rain':'mdi:weather-rainy',
'snow':'mdi:weather-snowy',
'sleet':'mdi:weather-snowy-rainy'} %}
{{ farray[states('sensor.darksky_weather_icon_4d')] }}
date_5d:
value_template: "{{ (as_timestamp(strptime(states('sensor.date_time'),'%Y-%m-%d, %H:%M')) + (5*86400)) | timestamp_custom('%a') }}"
icon_template: >
{% set farray = { 'clear-day':'mdi:weather-sunny',
'clear-night':'mdi:weather-night',
'partly-cloudy-day':'mdi:weather-partly-cloudy',
'partly-cloudy-night':'mdi:weather-night-partly-cloudy',
'cloudy':'mdi:weather-cloudy',
'wind':'mdi:weather-windy',
'fog':'mdi:weather-fog',
'rain':'mdi:weather-rainy',
'snow':'mdi:weather-snowy',
'sleet':'mdi:weather-snowy-rainy'} %}
{{ farray[states('sensor.darksky_weather_icon_5d')] }}
date_6d:
value_template: "{{ (as_timestamp(strptime(states('sensor.date_time'),'%Y-%m-%d, %H:%M')) + (6*86400)) | timestamp_custom('%a') }}"
icon_template: >
{% set farray = { 'clear-day':'mdi:weather-sunny',
'clear-night':'mdi:weather-night',
'partly-cloudy-day':'mdi:weather-partly-cloudy',
'partly-cloudy-night':'mdi:weather-night-partly-cloudy',
'cloudy':'mdi:weather-cloudy',
'wind':'mdi:weather-windy',
'fog':'mdi:weather-fog',
'rain':'mdi:weather-rainy',
'snow':'mdi:weather-snowy',
'sleet':'mdi:weather-snowy-rainy'} %}
{{ farray[states('sensor.darksky_weather_icon_6d')] }}
date_7d:
value_template: "{{ (as_timestamp(strptime(states('sensor.date_time'),'%Y-%m-%d, %H:%M')) + (7*86400)) | timestamp_custom('%a') }}"
icon_template: >
{% set farray = { 'clear-day':'mdi:weather-sunny',
'clear-night':'mdi:weather-night',
'partly-cloudy-day':'mdi:weather-partly-cloudy',
'partly-cloudy-night':'mdi:weather-night-partly-cloudy',
'cloudy':'mdi:weather-cloudy',
'wind':'mdi:weather-windy',
'fog':'mdi:weather-fog',
'rain':'mdi:weather-rainy',
'snow':'mdi:weather-snowy',
'sleet':'mdi:weather-snowy-rainy'} %}
{{ farray[states('sensor.darksky_weather_icon_7d')] }}
weather_high_temp_1d:
value_template: "{{ states('sensor.darksky_weather_daytime_high_temperature_1d') | round(0) }}"
weather_high_temp_2d:
value_template: "{{ states('sensor.darksky_weather_daytime_high_temperature_2d') | round(0) }}"
weather_high_temp_3d:
value_template: "{{ states('sensor.darksky_weather_daytime_high_temperature_3d') | round(0) }}"
weather_high_temp_4d:
value_template: "{{ states('sensor.darksky_weather_daytime_high_temperature_4d') | round(0) }}"
weather_high_temp_5d:
value_template: "{{ states('sensor.darksky_weather_daytime_high_temperature_5d') | round(0) }}"
weather_low_temp_1d:
value_template: "{{ states('sensor.darksky_weather_overnight_low_temperature_1d') | round(0) }}"
weather_low_temp_2d:
value_template: "{{ states('sensor.darksky_weather_overnight_low_temperature_2d') | round(0) }}"
weather_low_temp_3d:
value_template: "{{ states('sensor.darksky_weather_overnight_low_temperature_3d') | round(0) }}"
weather_low_temp_4d:
value_template: "{{ states('sensor.darksky_weather_overnight_low_temperature_4d') | round(0) }}"
weather_low_temp_5d:
value_template: "{{ states('sensor.darksky_weather_overnight_low_temperature_5d') | round(0) }}"
weather_both_temp_1d:
value_template: "{{ states('sensor.weather_high_temp_1d') }}{{'/'}}{{ states('sensor.weather_low_temp_1d') }}"
weather_both_temp_2d:
value_template: "{{ states('sensor.weather_high_temp_2d') }}{{'/'}}{{ states('sensor.weather_low_temp_2d') }}"
weather_both_temp_3d:
value_template: "{{ states('sensor.weather_high_temp_3d') }}{{'/'}}{{ states('sensor.weather_low_temp_3d') }}"
weather_both_temp_4d:
value_template: "{{ states('sensor.weather_high_temp_4d') }}{{'/'}}{{ states('sensor.weather_low_temp_4d') }}"
weather_both_temp_5d:
value_template: "{{ states('sensor.weather_high_temp_5d') }}{{'/'}}{{ states('sensor.weather_low_temp_5d') }}"
weather_wind_0d:
value_template: "{{ states('sensor.darksky_weather_wind_speed_0d') | float | round(1) }}"
unit_of_measurement: 'mph'
weather_wind_1d:
value_template: "{{ states('sensor.darksky_weather_wind_speed_1d') | float | round(1) }}"
weather_wind_2d:
value_template: "{{ states('sensor.darksky_weather_wind_speed_2d') | float | round(1) }}"
weather_wind_3d:
value_template: "{{ states('sensor.darksky_weather_wind_speed_3d') | float | round(1) }}"
weather_wind_4d:
value_template: "{{ states('sensor.darksky_weather_wind_speed_4d') | float | round(1) }}"
weather_wind_5d:
value_template: "{{ states('sensor.darksky_weather_wind_speed_5d') | float | round(1) }}"
weather_wind_dir_0d:
value_template: >
{% set dir = states('sensor.darksky_weather_wind_bearing')|float %}
{% if 11.25 < dir <= 33.75 %} NNE
{% elif 33.75 < dir <= 56.25 %} NE
{% elif 56.25 < dir <= 78.75 %} ENE
{% elif 78.75 < dir <= 101.25 %} E
{% elif 101.25 < dir <= 123.75 %} ESE
{% elif 123.75 < dir <= 146.25 %} SE
{% elif 146.25 < dir <= 168.75 %} SSE
{% elif 168.75 < dir <= 191.25 %} S
{% elif 191.25 < dir <= 213.75 %} SSW
{% elif 213.75 < dir <= 236.25 %} SW
{% elif 236.25 < dir <= 258.75 %} WSW
{% elif 258.75 < dir <= 281.25 %} W
{% elif 281.25 < dir <= 303.75 %} WNW
{% elif 303.75 < dir <= 326.25 %} NW
{% elif 326.25 < dir <= 348.75 %} NNW
{% else %} N
{% endif %}
weather_wind_dir_1d:
value_template: >
{% set dir = states('sensor.darksky_weather_wind_bearing_1d')|float %}
{% if 11.25 < dir <= 33.75 %} NNE
{% elif 33.75 < dir <= 56.25 %} NE
{% elif 56.25 < dir <= 78.75 %} ENE
{% elif 78.75 < dir <= 101.25 %} E
{% elif 101.25 < dir <= 123.75 %} ESE
{% elif 123.75 < dir <= 146.25 %} SE
{% elif 146.25 < dir <= 168.75 %} SSE
{% elif 168.75 < dir <= 191.25 %} S
{% elif 191.25 < dir <= 213.75 %} SSW
{% elif 213.75 < dir <= 236.25 %} SW
{% elif 236.25 < dir <= 258.75 %} WSW
{% elif 258.75 < dir <= 281.25 %} W
{% elif 281.25 < dir <= 303.75 %} WNW
{% elif 303.75 < dir <= 326.25 %} NW
{% elif 326.25 < dir <= 348.75 %} NNW
{% else %} N
{% endif %}
weather_wind_dir_2d:
value_template: >
{% set dir = states('sensor.darksky_weather_wind_bearing_2d')|float %}
{% if 11.25 < dir <= 33.75 %} NNE
{% elif 33.75 < dir <= 56.25 %} NE
{% elif 56.25 < dir <= 78.75 %} ENE
{% elif 78.75 < dir <= 101.25 %} E
{% elif 101.25 < dir <= 123.75 %} ESE
{% elif 123.75 < dir <= 146.25 %} SE
{% elif 146.25 < dir <= 168.75 %} SSE
{% elif 168.75 < dir <= 191.25 %} S
{% elif 191.25 < dir <= 213.75 %} SSW
{% elif 213.75 < dir <= 236.25 %} SW
{% elif 236.25 < dir <= 258.75 %} WSW
{% elif 258.75 < dir <= 281.25 %} W
{% elif 281.25 < dir <= 303.75 %} WNW
{% elif 303.75 < dir <= 326.25 %} NW
{% elif 326.25 < dir <= 348.75 %} NNW
{% else %} N
{% endif %}
weather_wind_dir_3d:
value_template: >
{% set dir = states('sensor.darksky_weather_wind_bearing_3d')|float %}
{% if 11.25 < dir <= 33.75 %} NNE
{% elif 33.75 < dir <= 56.25 %} NE
{% elif 56.25 < dir <= 78.75 %} ENE
{% elif 78.75 < dir <= 101.25 %} E
{% elif 101.25 < dir <= 123.75 %} ESE
{% elif 123.75 < dir <= 146.25 %} SE
{% elif 146.25 < dir <= 168.75 %} SSE
{% elif 168.75 < dir <= 191.25 %} S
{% elif 191.25 < dir <= 213.75 %} SSW
{% elif 213.75 < dir <= 236.25 %} SW
{% elif 236.25 < dir <= 258.75 %} WSW
{% elif 258.75 < dir <= 281.25 %} W
{% elif 281.25 < dir <= 303.75 %} WNW
{% elif 303.75 < dir <= 326.25 %} NW
{% elif 326.25 < dir <= 348.75 %} NNW
{% else %} N
{% endif %}
weather_wind_dir_4d:
value_template: >
{% set dir = states('sensor.darksky_weather_wind_bearing_4d')|float %}
{% if 11.25 < dir <= 33.75 %} NNE
{% elif 33.75 < dir <= 56.25 %} NE
{% elif 56.25 < dir <= 78.75 %} ENE
{% elif 78.75 < dir <= 101.25 %} E
{% elif 101.25 < dir <= 123.75 %} ESE
{% elif 123.75 < dir <= 146.25 %} SE
{% elif 146.25 < dir <= 168.75 %} SSE
{% elif 168.75 < dir <= 191.25 %} S
{% elif 191.25 < dir <= 213.75 %} SSW
{% elif 213.75 < dir <= 236.25 %} SW
{% elif 236.25 < dir <= 258.75 %} WSW
{% elif 258.75 < dir <= 281.25 %} W
{% elif 281.25 < dir <= 303.75 %} WNW
{% elif 303.75 < dir <= 326.25 %} NW
{% elif 326.25 < dir <= 348.75 %} NNW
{% else %} N
{% endif %}
weather_wind_dir_5d:
value_template: >
{% set dir = states('sensor.darksky_weather_wind_bearing_5d')|float %}
{% if 11.25 < dir <= 33.75 %} NNE
{% elif 33.75 < dir <= 56.25 %} NE
{% elif 56.25 < dir <= 78.75 %} ENE
{% elif 78.75 < dir <= 101.25 %} E
{% elif 101.25 < dir <= 123.75 %} ESE
{% elif 123.75 < dir <= 146.25 %} SE
{% elif 146.25 < dir <= 168.75 %} SSE
{% elif 168.75 < dir <= 191.25 %} S
{% elif 191.25 < dir <= 213.75 %} SSW
{% elif 213.75 < dir <= 236.25 %} SW
{% elif 236.25 < dir <= 258.75 %} WSW
{% elif 258.75 < dir <= 281.25 %} W
{% elif 281.25 < dir <= 303.75 %} WNW
{% elif 303.75 < dir <= 326.25 %} NW
{% elif 326.25 < dir <= 348.75 %} NNW
{% else %} N
{% endif %}
weather_wind_both_0d:
value_template: "{{ states('sensor.weather_wind_0d')|round(0) }}{{' '}}{{ states('sensor.weather_wind_dir_0d') }}"
weather_wind_both_1d:
value_template: "{{ states('sensor.weather_wind_1d')|round(0) }}{{' '}}{{ states('sensor.weather_wind_dir_1d') }}"
weather_wind_both_2d:
value_template: "{{ states('sensor.weather_wind_2d')|round(0) }}{{' '}}{{ states('sensor.weather_wind_dir_2d') }}"
weather_wind_both_3d:
value_template: "{{ states('sensor.weather_wind_3d')|round(0) }}{{' '}}{{ states('sensor.weather_wind_dir_3d') }}"
weather_wind_both_4d:
value_template: "{{ states('sensor.weather_wind_4d')|round(0) }}{{' '}}{{ states('sensor.weather_wind_dir_4d') }}"
weather_wind_both_5d:
value_template: "{{ states('sensor.weather_wind_5d')|round(0) }}{{' '}}{{ states('sensor.weather_wind_dir_5d') }}"
darksky_precipiation_0d:
friendly_name: Precipitation 0d
value_template: >
{% set rain = state_attr('weather.dark_sky','forecast')[0].precipitation %}
{% if rain | float == 0 %}
{{ '' }}
{% elif (rain | float) >= 1 %}
{{rain}}{{ '"' }}
{% else %}
{{ "." }}{{ ((rain * 10) | round(0)) }}{{ '"' }}
{% endif %}
darksky_precipiation_1d:
friendly_name: Precipitation 1d
value_template: >
{% set rain = state_attr('weather.dark_sky','forecast')[1].precipitation %}
{% if rain | float == 0 %}
{{ '' }}
{% elif (rain | float) >= 1 %}
{{rain}}{{ '"' }}
{% else %}
{{ "." }}{{ ((rain * 10) | round(0)) }}{{ '"' }}
{% endif %}
darksky_precipiation_2d:
friendly_name: Precipitation 2d
value_template: >
{% set rain = state_attr('weather.dark_sky','forecast')[2].precipitation %}
{% if rain | float == 0 %}
{{ '' }}
{% elif (rain | float) >= 1 %}
{{rain}}{{ '"' }}
{% else %}
{{ "." }}{{ ((rain * 10) | round(0)) }}{{ '"' }}
{% endif %}
darksky_precipiation_3d:
friendly_name: Precipitation 3d
value_template: >
{% set rain = state_attr('weather.dark_sky','forecast')[3].precipitation %}
{% if rain | float == 0 %}
{{ '' }}
{% elif (rain | float) >= 1 %}
{{rain}}{{ '"' }}
{% else %}
{{ "." }}{{ ((rain * 10) | round(0)) }}{{ '"' }}
{% endif %}
darksky_precipiation_4d:
friendly_name: Precipitation 4d
value_template: >
{% set rain = state_attr('weather.dark_sky','forecast')[4].precipitation %}
{% if rain | float == 0 %}
{{ '' }}
{% elif (rain | float) >= 1 %}
{{rain}}{{ '"' }}
{% else %}
{{ "." }}{{ ((rain * 10) | round(0)) }}{{ '"' }}
{% endif %}
darksky_precipiation_5d:
friendly_name: Precipitation 5d
value_template: >
{% set rain = state_attr('weather.dark_sky','forecast')[5].precipitation %}
{% if rain | float == 0 %}
{{ '' }}
{% elif (rain | float) >= 1 %}
{{rain}}{{ '"' }}
{% else %}
{{ "." }}{{ ((rain * 10) | round(0)) }}{{ '"' }}
{% endif %}
darksky_precipiation_6d:
friendly_name: Precipitation 6d
value_template: >
{% set rain = state_attr('weather.dark_sky','forecast')[6].precipitation %}
{% if rain | float == 0 %}
{{ '' }}
{% elif (rain | float) >= 1 %}
{{rain}}{{ '"' }}
{% else %}
{{ "." }}{{ ((rain * 10) | round(0)) }}{{ '"' }}
{% endif %}
darksky_precipiation_7d:
friendly_name: Precipitation 7d
value_template: >
{% set rain = state_attr('weather.dark_sky','forecast')[7].precipitation %}
{% if rain | float == 0 %}
{{ '' }}
{% elif (rain | float) >= 1 %}
{{rain}}{{ '"' }}
{% else %}
{{ "." }}{{ ((rain * 10) | round(0)) }}{{ '"' }}
{% endif %}
ui-lovelace.yaml
## Weather Forecast Card
- type: custom:stack-in-card
mode: vertical
cards:
- type: weather-forecast
entity: weather.dark_sky
name: "Colleyville, TX"
show_forecast: false
style: |
.header {
padding-top: 12px !important;
}
.content {
padding-bottom: 12px !important;
}
- type: glance
columns: 1
show_icon: false
show_name: false
style: |
ha-card {
margin-top: -35px !important;
margin-bottom: 5px !important;
}
entities:
- entity: sensor.darksky_weather_summary_0d
## Today Weather Details - Names
- type: glance
columns: 4
show_icon: false
show_state: false
style: |
ha-card {
margin-top: -30px !important;
margin-bottom: -5px !important;
font-size: 10px;
color: #9da5b4;
}
entities:
- entity: sensor.darksky_weather_humidity
name: Humiditiy
- entity: sensor.weather_wind_0d
name: Wind
- entity: sensor.weather_wind_dir_0d
name: Direction
- entity: sensor.darksky_precipiation_0d
name: Precip.
## Today Weather Details - Values
- type: glance
columns: 4
show_icon: false
show_name: false
style: |
ha-card {
margin-top: -30px !important;
margin-bottom: 0px !important;
}
entities:
- entity: sensor.darksky_weather_humidity
- entity: sensor.weather_wind_0d
- entity: sensor.weather_wind_dir_0d
- entity: sensor.darksky_precipiation_0d
## Forecast ##
## Weather Days
- type: glance
columns: 5
show_icon: false
show_name: false
style: |
ha-card {
margin-top: -5px !important;
margin-bottom: -5px !important;
padding-top: -15px;
border-top: 5px solid #222;
}
.entities { padding-top: 10px !important; }
div {
/* color: #9da5b4; */
}
entities:
- entity: sensor.date_1d
- entity: sensor.date_2d
- entity: sensor.date_3d
- entity: sensor.date_4d
- entity: sensor.date_5d
## Weather Icons
- type: glance
columns: 5
show_name: false
show_state: false
style: |
ha-card {
margin-top: -40px !important;
margin-bottom: 0px !important;
}
entities:
- entity: sensor.date_1d
- entity: sensor.date_2d
- entity: sensor.date_3d
- entity: sensor.date_4d
- entity: sensor.date_5d
## Weather Both Temp
- type: glance
columns: 5
show_name: false
show_icon: false
style: |
ha-card {
margin-top: -38px !important;
margin-bottom: 0px !important;
}
div {
color: #9da5b4 !important;
font-size: 14px;
}
entities:
- entity: sensor.weather_both_temp_1d
- entity: sensor.weather_both_temp_2d
- entity: sensor.weather_both_temp_3d
- entity: sensor.weather_both_temp_4d
- entity: sensor.weather_both_temp_5d
## Weather Rain
- type: glance
columns: 5
show_name: false
show_icon: false
style: |
ha-card {
margin-top: -32px !important;
margin-bottom: 0px !important;
}
div {
color: #4c709d !important;
font-size: 14px;
}
entities:
- entity: sensor.darksky_precipiation_1d
- entity: sensor.darksky_precipiation_2d
- entity: sensor.darksky_precipiation_3d
- entity: sensor.darksky_precipiation_4d
- entity: sensor.darksky_precipiation_5d
## Weather Wind Both
- type: glance
columns: 5
show_name: false
show_icon: false
style: |
ha-card {
margin-top: -33px !important;
margin-bottom: -5px !important;
}
div {
color: #777 !important;
font-size: 12px;
}
entities:
- entity: sensor.weather_wind_both_1d
- entity: sensor.weather_wind_both_2d
- entity: sensor.weather_wind_both_3d
- entity: sensor.weather_wind_both_4d
- entity: sensor.weather_wind_both_5d