Lovelace: Simple Weather Card

Weird, I actually don’t know why it wouldn’t work before then, maybe the config didn’t save/update properly before you reloaded the page?

CSS is quite picky when it comes to the syntax and won’t give you an error if something is invalid so yeah it could be quite hard to debug.
You could however “right click” → “inspect” the element in the browser to debug the CSS.

I can’t imagine that to be the reason, I tested on 3 browsers…
what I did test was:

  • the indent on the bottom }
  • the order of the 2 elements box-shadow and border-radius
  • quoting the box-shadow
  • several other cards (with definite correct effect so to be sure of the formatting…)
  • use of backdrop or not.

All I can say is I am glad it is finally working :wink: hope you don’t mind the amount of posts…sorry for that.

Do have another question. Not sure if this has been discussed earlier, (tried to keep up with the posts…), but would it be possible to focus the browser to a tab which has been navigated to using the

    tap_action:
      action: navigate
      navigation_path: weer_klimaat

command? The page is loaded correctly, but the top menu doesn’t necessarily show the active tab (in my use case: I have way more tabs than space for the top menu bar. My simple-weather-card is on the homepage, navigating to tab 16…)

Would be really cool if the navigate would also center the top menu tabs to that navigate tab.

I understand the issue but that is a bit out of scope for custom cards in my opinion.

You should open a feature request in the official HA frontend with the suggestion.

This is great, thanks. Wind_bearing would be a great addition for the secondary info…

ok thanks, will try the cch thread and ask the author first, because I’ve now tested it to be on mobile and desktop, no matter which screen size, it always lands on the same view, being 1 left of the navigation-path…
can’t be a coincidence :wink:

Indeed, will add next release.

1 Like

What sensor/attributes does this card use because mine doesn’t look right, given that it is 11pm here now!

image

For the current temp it’s simply the temperature attribute of the weather entity.

If you want to know any other specific attribute used please let me know or check the source, should be pretty self explanatory.

If you wish to override specific weather data with your own sensors, please see the custom option.

1 Like

As Dark Sky doesn’t display the low temperature, I tried the following:

  - type: custom:simple-weather-card
    entity: weather.dark_sky
    custom:
      - temp: sensor.dark_sky_temperature
      - high: sensor.dark_sky_daytime_high_temperature_0d
      - low: sensor.dark_sky_overnight_low_temperature_0d

but it still doesn’t show high/low in the card.

Hey,
That should work, although if low is the only missing value there’s no need to supply it with the temp/high sensors (unless you want to ofc).

Make sure the sensor.dark_sky_overnight_low_temperature_0d reports its state as a number, without any additional characters or symbols.

Also, make sure you’ve updated your card to at least the version where the custom option was added.

If using HACS, also double check if your resource reference matches the one stated in HACS, since it changed in later versions.
Should be like this nowadays I believe.

  - url: /community_plugin/simple-weather-card/simple-weather-card-bundle.js
    type: module

sensor.dark_sky_overnight_low_temperature_0d reports as a number with one decimal, same as sensor.dark_sky_temperature. I can use it in other cards.

When it comes to my ui-lovelace.yaml I have Simple Weather Card where I have most of my resources like this:

resources:
  - url: /customcards/lovelace/simple-weather-card.bundle.js?v=0.5.0
    type: module

Don’t know then, I just tried with your config and with one of my own sensors:
08
And it works as expected.

Please check the browser developer console for any potential errors.

There are no errors related to any weather component. I have 3 different weather providers in my setup: Dark Sky, SMHI and OpenWeatherMap. The only one showing high/low is SMHI (Bromma) and the same regardless of custom variables or not (note: the high/low from Dark Sky is 13.7/6.6).
My code:

  cards:
  - type: custom:simple-weather-card
    entity: weather.dark_sky
    custom:
    - temp: sensor.dark_sky_temperature
    - high: sensor.dark_sky_daytime_high_temperature_0d
    - low: sensor.dark_sky_overnight_low_temperature_0d

  - type: custom:simple-weather-card
    entity: weather.smhi_bromma

  - type: custom:simple-weather-card
    entity: weather.smhi_bromma
    custom:
    - temp: sensor.dark_sky_temperature
    - high: sensor.dark_sky_daytime_high_temperature_0d
    - low: sensor.dark_sky_overnight_low_temperature_0d

  - type: custom:simple-weather-card
    entity: weather.openweathermap

and the output:
simpleweathercard

The sensor state:

I also tried to put in integers instead of sensors:

    custom:
    - temp: 11
    - high: 14
    - low: 6

No difference.

I have asked the same question to the dev of CCH before. He said it would require a lot of work. I eventually don’t use the header anymore.

Strange, how did you setup your sensor.dark_sky_overnight_low_temperature_0d, I guess it’s from the dark sky component?

If I can debug with the same sensor I might be able to reproduce it.

This is how it looks for me:
hyperion_8123_lovelace_example%20copy

- type: custom:simple-weather-card
  entity: weather.dark_sky

hyperion_8123_lovelace_example%20copy%202

- type: custom:simple-weather-card
  entity: weather.dark_sky
  custom:
    - low: sensor.aqara_multi_temperature_1 # this is actually not low, just random inside sensor

This is my Dark Sky sensor setup:

  - platform: darksky
    api_key: !secret darksky_api
    language: sv
    forecast: [0,1]
    scan_interval:
      minutes: 20
    monitored_conditions:
      - summary
      - icon
      - hourly_summary
      - daily_summary
      - temperature
      - temperature_high
      - temperature_low
      - precip_probability
      - wind_speed
      - wind_gust
      - wind_bearing

And these are the sensors (sorry for poor image quality):

1 Like

Thanks, was able to reproduce now, will take a look as soon as I get home :+1:

Thanks! Just to show the Dark Sky sensors in use in e.g. the banner card:
banner-card-darksky

That’s a great setup, even better looking than this card! :laughing: