Custom Dark Sky Animated Weather Card

Thank you. I see no sensor. entries for dark_sky_ which may explain the issue.

My customize.yaml is below, which includes and include for sensors.yaml.

homeassistant:
  name: Home
  unit_system: imperial
  time_zone: America/New_York
  customize: !include customize.yaml

lovelace:
  mode: yaml

# Configure a default setup of Home Assistant (frontend, api, etc)
default_config:

group: !include groups.yaml
automation: !include automations.yaml
script: !include scripts.yaml
sensors: !include sensors.yaml

Try changing update_interval to scan_interval in your sensors.yaml and restart HA. There was a breaking change to the dark sky platform a version or so ago that changed this.

The card code you are showing is months out of date ā€¦

Use the latest version of the card. There are links to it and current instructions for setting it up in the first post of this thread.

Thanks no change.

If you click the info icon (the i with a circle around it) in the developer tools panel to see the log are there any messages in it about dark sky ?

The only other thing I can think of is that you are using !secret for the API Key. I donā€™t do that in mine I just have the actual API keyā€¦

Thanks. Nothing about dark sky in that log. Next step is for me to delete everything and start over, re, dark sky card. Will let you know. Thanks again.

Iā€™m not sure about anyone else, but I keep receiving the following error: Please remove [value_template]. (See /home/offspring/.homeassistant/sensors.yaml, line 0).

The line itā€™s complaining about is seen here:

  value_template: >
                {% if is_state("sensor.dark_sky_icon","clear-day") %} Clear
                {% elif is_state("sensor.dark_sky_icon","clear-night") %} Clear
                {% elif is_state("sensor.dark_sky_icon","rain") %} Rain
                {% elif is_state("sensor.dark_sky_icon","snow") %} Snowy
                {% elif is_state("sensor.dark_sky_icon","fog") %} Foggy
                {% elif is_state("sensor.dark_sky_icon","sleet") %} Sleet
                {% elif is_state("sensor.dark_sky_icon","wind") %} Windy
                {% elif is_state("sensor.dark_sky_icon","cloudy") %} Cloudy
                {% elif is_state("sensor.dark_sky_icon","partly-cloudy-day") %} Partly Cloudy
                {% elif is_state("sensor.dark_sky_icon","partly-cloudy-night") %} Partly Cloudy
                {% elif is_state("sensor.dark_sky_icon","hail") %} Hailing
                {% elif is_state("sensor.dark_sky_icon","lightning") %} Lightning
                {% elif is_state("sensor.dark_sky_icon","thunderstorm") %} Thunderstorm
                    #  dark_sky_alt_wind:
                  value_template: >
                {% set winddir = ['North','North-Northeast','Northeast','East-Northeast','East','East-Southeast','Southeast','South-Southeast','South','South-Southwest','Southwest','West-Southwest','West','West-Northwest','Northwest','North-Northwest','North'] %}
                {{ states('sensor.dark_sky_wind_speed') | round }} mi/h from the {{ winddir[((states('sensor.dark_sky_wind_bearing') | float / 360)*16) | round]}}

Has anyone else seen this, and know how to resolve the issue properly?

It looks like you have commented out the next template name so value_template: > appears twice in the same template.

# dark_sky_alt_wind:

Yeah, I commented that out because HA was complaining about that as well.

Itā€™d complain about that line because youā€™re missing the {% endif %}

1 Like

Hi, m.p.frankland,
I have followed the latest instructions, but itā€™s still not working, would you let me know where I have gone wrong. I am getting this error;

