Custom animated weather card for Lovelace

Many thanks Marius.
I got it to work!
Small question, do you know why the card always starts with current day+1?

Quick addition to the sunset/sunrise that was showing up in AM/PM instead of 24h format. Since i like to have it in english but still in 24h notation instead of changing the locale i added the locale as an argument in every instance of .toLocaleTimeString() in dark-sky-weather-card.js. e.g. in .toLocaleTimeString(‘de-DE’)

Today I migrated to Lovelace. When smooth, apart from the weather card whcih had to be fixed.
That’s working fine now, but the menu for this view has a changed style: smaller and darker blueish, instead of white.

Does anyone know how to fix this? Scrolled thru this topic but couldn’t find a post with a similar issue.

that’s how the card is setup:

this section is for the day’s forecast:

  <div class="forecast clear">
      ${forecast.map(daily => `
          <div class="day">
              <span class="dayname">${(new Date(daily.datetime)).toLocaleDateString((navigator.language) ? navigator.language : navigator.userLanguage, {weekday: 'short'}).split(' ')[0]}</span>
              <br><i class="icon" style="background: none, url(/local/weather/animated/forecast/${weatherIcons[daily.condition]}.svg);"></i>
              <br><span class="highTemp">${daily.temperature}${getUnit('temperature')}</span>
              <br><span class="lowTemp">${daily.templow}${getUnit('temperature')}</span>
          </div>`).join('')}
  </div>`;

since you’re on Buienradar too: In my setup, of the 4 platforms I use, Buienradar is the only one taking an enormous time at setup, can take up to several minutes before all is initialized. The other platforms are there right from startup (yahoo, Yr, Own)
do you see that too?

this is what happens at startup:

42
and after a while:

39
second: the state of the platform during night time is Sunny right now… which is ridiculous of course.

Please have a look if this is the case in your setup too, if yes, we could file an issue…

I’m using Buienradar too, in my setup it loads instantly.

I found that this behavior is only present in Edge browser, not in Firefox. I will file an issue

really? Please check this setup then for me, and compare if you have something different. I have the same with buienradar sensor, do you use that too? Consistently: taking between 2 and 3 minutes after reboot to initialize the Buienradar items.

##########################################################################################
# Weather components
##########################################################################################

weather:
  - platform: yweather
    name: Home Yh

  - platform: openweathermap
    api_key: !secret openweather_key
    name: Home Owm

  - platform: buienradar
    name: !secret buienradar_station

guess you can guess my !secret buienradar_station…

and the sensor:

  - platform: buienradar
    monitored_conditions:
      - stationname
      - humidity
      - temperature
      - windspeed
      - pressure
      - condition
      - conditioncode
      - conditiondetailed
      - conditionexact
      - groundtemperature
      - windforce
      - winddirection
      - windazimuth
      - visibility
      - windgust
      - symbol
      - precipitation
      - irradiance
      - precipitation_forecast_average
      - precipitation_forecast_total

It’s my only weather comnponent. This is in my configuration.yaml

weather:
  - platform: buienradar
    name: "Lopik-Cabauw"

Not sure what weather station you’re using, there are pretty many to choose from :wink:

And for the sensor I have:

  - platform: buienradar
    monitored_conditions:
      - symbol
      - humidity
      - temperature
      - windforce
      - sunchance_1d
      - rainchance_1d
      - precipitation
      - conditionexact
      - conditionexact_1d
      - conditiondetailed
      - conditiondetailed_1d
      - condition_1d
      - condition_2d
      - condition_3d
      - condition_4d
      - condition_5d

I suspect this to be the cause for my issue. The name doesn’t set Buienradar to use that station, it merely gives the components sensors a name. To have it use the station one can set the long/lat in the setup:

maybe its because it now is using my homeassistant’s long/lat it is taking so long? Ill try and use the coordinates of my station and see what happens.

-nothing-…

fear its this:

However at the moment in time, the entity is created, no data has been retrieved yet,

btw what about your night state, Over here it is Sunny… 01:15:27 hours

21

hi folks, just letting you know that with the card-modder card by @thomasloven and this setup:

  - type: custom:card-modder
    style:
      background-image: url("/local/lovelace/images/weather-background-[[ sun.sun.state ]].png")
      background-size: 100% 400px
      --primary-text-color: var(--primary-text-color)
      --secondary-text-color: var(--secondary-text-color)
      --paper-item-icon-color: var(--primary-text-color) #small variation icons
    card:
      type: custom:weather-card
      title: Modded Woensdrecht
      entity_weather: weather.woensdrecht
      entity_sun: sun.sun
      entity_apparent_temperature: sensor.jagti_windchill
      entity_wind_force: sensor.br_wind_force 

this is automatic:

above_horizon
01

below_horizon:
44

3 Likes

hi guys,

i followed instructions, but it doesn’t seems to work
maybe i over looked something.

this is what it shows

i just cant get it to work, staring my eyes out, checked app path, keep getting the following error in log when i wanne add the card trought custom-ui im in version 0.84.5

1162 Uncaught NotFoundError: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node.

any help would be appriciated, do i need yaml mode to use this card?

Yahoo weather APIs were shut down a few days ago (January 3rd).

Anyone have any luck updating this card for another weather API? It looks like dark sky works for the most part, but you lose the forecast lows/highs.

how did you fix this error?

using platform Buienradar :wink:

  - type: custom:card-modder
    style:
      background-image: url("/local/lovelace/images/weather-background-[[ sun.sun.state ]].png")
      background-size: 100% 400px
      --primary-text-color: var(--primary-text-color)
      --secondary-text-color: var(--secondary-text-color)
      --paper-item-icon-color: var(--primary-text-color) #small variation icons
    card:
      type: custom:weather-card
      title: Modded Woensdrecht
      entity_weather: weather.woensdrecht
      entity_sun: sun.sun
      entity_apparent_temperature: sensor.jagti_windchill
      entity_wind_force: sensor.br_wind_force

46

Is it background-image: “weather-background-above_horizon.png”

The actual filename?

yes it is:

26

why you ask? please note I do use another path than the default for the images compared to what many people use, or is in the card itself, Ive changed that.

I was struggling to get it to work, just wanted to make sure the naming convention was right!

Thank you!

here you can find an updated version for dark sky

cant get it to work:

please define entities…

card:
entities:
  - entity_sun: sun.sun
  - entity_daily_summary: sensor.dark_sky_daily_summary
  - entity_current_conditions: sensor.dark_sky_icon  
  - entity_humidity: sensor.dark_sky_humidity
  - entity_pressure: sensor.dark_sky_pressure
  - 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
  - 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_low_temp_1: sensor.dark_sky_overnight_low_temperature
  - 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_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
type: custom:weather-card