Custom Dark Sky Animated Weather Card

Sorry. Formatted now

Why this?
Should be a rest sensor!

I’m getting an extra ‘/h’ in precipitation intensity

image

Why not a file? I’m going to read a file inside my microSD… Not?
I was thinking rest was only for url. I’m going to try…

How would you update that file?

Use the code from my reply, and you have a sensor that shows the latest version.
If you want to use a local file sensor and it doesn’t work, please create a new topic.

This one is for the Weather Card

thought to be a quirk in my settings, but now I review your latest version, dont you too notice the summary to be way ahead of itself ? Somehow its about a week a head, while one would hope the summary be for this day? (that’s why I added the date…)

Am I mistaken on that, or, can we change that somehow? At least add the sensor.dark_sky_forecast_summary_0 to it in front of the sensor.dark_sky_daily_summary, would that be an option to make it a bit more useful?

like:

var icons = this.config.static_icons ? "static" : "animated";
var sunLeft = this.config.entity_sun ? this.sunSet.left : "";
var sunRight = this.config.entity_sun ? this.sunSet.right : "";
var currentText = this.config.entity_current_text ? html`<span class="currentText">${hass.states[this.config.entity_current_text].state}</span>` : ``;
var apparentTemp = this.config.entity_apparent_temp ? html`<span class="apparent">${this.localeText.feelsLike} ${this.current.apparent} ${this.getUOM("temperature")}</span>` : ``;
var daytimeHigh = this.config.entity_daytime_high ? html`<li><span class="ha-icon"><ha-icon icon="mdi:thermometer"></ha-icon></span>${this.localeText.maxToday} ${Math.round(this.hass.states[this.config.entity_daytime_high].state)}<span class="unit"> ${this.getUOM('temperature')}</span></li>` : ``;
var precip = this.config.entity_pop && this.config.entity_precip_intensity ? html`<li><span class="ha-icon"><ha-icon icon="mdi:weather-rainy"></ha-icon></span>${Math.round(this.hass.states[this.config.entity_pop].state)}<span class="unit"> %</span> - ${this.hass.states[this.config.entity_precip_intensity].state}<span class="unit"> mm/h</span></li>` : ``;
var visibility = this.config.entity_visibility ? html`<li><span class="ha-icon"><ha-icon icon="mdi:weather-fog"></ha-icon></span>${this.current.visibility}<span class="unit"> ${this.getUOM('length')}</span></li>` : ``;
var wind = this.config.entity_wind_bearing && this.config.entity_wind_speed ? html`<li><span class="ha-icon"><ha-icon icon="mdi:weather-windy"></ha-icon></span>${this.current.beaufort}${this.current.windBearing} ${(this.current.windSpeed)*3.6}<span class="unit"> ${this.getUOM('length')}/h</span></li>` : ``;
var humidity = this.config.entity_humidity ? html`<li><span class="ha-icon"><ha-icon icon="mdi:water-percent"></ha-icon></span>${this.current.humidity}<span class="unit"> %</span></li>` : ``;
var pressure = this.config.entity_pressure ? html`<li><span class="ha-icon"><ha-icon icon="mdi:gauge"></ha-icon></span>${this.current.pressure}<span class="unit"> ${this.getUOM('air_pressure')}</span></li>` : ``;
var summaryToday = this.config.entity_summary_today? html`<br><span class="today"> ${hass.states[this.config.entity_summary_today].state}<br> ` : ``;
var summary = this.config.entity_daily_summary ? html`<br><span class="summary"> ${hass.states[this.config.entity_daily_summary].state}</span></br>` : ``;
var today = this.config.entity_today ? html`<span class="today">${hass.states[this.config.entity_today].state}</span>` : ``;

bottom part of the card:

    <hr>
    <span class="summary">Summary for: </span>${today}
    ${summaryToday}
    <span class="summary">Rest of the week: </span>
    ${summary}
  </ha-card>
`;

}

styles:

  .summary {
    font-weight: bold;
    font-size: 0.9em;
    color: var(--secondary-text-color);
  }
  .today {
    font-weight: bold;
    font-size: 0.9em;
    color: var(--primary-text-color);
  }

and relevant bit of config:

  - type: custom:dark-sky-weather-card
    entity_sun: sun.sun
    entity_daily_summary: sensor.dark_sky_daily_summary
    entity_summary_today: sensor.dark_sky_forecast_summary_0
    entity_current_conditions: sensor.dark_sky_forecast_icon
    entity_humidity: sensor.dark_sky_humidity
    entity_pressure: sensor.dark_sky_pressure
    entity_apparent_temp: sensor.dark_sky_apparent_temperature
    entity_temperature: sensor.dark_sky_temperature
    entity_visibility: sensor.dark_sky_visibility
    entity_daytime_high: sensor.dark_sky_forecast_daytime_high_temperature_0
    entity_wind_bearing: sensor.dark_sky_wind_bearing
    entity_wind_speed: sensor.br_wind_speed
    entity_wind_force: sensor.br_wind_force
    entity_current_text: sensor.weather_rsd_icon
    entity_precip_intensity: sensor.dark_sky_precip_intensity
    entity_today: sensor.vandaag

Gnight!

Updated to HA 0.86 and just used the card updater to update to the latest of this card 0.8.1, but I still get the “Custom element doesn’t exist: dark-sky-weather-card.”

Any ideas? What’s the best way to completely remove this card and any trace and start again?

It’s a cache issue… delete data and clear cookies… I had same error last week with ‘cardgate’ till I did that. Also refresh a few times, maybe even F12 in chrome and right click on refresh and hard reload and clear cache… Still will need to delete cookies…

I’ve done all that multiple times before, but I think I’ve worked it out. Turns out that the custom updater was unable to overwrite the file, so everything updated except the file so I was still running an old version of the card. I just deleted the card and saved a new one from github and things are now working that I couldn’t get to work. YAY!!!

1 Like

I’ve got this as well…

Yah, I was trying to use the UOM stored in the attribute of the sensor but for standard it just has in instead of in/h so I added an extra /h … It turns out that the sensor has the /h for metric as in mm/h. Anyway I updated the card to do a lookup like all the other UOM’s. It should work correctly now.

That’s the way its supposed to work. If you don’t want the full week summary then just pass in the _0 summary and it will give you today’s summary. If you want to have both I would suggest setting up a template sensor that concatenates the two along with wahtever other tesxt you want. The card just expects a bunch of text there… it can be anything you want.

I don’t have any issues with them like you are showing… they just respond to whatever darksky is sending. When they are wrong like that is the value in the darksky sensor correct? If you want to force a specific set based on time of day, I would suggest using a template sensor to adjust the value passed in.

The issue isn’t the mapping, thats realtively straight forward. the issue is have a state that can be used to do the mapping. the state that makes sense to use isn’t being populated correctly by the darksky api component. It really isn’t safe to use the current conditions as they may be quite different that what the POP is representing.

Not sure what this means …

hi @m.p.frankland I noticed that the version extension on the lovelace resource in the readme doesn’t match the version in the json. Might want to update the readme :wink:

On another note, I STILL can’t get this to load :unamused: (still getting custom element doesn’t exist error after cache clear, multiple refreshes etc.)

EDIT: still on HA 0.85.1 Is that an issue?

Not sure exactly what this means… The readme was updated today with the changelog, version and card source file

The version shouldn’t matter. What browser are you using ?

Here:

image

I’m using Chrome