-
-
Notifications
You must be signed in to change notification settings - Fork 28.5k
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
NWS integration fails to populate 11 sensor entities. #117533
Comments
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 |
This seems like NWS server flakiness to me, although the debug log you sent has data in it, at least at the beginning. Did you capture that log during the time period you did not have data? There are a few relevant "known issues" and "upstream issues" currently in the NWS API service page (under "Updates"). |
You might be correct about the flakiness. I just performed a restart and data are being populated. I couldn't remember if the file was with or without data because I spent time over the following day trying to get data restored. What I can say with some certainty is that if after a restart or YAML reload data are not populated, it will stay that way until there is a successful restart with data. As an aside, I think it would be useful to have a |
Currently the data is polled every 10 minutes, but if there is a failed update, it will update every minute. There is no way to increase this currently. NWS suggests no more frequent than about 1 minute per request, and we are right there. Currently, if the response is not a 500 error, we treat it as successful, however the NWS servers are lately having a problem with providing a successful response, but with no data. I have started a PR so that the integration will automatically retry fetching data if no data returns, but this actually exacerbates the drop out of data in home assistant, so it is on hold. The addition of datetime for observation as a sensor makes sense to me as a feature request. PR's welcome :). |
Is this the endpoint being used? https://api.weather.gov/stations/Kxxx/observations/latest It seems to be repeatedly working with a browser (and contains data). What do you make of this? |
Yes. It works in a browser, because requesting via browser gives a fresh user agent for each request. When running through a client based request, we are supposed to use a unique and stable user agent. However NWS has a caching problem in this case from time to time. NWS specifically asks that cache-busting techniques to not be employed. |
Is using |
Assuming you are using |
Are we not returning old cached values if the API request fails?
…On Fri, May 17, 2024, 14:19 Sudo-Rob ***@***.***> wrote:
I can't tell if data are old when they're populated. The issue is most of
the time the integration is not populating *any* data. All 11 entities
are showing unknown.
image.png (view on web)
<https://github.com/home-assistant/core/assets/56487711/9e00f344-96d7-495f-83cb-2f16c660801c>
—
Reply to this email directly, view it on GitHub
<#117533 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABWCYT4YQD7SKEFM5XZZZATZCZJ2LAVCNFSM6AAAAABHZPVDFKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMJYGIZTMMJTGI>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
The problem is that the request succeeds, i.e. 200 status code, yet the server returns #117109 is intended to mark that data stale after X minutes (and institute more frequent retries in the interim), but it makes the problem more apparent. |
With |
This is probably a smoking gun observation here. In HA we also utilize the |
After hours of no data, I reloaded the integration and the entities populated. If it behaves like it has previously, I doubt I will see any changes in states over the next several hours. |
I see no changes in the sensor entity states after getting data following a restart. I've taken a cursory look at NWS API service and see nothing regarding the absence of a 200 status code. Is there any visibility of the issue you're aware of? I've also looked here.. https://github.com/weather-gov/api/discussions ...and this is the closest post I've seen regarding data expiration. The responder doesn't appear to be a civil servant. |
Ironically, my local station seems to be more flaky now than it was before. #117109 will help make the integration more robust to momentary problems for observation data. This will be in the next monthly release. Since you are the issue creator, you can close it in the future. But I will do it here. |
@home-assistant close |
The problem
The NWS integration frequently fails to populate the state of the 11 sensors providing current weather conditions. This condition causes errors in template sensors depending upon the native NWS sensors.
All other NWS data are available, including the daily, hourly, and weather.kxxx.
What version of Home Assistant Core has the issue?
core-2024.5.3
What was the last working version of Home Assistant Core?
No response
What type of installation are you running?
Home Assistant OS
Integration causing the issue
NWS
Link to integration documentation on our website
https://www.home-assistant.io/integrations/nws/
Diagnostics information
home-assistant_nws_2024-05-15T03-46-32.885Z.log
Example YAML snippet
Anything in the logs that might be useful for us?
No response
Additional information
No response
The text was updated successfully, but these errors were encountered: