In the 2024.4 release the weather forecast was finally removed from the NWS integration and requires an addition to make it get twice-daily forecasts. I’ve tried what the weather page says for configuration, but it doesn’t seem to work. I don’t use the weather cards and had built a custom display in lovelace as I combine information from my Davis Instruments system and the NWS information. Below is what I have included in my configuration.yaml and it works once after it is added and a yaml reload is done, but never updates after that. In fact if I go in and run the service in the developer tool, it only shows the information that was pulled that first time and does not update.
The sensor loads correctly and shows on the page, but only once.
The sensor you created will update every hour on the whole hour, so at 0:00, 1:00, 2:00, 3:00 etc
Below is what I have included in my configuration.yaml and it works once after it is added and a yaml reload is done, but never updates after that. In fact if I go in and run the service in the developer tool, it only shows the information that was pulled that first time and does not update.
Which service in the developer tool are you referring to here?
Select your code and use this button to apply the code formatting (or just type 3 backticks for opening and closing of the text which should be formatted as code)
If the information provided by that service call doesn’t update, you should log an issue for that integration, because then it isn’t working properly.
If that service response doesn’t update, your template sensor won’t update as well.
I have the exactly the same issue. All my OpenHASP displays were all great until the last HA update where they changed the format. I’m not sure I fully understand the new method. The first thing I’m trying to get is the detailed forecast. I can create the service call and can see the info, but creating a template sensor is above my pay grade…
Results in this response. I want the detailed_description:
weather.keul_daynight:
forecast:
- detailed_description: Partly cloudy, with a low around 46. West wind around 9 mph.
datetime: "2024-04-15T01:00:00-06:00"
precipitation_probability: 0
is_daytime: false
condition: partlycloudy
wind_bearing: 270
temperature: 46
dew_point: 40
wind_speed: 9
humidity: 74
- detailed_description: >-
Partly sunny, with a high near 66. West northwest wind 12 to 20 mph,
with gusts as high as 29 mph.
datetime: "2024-04-15T06:00:00-06:00"
Etc, etc, etc
So if I follow the OP’s format it would appear I have to create a template sensor (somewhere? Where? I’ve never used triggers in a template sensor) but this is where I’m stumbling. It will probably be something like this, adding Detailed Description as an “attribute”?
If I can get it into a sensor I think I can figure out how to use it in OpenHASP. If, as the OP states, it only updates once, can’t I set up a recurring Automation as a hack to update the sensor manually? I’m unclear as to which service I would call to update my new template sensor 2x a day.
BTW, What a total PITA… sometimes it’s best to leave legacy stuff that just works in place.
To help your understanding, as you seem to have just sprinkled detailed_description everywhere, hoping for the best, here’s the same code as you posted but with a couple of tweaks.
The response_variable can be called whatever you please: here, I’ve changed it to x, and I’ve changed the state to only use bracket notation, rather than the confusing mix of dot and bracket previously used:
Still struggling… this gives me the detailed_description only. The next 2 sensors are blank. If I remove the detailed_description, the condition then works and so on, so it appears that I have to create a new service call for every attribute? I must be missing something bc that would be totally inefficient.
I’m also not sure I understand service calls as they relate to my current time. It’s 7:45am right now. When I make the twice_daily service call I get this returned:
weather.keul_daynight:
forecast:
- detailed_description: Clear, with a low around 31. North northwest wind around 7 mph.
datetime: "2024-04-18T23:00:00-06:00"
precipitation_probability: 0
is_daytime: false
condition: clear-night
wind_bearing: 337.5
temperature: 31
dew_point: 23
wind_speed: 7
humidity: 64
- detailed_description: Sunny, with a high near 63. North wind around 7 mph.
datetime: "2024-04-19T06:00:00-06:00"
precipitation_probability: 0
is_daytime: true
condition: partlycloudy
wind_bearing: 0
temperature: 63
dew_point: 28
wind_speed: 7
humidity: 67
- detailed_description: Mostly clear, with a low around 37. North northwest wind around 7 mph.
datetime: "2024-04-19T18:00:00-06:00"
The first timestamp is datetime: “2024-04-18T23:00:00-06:00” and we’re now past that since it’s 7:45am and into the second forecast of datetime: “2024-04-19T06:00:00-06:00”. So why would it keep returning the first one? Is there somewhere I have to specify my local time zone so I get the correct response?
Edit: there is a known bug with the NWS integration, all updates are delayed. This explains it.
For those who are apparently doing “high level” functions with weather, this is a GREAT post. I use OpenHasp and this workaround is exactly what I needed. Very minimal changes to all my plates were required after creating the new entity.
Finally a working forecast on all my wall displays. AccuWeather only returns 5 days so I might look for one that returns more and isn’t so buggy like NWS…