Weather forecast - how to get it working?

Hey, all. I have read many of the weather posts, and I have tried some things but am still unable to get weather working today. I did get it working a year or so ago, before the deprecation of the previous method. But I struggle today with getting it working again.

Previously I used the Met.no source with this code:

{% for state in states.weather.forecast_home.attributes.forecast[0:6] -%}
{{ as_timestamp(state.datetime)| timestamp_custom("%a") }};{{state.templow}};{{ state.temperature }};{{ state.precipitation }}in;{{ weather[state.condition] }}#             
{%- endfor %}

I have tried changing the first line to:

{% for state in states.weather.abcd_daynight.attributes.forecast[0:6] -%}

(substituting my local wx station code for abcd), and I have tried other things.

Has anyone written an easy-to-follow howto guide for getting a multi-day weather forecast? I have searched but have not found one yet.

My goal is to get a multi-day forecast with high/low temps and overview (cloudy, sunny, etc).

Hi unixdude,

This might help

Thanks for the reply. Lots of info there, but unfortunately it doesn’t help me understand how to grab datapoints out of the NWS foreast data.

Basically I’m trying to get this working again; it has not worked since the deprecation last year. I have tried several times since the deprecation and have not met with success.

I know the data is there, because I see it when I look at the service. I just can’t figure out how to pull the data out of the service. Is that documented somewhere?

  1. What was depreciated?
  2. Which integration are you using to get the weather data?

I don’t know exactly what was deprecated. My understanding was that something weather-related changed, and there are a lot of posts about it, but I never sorted out exactly what was deprecated.

I had Met.no working, and it no longer generates the long forecast for me, and hasn’t for about 10 months. The data is still there, though, because I see it when I inspect the service.

I have tried every free weather service, and have not been able to get this working with any of them. Clearly I am missing some concepts here, because the data shows up in the service, but I am not able to extract the data from the service into the variable like I used to do – that is, the code snippet I show above used to work perfect, and now fails. The complete code is shown at the blog post link I posted above (“I’m trying to get this working again”).

I have spent tens of hours on this at this point and am at a total loss as to how to fix it. Any and all guidance will be appreciated.

Hi,
Each weather provider source might have a few differences in how their data is presented, however here’s a pair of posts hsowing worked example, and an update:

Note the need to get_forecasts, then go through the resulting arrays.

The docs also have examples:

I’ve no idea of the format you want, but hope my text templating suitable for speech gives some ideas.

If this helps, :heart: this post!

Do you mean in Developer Tools → states? Or when you log in to your weather provider.

I don’t see it when I look at states, I see it when I look at Settings → Devices & Services → Entities → (Met.no entity) … and … → Entities → (NWS Entity). I see the full forecast there, but I don’t know how to pull it out, and the code I used, which worked perfectly, no longer works.

Here’s a blueprint that will do it for you then. Either use it or dissect it if you want to recreate it…