Closed chasklar closed 3 years ago
This is normal and expected behavior for the WeatherAlerts integration when the weather.gov API is experiencing problems. The initial error indicates a HTTP status code error 502, which means the api.weather.gov API was having an issue at that time. HTTP status code error 502 = Bad Gateway error. Bad Gateway error = the WeatherAlerts request went to the public-facing API web server, the public-facing API web server forwarded it to a NWS internal server that serves the alerts back to the public-facing API web server, and the public-facing API web server is complaining it didn't receive a valid response from the NWS internal server. 100% a problem somewhere within the weather.gov API. The weather.gov weather alerts API is not 100% reliable, unfortunately. Any weatheralerts-related TimeoutError and HTTP status code errors you might see in the home-assistant.log file are just pointing out how unreliable the API can be. The weather.gov API is free, likely receives a very high volume of requests, and it's run by the U.S. government, so occasional or intermittent failures are likely.
The template errors will happen whenever there is an API error. The template errors can be ignored. Additional code could be added to the template to prevent the errors, but the added code complicates the template and makes it even more unmanageable than it is already. The template errors also show up in the log during Home Assistant startup if the weatheralerts templates load before the WeatherAlerts integration is loaded, and these can also be ignored. The template package will be replaced, at some point, with a much simpler and easier to manage template package.
One other note... Right now, if the integration runs into any of these API errors when Home Assistant is starting up, WeatherAlerts will fail to load if the errors persist longer than the time Home Assistant tries and retries to load the integration. I'll see if I can change this behavior and allow WeatherAlerts to continue to startup, and then store the startup failure details in an entity attribute until WeatherAlerts is able to successfully connect to the weather.gov API.
Version of the custom_component version 0.1.4
Describe the bug Getting warnings and errors when restarting and randomly.
Log Latest logs.