This is whatā€™s in my ui-lovelace.yaml;

  - url: /local/custom_ui/dark-sky-weather-card.js?v=7.1
    type: module

  - type: 'custom:dark-sky-weather-card'
    entity_current_conditions: sensor.dark_sky_icon
    entity_temperature: sensor.dark_sky_temperature
    entity_forecast_high_temp_1: sensor.dark_sky_daytime_high_temperature_1
    entity_forecast_high_temp_2: sensor.dark_sky_daytime_high_temperature_2
    entity_forecast_high_temp_3: sensor.dark_sky_daytime_high_temperature_3
    entity_forecast_high_temp_4: sensor.dark_sky_daytime_high_temperature_4
    entity_forecast_high_temp_5: sensor.dark_sky_daytime_high_temperature_5
    entity_forecast_icon_1: sensor.dark_sky_icon_1
    entity_forecast_icon_2: sensor.dark_sky_icon_2
    entity_forecast_icon_3: sensor.dark_sky_icon_3
    entity_forecast_icon_4: sensor.dark_sky_icon_4
    entity_forecast_icon_5: sensor.dark_sky_icon_5
    entity_forecast_low_temp_1: sensor.dark_sky_overnight_low_temperature_0
    entity_forecast_low_temp_2: sensor.dark_sky_overnight_low_temperature_1
    entity_forecast_low_temp_3: sensor.dark_sky_overnight_low_temperature_2
    entity_forecast_low_temp_4: sensor.dark_sky_overnight_low_temperature_3
    entity_forecast_low_temp_5: sensor.dark_sky_overnight_low_temperature_4
    entity_summary_1: sensor.dark_sky_summary_1
    entity_summary_2: sensor.dark_sky_summary_2
    entity_summary_3: sensor.dark_sky_summary_3
    entity_summary_4: sensor.dark_sky_summary_4
    entity_summary_5: sensor.dark_sky_summary_5

This is my configuration.yaml;

sensor:
  - platform: darksky
    api_key: !secret darksky_api_key
    forecast:
      - 0
      - 1
      - 2
      - 3
      - 4
      - 5
    monitored_conditions:
      - icon
      - summary
      - nearest_storm_distance
      - nearest_storm_bearing
      - humidity
      - temperature
      - temperature_high
      - temperature_low
      - apparent_temperature
      - apparent_temperature_high
      - apparent_temperature_low
      - wind_speed
      - wind_bearing
      - precip_type
      - precip_probability
      - precip_accumulation
      - precip_intensity
      - precip_intensity_max
      - uv_index
      - daily_summary
      - pressure
      - visibility
    scan_interval:
      minutes: 5

The beginning of your lovelace-ui.yaml should look like this:

resources:
  - type: module
    url: /local/custom_ui/dark-sky-weather-card.js?v=7.1

You appear to be missing the resources: line.

I seem to have not included it in my original copy/paste. I went to go add it, but itā€™s right there. Hereā€™s a new copy/paste of the entire section, which does show the proper {% endif %}

- platform: darksky
  api_key: !secret darksky
  forecast:
- 0
- 1
- 2
- 3
- 4
- 5
  monitored_conditions:
- icon
- summary
- nearest_storm_distance
- nearest_storm_bearing
- humidity
- temperature
- temperature_high
- temperature_low
- apparent_temperature
- apparent_temperature_high
- apparent_temperature_low
- wind_speed
- wind_bearing
- precip_type
- precip_probability
- precip_accumulation
- precip_intensity
- precip_intensity_max
- uv_index
- daily_summary
- pressure
- visibility
  scan_interval:
minutes: 5
#  dark_sky_current_text:
  value_template: >
                {% if is_state("sensor.dark_sky_icon","clear-day") %} Clear 
                {% elif is_state("sensor.dark_sky_icon","clear-night") %} Clear 
                {% elif is_state("sensor.dark_sky_icon","rain") %} Rain
                {% elif is_state("sensor.dark_sky_icon","snow") %} Snowy
                {% elif is_state("sensor.dark_sky_icon","fog") %} Foggy
                {% elif is_state("sensor.dark_sky_icon","sleet") %} Sleet
                {% elif is_state("sensor.dark_sky_icon","wind") %} Windy
                {% elif is_state("sensor.dark_sky_icon","cloudy") %} Cloudy
                {% elif is_state("sensor.dark_sky_icon","partly-cloudy-day") %} Partly Cloudy
                {% elif is_state("sensor.dark_sky_icon","partly-cloudy-night") %} Partly Cloudy
                {% elif is_state("sensor.dark_sky_icon","hail") %} Hailing
                {% elif is_state("sensor.dark_sky_icon","lightning") %} Lightning
                {% elif is_state("sensor.dark_sky_icon","thunderstorm") %} Thunderstorm
                {% endif %}
                     
                    #  dark_sky_alt_wind:
  value_template: >
                {% set winddir = ['North','North-Northeast','Northeast','East-Northeast','East','East-Southeast','Southeast','South-Southeast','South','South-Southwest','Southwest','West-Southwest','West','West-Northwest','Northwest','North-Northwest','North'] %}
                {{ states('sensor.dark_sky_wind_speed') | round }} mi/h from the {{ winddir[((states('sensor.dark_sky_wind_bearing') | float / 360)*16) | round]}}
