Custom Dark Sky Animated Weather Card

Get the latest update for the card (link below). There was something that was stopping that url from working. I think it was done by unpkg themeselves. The latest update to the card looks like it gets lit-element from somewhere in HA itself.

https://raw.githubusercontent.com/iammexx/home-assistant-config/master/ui/darksky/dark-sky-weather-card.js

I have

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

Can see a card, but any time I hit refresh error in log:

Log Details (ERROR)

Wed Jan 30 2019 21:23:45 GMT-0500 (Eastern Standard Time)

https://xxxxxxxxx.duckdns.org/local/custom_ui/dark-sky-weather-card.js?v=7.1:682:0 NotSupportedError: Operation is not supported

You have version 7.1. Latest is 8.3.

Changed to 8.3.

Log Details (ERROR)

Wed Jan 30 2019 22:00:15 GMT-0500 (Eastern Standard Time)

https://xxxxxxxxx.duckdns.org/local/custom_ui/dark-sky-weather-card.js?v=8.3:682:0 NotSupportedError: Operation is not supported

Unless you are using the card tracker card and scripts the version number isn’t relevant. It used to be that the number needed to change everytime you wanted to load a new version of the card. That is not the case anymore. As mentioned above the card tracker does use the version number to know what version it thinks you have and compares it to the version number on github. If you are not using card tracker then the v= number can be anything you want and will likely be different for each person using the card depending on when they stopped incrementing it to get new versions of the card to load.

Line 682 is

customElements.define('dark-sky-weather-card', DarkSkyWeatherCard);

Which is the command to register the card in HA / Lovelace.

Are there any errors in the chrome developer tools console?

Not using card tracker card.
I’ll check chrome developer tools console.

Commented out

custom_ui: local

in customizer:
and error stop appearing in log

I’ve fought with getting this to work for this whole week and I’ve given up fighting on my own. Hopefully someone here can figure out what’s going on. I’m running Hassio 0.86.3. I’ve updated to dark-sky-card.js v8.3. I’ve cleared out everything on my lovelace editor to only display this. I fought past the card doesn’t exist errors and now I’m to a blank screen. I get the tab named “weather” and one with the mdi cloudy icon, but neither have anything in them. Running this in chrome.

Lovelace raw config editor:

resources:
  - url: /local/custom_ui/dark-sky-weather-card.js?v=8.3
title: Home Assistant
type: module
views:
  - icon: 'mdi:weather-cloudy'
  - cards: null
entity_apparent_temp: sensor.dark_sky_apparent_temperature
entity_current_conditions: sensor.dark_sky_icon
entity_current_text: sensor.dark_sky_current_text
entity_daily_summary: sensor.dark_sky_daily_summary
entity_daytime_high: sensor.dark_sky_daytime_high_temperature_0
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_humidity: sensor.dark_sky_humidity
entity_pop: sensor.dark_sky_precip_probability
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
entity_pop_intensity: sensor.dark_sky_precip_intensity
entity_pressure: sensor.dark_sky_pressure
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
entity_sun: sun.sun
entity_temperature: sensor.dark_sky_temperature
entity_visibility: sensor.dark_sky_visibility
entity_wind_bearing: sensor.dark_sky_wind_bearing
entity_wind_speed: sensor.dark_sky_wind_speed
locale: en
old_daily_format: false
show_beaufort: true
static_icons: false
time_format: 24
title: Weather
tooltip_bg_color: 'rgb( 75,155,239)'
tooltip_border_color: orange
tooltip_border_width: 3
tooltip_caret_size: 10
tooltip_fg_color: '#fff'
tooltip_left_offset: -12
tooltip_width: 100
tooltips: true
type: 'custom:dark-sky-weather-card'

Sensors.yaml:
  - platform: darksky
api_key: [redacted]
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
update_interval:
  minutes: 10

when I run the console, the errors I see 2 errors:
error 1:

[Deprecation] HTML Imports is deprecated and will be removed in M73, around March 2019. Please use ES modules instead. See Chrome Platform Status for more details.

error 2:

Unknown resource type specified: undefined

1 issue I think could cause this is the sensor dark-sky-current-text. I don’t know where to put that. I’ve tried my sensors.yaml, but can’t get the config to accept that. I doubt that’s causing the entire card to show up blank though.
Any ideas or help here? I’d greatly appreciate it as I’m out of ideas as I’ve read through this whole thread and tried everything.

your config is pretty messed up.

you need to move things around and indent correctly.

try this:

resources:
  - url: /local/custom_ui/dark-sky-weather-card.js?v=8.3
    type: module
title: Home Assistant
views:
  - icon: 'mdi:weather-cloudy'
    cards:
      - 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
        ## optional ##
        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
        entity_current_text: sensor.dark_sky_current_text
        show_separator: True

Yes, sorry. It was late and I had to edit post to get the quote to display properly. It lost the formatting when I did that. It was mostly formatted like yours, but for the sake of checking, I copied/pasted your config and checked that as well. Same thing. Nothing is showing…

This did present a new error though:

Uncaught (in promise) TypeError: Cannot read property 'state' of undefined
    at HTMLElement.render (dark-sky-weather-card.js?v=8.3:26)
    at HTMLElement.update (app-3b4bb4ed.js:377)
    at HTMLElement.performUpdate (app-3b4bb4ed.js:344)
    at HTMLElement._enqueueUpdate (app-3b4bb4ed.js:344)

Here’s my sensors.yaml as well.

  - platform: darksky
    api_key: [redacted]
    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
    update_interval:
      minutes: 10

The template sensor goes into either configuration.yaml or if you break out your sensors into sensors.yaml, it can go there as well. As it is HA configuration level you must restart HA for it to take effect.

It looks like you are including entity_current_text in your lovelace card config. If you do not have a valid sensor.dark_sky_current_text entity (see above) it will cause the error you are seeing which in turn will break the card. That entity is optional so if you don’t have the template sensor setup just remove that line from the card config in lovelace.

The Readme file lists all the optional entities and provides an example of how to setup this specific template sensor. It assumes you already know how to setup template sensors in general. If you don’t, there is documentation on how to setup them up here.

It appears the two minor mistakes I made were including the incomplete entity_current_text and some incorrect formatting of the config. It is now working. Thank you both for your replies. I had nearly given up on getting this working. I have my templates card and I did see the optional entities (but I had missed that the entity_current_text was optional, so thank you for pointing that out). Appreciate the help!

I also can’t get it to work (did everything as per instructions I think, maybe i’ve missed something), here is my raw editor config and relevant bits from configuration yaml:

https://pastebin.com/axhmZBBV

Hopefully you can help me since i’m going crazy staring and trying different things for hours :smiley:

What error are you having?

That it doesnt exist.

Custom element doesn't exist: dark-sky-weather-card.

{
“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”
}

What browser are you using? If you are using chrome can you post the specifics of the error that is showing in the console of the chrome developer tools window. It will help narrow down the specific error that is causing the card to break.

I assume you downloaded the card .js file in raw format from github and placed it in the correct directory. Basic question I know, but it’s been a problem for some folks in the past.

Sorry if this is a stupid question…is this card supposed to update dynamically, like other sensors do in HA? Because mine only changes if I refresh my browser page (i.e. F5). I’m using Chrome on a Windows PC.

It doesn’t currently. I am looking into what can be done to make it.

Thanks…appreciate the info and for looking into it! :slight_smile: