First Home Assistant release with the issue: 0.105.1
Last working Home Assistant release: 0.104.3
Operating Environment: HASSIO on RPi
Integration/platform: /integrations/nws/
Description of problem:
My NWS settings and card worked perfectly in .104. Upgraded to .105 today and the NWS entity became unavailable. Reboots and restarts made no difference. The NWS entity disappeared completely from everything including logs.
Problem-relevant configuration.yaml entries
(email redacted)
`# Weather from NWS
weather:
Traceback (most recent call last):
Update of weather.kcrw is taking over 10 seconds
Error updating observation from station KCRW: 502, message='Bad Gateway', url='https://api.weather.gov/stations/KCRW/observations/
Error updating forecast from station KCRW: 502, message='Bad Gateway', url='https://api.weather.gov/gridpoints/RLX/62,66/forecast
Error updating observation from station KCRW: 502, message='Bad Gateway', url='https://api.weather.gov/stations/KCRW/observations
I'm seeing this as well.
I saw this during a restart prior to upgrading to .105. It started about a week ago after a reboot on .104. and the error is showing that the endpoint is not valid although I can get to it in a browser. I think it is coincidental that it is showing for those that upgrade and reboot.
@MatthewFlamm
Tagging the code owner to make sure he is aware of the issue.
I believe he also owns the python library it uses, so he might be able to resolve it quickly once he can identify the source.
Same issue here. It was actually working on the .105b4 beta, but once .105 went public, nws no longer functioned.
Hey there @MatthewFlamm, mind taking a look at this issue as its been labeled with a integration (nws) you are listed as a codeowner for? Thanks!
@caalexis please fill out the issue template :)
I've been digging around, and found this:
https://github.com/home-assistant/home-assistant/pull/31398
Suggesting the NWS integration has been changed from an integration to a component.
I'm not sure it was approved before the .105 release though, as I've made the necessary changes, and it doesn't work.
It's also possible that the NWS API is actually broken.
@Rocketman69 it is not approved and not included in 105.
Do you guys have any errors in your home-assistant.log file?
Thanks for the reports everyone. I suspect that the NWS server is down for only some end points. This worked in the beta, and I think it was unfortunate timing with the release. For example, this page does not load:
https://api.weather.gov/gridpoints/CTP/68,20/forecast
But, it is hard to know if everyone's problem is the same without error logs.
There was a change in 0.105 for this integration, ironically to remove a deprecated end point. It would be good to see if this is the root cause in some cases.
Unfortunately, it is hard to debug the difference between real bugs, i.e. the library pointing to the wrong end point, and the server being down, as the NWS response is the same in both cases in my experience.
I'm hoping that the component version, after config flow is added, can be made more robust to this sort of thing.
@MatthewFlamm, The error I saw in my logs at one point was an error with the endpoint. I copied one of the endpoints to my browser and that worked fine. Apologies for the log picture. For whatever reason, I cannot copy from the UI and the full log doesn't display these errors.

Well this is interesting. When I tested the endpoint in my browser earlier, I was on the work network and it came right up. I am trying the observations endpoint now on the same network as HA at home and it finally came up after 30 or more seconds. I wonder if it is slow and timing out.
This is my error HA version 105.2
2020-02-06 19:45:17 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 424, in _async_add_entity
await entity.async_update_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 284, in async_update_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 327, in _async_write_ha_state
attr.update(self.state_attributes or {})
File "/usr/src/homeassistant/homeassistant/components/weather/__init__.py", line 128, in state_attributes
if self.temperature is not None:
File "/usr/src/homeassistant/homeassistant/components/nws/weather.py", line 265, in temperature
return convert_temperature(temp_c, TEMP_CELSIUS, TEMP_FAHRENHEIT)
File "/usr/src/homeassistant/homeassistant/util/temperature.py", line 36, in convert
return celsius_to_fahrenheit(temperature, interval)
File "/usr/src/homeassistant/homeassistant/util/temperature.py", line 21, in celsius_to_fahrenheit
return celsius * 1.8 + 32.0
TypeError: can't multiply sequence by non-int of type 'float'
File "/usr/src/homeassistant/homeassistant/util/temperature.py", line 21, in celsius_to_fahrenheit
return celsius * 1.8 + 32.0
TypeError: can't multiply sequence by non-int of type 'float'
I was able to reproduce this error. It seems in addition to the flakiness of the server, NWS has suddenly decided to provide all observation data as strings rather than float or integers.
I fixed the observation error, but now that the forecast end point is back up, the same thing happens there. The forecast values are now strings. This will have to be another fix. Hopefully done soon (not today though).
I'm hoping that all the issues here were either caused by 1) the NWS API server being down or 2) the change to using strings in the NWS API data.
Any issue that was occurring a week ago @mostlychris might be a separate issue (although I would suspect it is probably due to that specific station/forecast office having issues temporarily), so feel free to raise another issue if this continues to occur.
I'm still occasionally seeing this error in the latest home assistant.