Can't figure out how to get basic weather data in a graph

Hi,
I’ve read bunch of topics about this but still can’t figure out how to get weather data graphed (I wanted to see temperature, humidity and wind).

I’ve installed integration for NWS but it seems show only hourly/daily forecast. Although their API sends much more data. I basically want graphs they show on their station pages, https://www.wrh.noaa.gov/mesowest/getobext.php?sid=KDYL&num=24&hfmetars=1

But in the HA I see only two entities: weather.kdyl_hourly and weather.kdyl_daynight

What am I missing?

Thanks!

When you go to the Developer Tools / Sates page and search for weather.kdyl_hourly or weather.kdyl_daynight do you see the attributes you want (temperature, humidity and wind) in the right hand column?

Thanks, I got the metrics.

sensor:
  - platform: template
    sensors:
      nws_currenttemp:
        friendly_name: Outside Temperature
        value_template: "{{ state_attr('weather.kdyl_daynight', 'temperature') }}"
        unit_of_measurement: '°C'
      nws_currenthumidity:
        friendly_name: Outside Humidity
        value_template: "{{ state_attr('weather.kdyl_daynight', 'humidity') }}"
        unit_of_measurement: '%'

The unit_of_measurement for humidity was ‘percent’ - is it the reason the graph can’t plot them together with thermostat’s humidity?
image

Yes, that’s a limitation of the stock graph, you can only plot sensors on the same graph that have identical units.

Have a look at the mini graph card in HACS which lets you define an alternate y axis:

Thanks, I’ll try mini-graph

I realized it wouldn’t plot different measurements.
I’ll try to rename sensor, maybe it will pick up “%”

Actually we should probably raise an issue about the use of “percent” rather than “%” which I’m pretty sure is not following the units standard, which I am now off to find…

I’m not familiar with internal architecture, but the graph should probably allow user specify whatever unit they think is right :slight_smile:

I had a look at the source code to see if it would be an easy change. It’s not. It seems the unit must be coming from NWS. Then I got distracted by other issues and forgot to look for the home assistant unit standard…

Do you recommend any other “full service” solutions?

I saw some people use graphana, and influxdb and all that.
I personally don’t want to add more stuff to my setup, but if its more comprehensive and easier to use, then maybe I’ll invest time to set it up once.

I quite like Grafana, but it it’s got issues with bringing the graphs into home assistant. If you’re happy to look at the graphs in the addon (linked directly from the side menu) it could work for you. Like the mini graph card you can have two Y axes. You can do some pretty amazing stuff with it:

1 Like

My guess to why these two sensors do not appear together is that you need to specify device_class for your template sensor. This is a weird behavior, but my guess is that your other humidity sensor is either not a template sensor or your have device_class set.

There is an active Pull Request to have this data supplied as sensors directly from the integration, but the reviews are taking a very long time these days.

2 Likes

image
It finally picked up changes from ‘percent’ to ‘%’ - I guess its fetching now newer data labeled correctly (I’ve changed it earlier while experimenting)