# Weather prediction
- platform: yr

As I mentioned below, you have commented out the name of the template sensor

Based on your last post you have also commented out the 1st template sensor

#  dark_sky_current_text:

That leaves you with two value_template statements in the middle of your configuration with no template sensor names to associate them with which is why you are getting your current error.

You also mention that you commented these lines out because you were getting an error on those lines

You havenā€™t posted what that error is, but it is likely because you have stuck the template sensors in the middle of your configuration immediately below your dark sky configuration without defining the template platform.

The template platform should start like this

  - platform: template
    sensors:

with the templates defined below it.

I would suggest reviewing the HA documentation on template sensors to see other examples of how they work. You can find it here.

Also, please note that the two template sensors you are adding are only examples and are only needed under certain conditions based on how you configure the card. The readme for the card has details on this.

Iā€™m not sure what the problem was before, but the error was something to the effect of ā€œthese are no longer supported post .88, and previously we didnā€™t complainā€. I went and uncommented them and now all of a sudden HA seems to be fine with them.

I know theyā€™re only examples, but that was how I got the card to show up with all of the data/mouseover tooltips.

Hi bosborne,
I do have the resources: line, itā€™s just slightly higher up. I do have the type and the url the other way around, does that matter?

That may matter. I have not worked enough with Home Assistant to know.

No. Either order is fine. All of mine are just like yours.

1 Like

I got the error to re-appear:

Your configuration contains extra keys that the platform does not support. Please remove [dark_sky_current_text], [dark_sky_alt_wind]. (See /home/offspring/.homeassistant/sensors.yaml, line 0).

9:26 PM helpers/config_validation.py (WARNING)

As explained here

Without it, HA thinks you are adding tempate sensors to the dark sky platform which it doesnt support.

This is based on the posting of your config you provided here:


I seem to have not included it in my original copy/paste. I went to go add it, but itā€™s right there. Hereā€™s a new copy/paste of the entire section, which does show the proper {% endif %}

- platform: darksky
  api_key: !secret darksky
  forecast:
- 0
- 1
- 2
- 3
- 4
- 5
  monitored_conditions:
- icon
- summary
- nearest_storm_distance
- nearest_storm_bearing
- humidity
- temperature
- temperature_high
- temperature_low
- apparent_temperature
- apparent_temperature_high
- apparent_temperature_low
- wind_speed
- wind_bearing
- precip_type
- precip_probability
- precip_accumulation
- precip_intensity
- precip_intensity_max
- uv_index
- daily_summary
- pressure
- visibility
  scan_interval:
minutes: 5
#  dark_sky_current_text:
  value_template: >
                {% if is_state("sensor.dark_sky_icon","clear-day") %} Clear 
                {% elif is_state("sensor.dark_sky_icon","clear-night") %} Clear 
                {% elif is_state("sensor.dark_sky_icon","rain") %} Rain
                {% elif is_state("sensor.dark_sky_icon","snow") %} Snowy
                {% elif is_state("sensor.dark_sky_icon","fog") %} Foggy
                {% elif is_state("sensor.dark_sky_icon","sleet") %} Sleet
                {% elif is_state("sensor.dark_sky_icon","wind") %} Windy
                {% elif is_state("sensor.dark_sky_icon","cloudy") %} Cloudy
                {% elif is_state("sensor.dark_sky_icon","partly-cloudy-day") %} Partly Cloudy
                {% elif is_state("sensor.dark_sky_icon","partly-cloudy-night") %} Partly Cloudy
                {% elif is_state("sensor.dark_sky_icon","hail") %} Hailing
                {% elif is_state("sensor.dark_sky_icon","lightning") %} Lightning
                {% elif is_state("sensor.dark_sky_icon","thunderstorm") %} Thunderstorm
                {% endif %}
                     
                    #  dark_sky_alt_wind:
  value_template: >
                {% set winddir = ['North','North-Northeast','Northeast','East-Northeast','East','East-Southeast','Southeast','South-Southeast','South','South-Southwest','Southwest','West-Southwest','West','West-Northwest','Northwest','North-Northwest','North'] %}
                {{ states('sensor.dark_sky_wind_speed') | round }} mi/h from the {{ winddir[((states('sensor.dark_sky_wind_bearing') | float / 360)*16) | round]}}
# Weather prediction
- platform: yr

Note how you do not have a

- platform: template
  sensors:

After the end of your dark sky configuration and before you define the template sensors.

1 Like