Lovelace: Weather card with chart

for any one interested: Custom weather-chart card · GitHub

uses the Home Assistant language to set the tooltips and the other date settings in the card. Maybe not very pretty, but it does the job

1 Like

Why are you telling me to see an issue I opened?

Also I no longer use this card.

I thought a link to the issue would be useful to those searching this thread for a solution.

well, that didnt take long…
2023.2 causes the weather-chart card I posted above to throw an error, and not show at all now.

Unhandled Promise Rejection: TypeError: undefined is not an object (evaluating 'e.language')

1 Like

Yep - I liked your good work while it lasted. Any chance it will be fixed?

1 Like

nope, not yet.
I had hoped a recent front-end pr on language would have fixed it but unfortunately not.

I use this, and deleted the chart card

1 Like

OK - thanks.

Anyone know if this card is still working, for the last few weeks now the graph part on my card has disappeared, now looks like this:

image

Running HA2023.2

Is this the error you were referring to above @Mariusthvdb ?

nope, I had an issue showing Invalid date in my graph popups.

I abandoned the card, no longer wanting to keep hacking it. The only added value it had t the plethora of there weather cards was this nice graph. and I have replaced that with something way more professional

only minor issue there is it doesnt use my most local weather resource… its a fixed .svg
so, if ever there will be a configurable graph chart again, Id have a look at it…

Thanks, yeah it was the graph in particular I liked in the card. I suspect I need to find an alternative (or use yours and move to Norway!)

haha, not necessary, you can see any location using that service

just enter your location, scroll down a bit and click the


option

then use that as image for your generic camera card

  - type: picture-entity
    card_mod:
      style: |
        ha-card {
          {{'filter: invert(90%)' if is_state('binary_sensor.dark_outside','on')
             else 'filter: none'}} ;
        }
    show_state: false
    show_name: false
    entity: camera.weer_roosendaal
    hold_action:
      action: url
      url_path: https://www.yr.no/en/forecast/graph/2-2747930/Netherlands/North%20Brabant/Roosendaal/Roosendaal
1 Like

Yeah, thanks I was only kidding. I have set it up for London and will think of some other custom stuff in the meantime :smile:

I put together something similar with apex charts. Not perfect, as it slides around the ticks of the days, but that’s how far I could get it.

type: custom:apexcharts-card
graph_span: 6d
span:
  start: hour
  offset: '-0h'
header:
  show: true
  title: Wetterorhersage
  show_states: false
all_series_config:
  stroke_width: 5
  group_by:
    func: last
    duration: 1d
now:
  show: false
apex_config:
  legend:
    show: false
  xaxis:
    labels:
      format: ddd
    tooltip:
      enabled: false
  tooltip:
    x:
      format: ddd dd. MMM.
yaxis:
  - id: temp
    min: ~0
    max: ~30
    decimals: 0
series:
  - entity: weather.home
    name: min.
    yaxis_id: temp
    unit: °C
    type: line
    color: green
    data_generator: |
      return entity.attributes.forecast.map((entry) => 
      {
        var date = new Date(entry.datetime);
        
        return [date, entry.templow];
      });
    show:
      datalabels: false
  - entity: weather.home
    name: max.
    yaxis_id: temp
    unit: °C
    type: line
    color: red
    data_generator: |
      return entity.attributes.forecast.map((entry) => 
      {
        var date = new Date(entry.datetime);
        
        return [date, entry.temperature];
      });
    show:
      datalabels: false
  - entity: weather.home
    name: Regen
    yaxis_id: mm
    unit: mm
    type: column
    color: blue
    data_generator: |
      return entity.attributes.forecast.map((entry) => 
      {
        var date = new Date(entry.datetime);
        
        return [date, entry.precipitation];
      });
    show:
      datalabels: true

grafik

2 Likes

This is really good. Thanks!!

Why does Weather-Chart-Card works fine in Edge and Mobile-app, but not in Firefox ?

Because it has not been updated for a year.

haha, yeah i know, thou it was mend from a technical perspective :wink: … it must have been some “update” here in ha, that caused it to fail ( or FF update, what do i know )

:man_shrugging: I don’t know enough about web browsers to say. If I did I’d fork it and fixit.

1 Like

I just manage to get it back in Firefox 110

Not sure exactly what step did it, so if someone wanna give it a try this is my little findings:

  1. First of all, i use a fork by " greendog99 (Mike Fischer) · GitHub "
  2. before editing any file, do a full history-clear ( browsing, download, cache )
  3. if nothing change, then check whether you have only 1 place for the “js-file” , somehow in FF debugger, i had an “additional” outside /hacs-files , and that was /local/com… ( Thou that was not what the “Resources in Lovelace” said ), there i only had /hacsfiles/…
  4. in that file i edited 2nd row, as it appeared that in my case, it only said “WEATHER-CHART” so i change to WEATHER-CHART-CARD

first

Id added and modded to my satisfaction :slight_smile:

apexchart

1 Like