New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Weather template validation is too strict and/or NWS integration returns bad forecasts #114799
Comments
Hey there @home-assistant/core, mind taking a look at this issue as it has been labeled with an integration ( Code owner commandsCode owners of
(message by CodeOwnersMention) weather documentation |
Hey there @MatthewFlamm, @kamiyo, mind taking a look at this issue as it has been labeled with an integration ( Code owner commandsCode owners of
(message by CodeOwnersMention) nws documentation |
Hey there @PhracturedBlue, @tetienne, @home-assistant/core, mind taking a look at this issue as it has been labeled with an integration ( Code owner commandsCode owners of
(message by CodeOwnersMention) template documentation |
Just to pile on a bit here and to the point @mdonoughe makes, this is a rather frustrating error message considering the forecast_template is still in the documentation. I'm not sure the best way to resolve this on my side considering the weather forecast change, I have the same use case where I'm merging my local WS data with an external forecast and this has worked seamlessly for years.
|
The documentation with the forecast option is out of date. And I am with @mdonoughe, this whole issue should have been dealt with months ago. The use case is fairly valid, as I do the same, but I did not try to update until 2024.4 came out and the previous one has failed. I use a Ecowitt weather station with Tomorrow.io's forecast. |
I'm getting this error
For this code
|
You need to use |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
Gotcha, I assumed the reason you had to create template sensors was to try to feed the Template Weather Provider since the forecast attribute was eliminated. Sorry if that wasn't the case. Also the docs for Template Weather Provider still show that you can use the forecast attribute.
|
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This ticket is about the NWS integration being incompatible with template weather. Adding "me too"s about the change from the forecast attribute to the forecast service on this ticket is not helpful. |
The chances of getting this fixed are bigger if you dont focus solely on the NWS Weatger integration - other integrations most likely face the same problem. The more affected people, the more likely it gets fixed. |
The bug is indeed not about the NWS integration specifically (though it may be a bad idea to introduce non-standard elements in a standard attribute). But this bug is not about the removal of the (1) current method is a) create an auxiliary sensor template with an action to call the The totally valid fact that this current method/workaround is cumbersome is not part of this bug, as @mdonoughe pointed out. Focusing this issue back to its initial bug is a good thing because even if a better way for (1) is devised, the OP's problem will probably remain. Note that @mdonoughe is actually the OP. Sidenote: I was also among those who chimed in about the wrong bug here, so no hard feelings. |
So there is two problems here
Thanks |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
That is not the same problem. This issue is about the "Only valid keys in Forecast are allowed" error. |
This comment has been minimized.
This comment has been minimized.
For what it's worth the detailed forecast provided by NWS makes an excellent drop into a TTS message. I'd rather it not be removed. I'm having a possibly related issue in that my NWS weather keeps returning Unknown on only the weather location that is used in few templates. Unsure if I need to open another bug report as nothing else is in the logs beyond the templating error. |
@aredon are you able to open a new bug report? I agree that this is and issue and should be resolved. The daily weather forecast is essential in voice assistant configurations. |
I opened one but it was determined that it was an NWS outage. Really not sure how long it's going to be broken. |
The major NWS integration forecast updating issue should now be fixed. This issue should continue to be focused on the template validation and/or NWS forecasts structure issue. While there is a suggested path forward for NWS to add a custom forecast service, it will require a lot of codeowner effort, i.e. a lot of time before it can be implemented, reviewed, and merged in. This |
It looks to have been removed as far as I can tell. All my automations that relied on it have not been working and I no longer see it in the attributes. I'm hopeful it can be included in some other way. |
As mentioned up thread in multiple spots, the forecast is now only available via service call, this was not a change in NWS, but rather a homeassistant wide change. This issue is specifically about matching the template validation with an extra key that NWS supplies in the forecast. Let's keep it on topic. |
The problem
I have a local weather station so I use a weather template to combine NWS forecasts with my local data. After upgrading to 2024.04, the (still documented)
forecast_template
property was forbidden to be set so I had no weather.I figured out how to make a template sensor that saves the result of making the
weather.get_forecasts
service (why can't the template just delegate it's service handler to a different service?), but my forecasts weren't showing up even though I could copy the template into the template editor and see the expected result.template.weather
validates the contents of the forecast, and it discards your forecast if it contains any keys that aren't on a whitelist:core/homeassistant/components/template/weather.py
Lines 427 to 461 in 841d394
The NWS integration adds its own key
detailed_description
which isn't on the whitelist:core/homeassistant/components/nws/const.py
Line 30 in 56d0ad2
So if you try to use NWS with a template, you get no forecasts unless you do something like this:
All together, this turns what used to be a simple 2 line delegation from the template to the NWS weather entity into 48 lines of YAML and a lot of time spent troubleshooting.
What version of Home Assistant Core has the issue?
core-2024.4.0
What was the last working version of Home Assistant Core?
No response
What type of installation are you running?
Home Assistant Core
Integration causing the issue
nws
Link to integration documentation on our website
https://www.home-assistant.io/integrations/nws/
Diagnostics information
No response
Example YAML snippet
No response
Anything in the logs that might be useful for us?
Additional information
No response
The text was updated successfully, but these errors were encountered: