Lovelace: Weather card with chart

@Truwolf:
Might you post the code, pls.

Hello, I was able to solve the issue ā€œCustom element doesnā€™t existā€ on my homeassistant installation with renaming the following items:

  • file from config/www/weather-card-chart.js to config/www/weather-chart-card.js
  • ui.nabu.casa/config/lovelace/resources URL from /local/weather-card-chart.js to /local/weather-chart-card.js
  • Card Configuration: type: from custom:weather-card-chart to custom:weather-chart-card

I recommend checking that the spelling at all three places is as described in Github.
A restart might also be needed and the Card Configuration is a bit hackling.
Good luck :wink:

I just started using the card, looks great. I see that imperial units are supported. My temperatures show in F, but the wind speed and pressure show in metric. How do I change this?

Is there a way to change the font color on the chart? Iā€™m semi-OK using Card Mod, but the elements for the font seem to be hidden behind the canvas. Iā€™ve tried setting the color to : white but it doesnā€™t affect the font on the chart itself. Thanks.

EDIT. found the easy answer, changing the theme from light to dark swapped the chart labels colour.

Iā€™m sure itā€™s obvious but I canā€™t seem to find how to change the 24:00 hourly output to AM and PM?

I donā€™t think you can

Thanks for the quick response but I have noticed in serveral earlier posts in this thread that they have found a way to display a 12 hour clock:

I donā€™t see a configuration option for that in the card on github and there is only a zone setting in HA itself so I have no idea how they are forcing that.

I thought the same thing, I wonder if itā€™s depended on the weather sensor that is being used? For example, Iā€™m using Openweathermap. Perhaps one of the other ones outputs differently?

I donā€™t think so. the weather entity is pretty standard

Can someone tell me how the Forecast Options are implimented on this card? I canā€™t find an example and my attempts have proven to all be failuresā€¦Iā€™ve tried this:

      - type: custom:weather-chart-card
        entity: weather.openweathermap
        show_main: false
        show_attributes: false
        forecast:
          labels_font_size: 12
          temperature1_color: rgba(132, 219, 253, 1.0)
          temperature2_color: rgba(132, 209, 253, 1.0)

and Iā€™ve tried this:

      - type: custom:weather-chart-card
        entity: weather.openweathermap
        show_main: false
        show_attributes: false
        labels_font_size: 2
        temperature1_color: rgba(132, 219, 253, 1.0)
        temperature2_color: rgba(132, 209, 253, 1.0)

Neither seem to impact the style of the card?

Okā€¦Well after digging into the source code, Iā€™m pretty sure the following forecast options were not included in the current release, perhaps they got blown out during one of the merges?

temperature1_color
temperature2_color
labels_font_size
condition_icons
precipitation_color

All the other variables appear to be workingā€¦although I havenā€™t tested ā€œiconsā€ (custom icon path).

Here is the source code for the basic configuration. You can try to copy forecast block and change it:

Hi There.

I am new to this card, and have tried to install it following all the instrunctions in this thread.

I still get the ā€œCustom element doesnā€™t existā€ with the following card entry:


    cards:
      - type: custom:weather-chart-card
        entity: weather.home

image


I am on 2022.4.6

Does anyone have some good ideas?

Update: It appearently solved itself over night. Now it works.

I would really like the option to turn off the temp labels on the graph as @scstraus had mentioned

1 Like

Love this card! Is there a way to change the colour of the icons to a different theme variable? Mine seem to stay on primary-text-Color and have tried changing the code in the js without success :frowning:

I am also finding I cannot change the colours using the below code and my variables which are in the format ā€œR,G,Bā€.

          - type: "custom:weather-chart-card"
            entity: weather.dark_sky
            forecast:
              temperature1_color: 'rgba(var(--color-red),1.0)'
              temperature2_color: 'rgba(var(--color-green),1.0)'
              precipitation_color: 'rgba(var(--color-blue),1.0)'

is that the latest version of weather-chart-card? Asking because in the repo I see those graphs with the noted numbers (which was reason for me not to upgradeā€¦)

Like that it would be an option for me (if I could ditch the icon in the footer)

also, because I didnt like the new way of this nice card, I just managed to carve out the lines graphs from the old card, and put in in a stack with the adapted custom weather-card by Bram:

will get rid of the gap in between so they look like 1, and hide the ticks and vertical grid:

1 Like

Thank you for a nice card! I wonder how and where I can specify how many days of forecast I want to specify (I would like less than 9 days)