Custom Dark Sky Animated Weather Card

To your card in the UI Editor.

See https://github.com/iammexx/home-assistant-config/blob/master/ui/darksky/README.md

Thanks but nothing change?

ahh!

i add:

entity_sun: sun.sun
entity_visibility: sensor.dark_sky_visibility
entity_daytime_high: sensor.dark_sky_daytime_high_temperature_0
entity_wind_bearing: sensor.dark_sky_wind_bearing
entity_wind_speed: sensor.dark_sky_wind_speed
entity_humidity: sensor.dark_sky_humidity
entity_pressure: sensor.dark_sky_pressure
entity_apparent_temp: sensor.dark_sky_apparent_temperature
entity_daily_summary: sensor.dark_sky_daily_summary
entity_pop: sensor.dark_sky_precip_probability
entity_pop_intensity: sensor.dark_sky_precip_intensity
entity_pop_1: sensor.dark_sky_precip_probability_1
entity_pop_2: sensor.dark_sky_precip_probability_2
entity_pop_3: sensor.dark_sky_precip_probability_3
entity_pop_4: sensor.dark_sky_precip_probability_4
entity_pop_5: sensor.dark_sky_precip_probability_5

and now it’s work! thanks!

1 Like

Hello,
Sorry for the late reply. I was able to test it only today.
So, I have updated to Hass.io 0.88.2 and used the latest version of the card (0.10.2) and still have issues with automatic update.
The chrome debugger throws me these errors


Hope it can be helpful to solve this problem !

I got the TypeError messages. It appears to be about some Polymer elements remaining in Lovelace.

See https://github.com/home-assistant/home-assistant-polymer/issues/2095

OK, So that helps narrow it down…

based on the exception it looks like the issue is on line 735 which is this:

if (this.config.entity_pop && !this.config.alt_pop) { root.getElementById("pop-text").textContent = `${Math.round(this._hass.states[this.config.entity_pop].state)}` }

So that line is looking to find the “pop” current value somewhere in the card. Its doing that because you have entity_pop defined in your configuration.

The issue I see based on your screen shot of the card is that you are not showing “pop”. I am guessing you are using the slot configuration flags for all eight slots with some of them set to “empty” or “remove” and none of them set to “pop”.

Therefore you are telling the card you want to use pop but then not showing it. Remove the entity_pop: line from your configuration and see if that helps. Based on your card screen shot you should also make sure you are not defining any of the other optional entities that you are not showing. (entity_sun and entity_daytime_high) as they will have the same issue.

In a future version of the card I will add some logic to prevent it from trying to update items that are intentionally hidden while still being configured.

2 Likes

Yes ! That was it ! thank you so much for your help and patience !

I would like to suggest you two things to improve your card:

  • “Feels like” translation in French should be “Température ressentie” or simply “Ressenti”
  • What about a card “name” or “title” to add the location on top of the card ?

Once again, thank you and great job !

image

This is all i get. I followed the most recent instructions but for the life of me cannot get this card to load.

EDIT: Got it working by not using a couple sensors

Disregard, i got it working

Great card! Thank you for your efforts.

I’ve been having a problem using both the conditional card and the custom:state-switch with the Dark Sky Weather Card. If the DS Weather Card is being displayed the conditional/state-switch cards require a refresh to work. They work initially and after a couple of minutes they stop working. Refresh allows them to work again.

If I comment out the DS Weather Card the conditional/state-switch cards works fine.
Is this a known problem? Is there a fix?

Hi, i think you should have it under sensor: not under weather:

A quote from the Dark Sky Weather Card configuration

  1. Add the Dark Sky sensor platform to your configuration.yaml or sensors.yaml or wherever you keep your sensor configuration.
1 Like

I haven’t heard of that issue before…

As far as I am aware one custom card should not be able to interfere with another. Especially in a way where it works for a while and then stops working. What hardware are you running HA on (Also what HW are you using to browse from). It’s possible that both cards are trying to refresh too fast and are consuming to much CPU.

There is a Refresh_Interval flag that you can set on the Dark Sky Weather Card that will slow down how fast it attempts to refresh card data. It defaults to 30 seconds but you can set it to however long you want. As weather data changes very slowly it is safe to set the value much higher (say 300 - which would be 5 minutes). Try changing that to see if it makes a difference. If not, I am unsure what the issue would be.

Yeah I fixed it since then, all is working now…

Yes this certainly is strange. I’m running Hassbian on a rPi3, and just this morning updated to 0.89.0b3 I believe that I implemented the conditional cards in 0.88 Tried on both Firefox & Chrome from my laptop Windows 10.

I found the refresh_interval flag and set it to 60, 120 & 180 seconds, I also put the Weather Card on a condition card so I could measure the time of when the buttons stop working. I have 3 buttons that show/hide 3 cards. It looks like I can successfully toggle the conditional cards for exactly the refresh rate before it stops working.

Does this help?
Uncaught (in promise) TypeError: Cannot set property ‘textContent’ of null
at HTMLElement.updateValues (dark-sky-weather-card.js:734)
at HTMLElement.set hass [as hass] (dark-sky-weather-card.js:698)
at HTMLElement.set hass [as hass] (state-switch.js:65)
at HTMLElement.set hass [as hass] (401352253e833b70a294.chunk.js:3615)
at _cards.forEach.element (401352253e833b70a294.chunk.js:5693)
at Array.forEach ()
at HTMLElement.updated (401352253e833b70a294.chunk.js:5693)
at HTMLElement.performUpdate (app-a285b20d.js:93)
at HTMLElement._enqueueUpdate (app-a285b20d.js:93)

I doubt the developer has the spare time to work with beta software.

Can you post a print screen of your card ? This is similar to the issue resolved here. although it presents in a slightly different way.

1 Like

LOL, I was just reading that and remembered removing POP about the same time this all started.

I removed these lines from my configuration and it’s been working now for 10 minutes!
entity_visibility: sensor.dark_sky_visibility
entity_pop: sensor.dark_sky_precip_probability
entity_pop_intensity: sensor.dark_sky_precip_intensity

Thank you so much for guiding me in the right direction.

Here’s the image you asked for

I’m not sure is this the place to ask this but is there a way to translate
Feels like, Today’s High, Bft, SSW… and other english words.
Most are in their own language (Finnish), but a couple of strings have not been translated.
I think i could hard code it in the js-file but that wouldn’t be very smart.

I probably should use something like iammexx has in his instructions (Example template sensors) but i don’t now what entities and whatnot to put there.

Example template sensors:

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]}}