Weather Underground not working after upgrade to 0.53

I got this in the error logs the first time I restarted, then Hass.io would not restart at all. It was stuck at the main screen with “Uploading Data”. On a hunch, I commented out anything Weather Underground in my config and customize files and it restarted. I would like to get this fixed.

Here was my error log:

2017-09-11 10:05:36 WARNING (Recorder) [homeassistant.components.recorder] Ended unfinished session (id=252 from 2017-09-11 16:52:24.443988)
2017-09-11 10:05:38 ERROR (SyncWorker_7) [homeassistant.components.sensor.wunderground] Check WUnderground API ('Expecting value: line 2 column 1 (char 1)',)
2017-09-11 10:05:39 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/lib/python3.6/asyncio/tasks.py", line 179, in _step
    result = coro.send(None)
  File "/usr/lib/python3.6/site-packages/homeassistant/helpers/entity_component.py", line 381, in async_process_entity
    new_entity, self, update_before_add=update_before_add
  File "/usr/lib/python3.6/site-packages/homeassistant/helpers/entity_component.py", line 238, in async_add_entity
    yield from entity.async_update_ha_state()
  File "/usr/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 256, in async_update_ha_state
    self._attr_setter('entity_picture', str, ATTR_ENTITY_PICTURE, attr)
  File "/usr/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 323, in _attr_setter
    value = getattr(self, name)
  File "/usr/lib/python3.6/site-packages/homeassistant/components/sensor/wunderground.py", line 712, in entity_picture
    return re.sub(r'^http://', 'https://', url, flags=re.IGNORECASE)
  File "/usr/lib/python3.6/re.py", line 191, in sub
    return _compile(pattern, flags).sub(repl, string, count)
TypeError: expected string or bytes-like object

The last part just repeated 10 times so I edited it for brevity.
I posted an issue here:
https://github.com/home-assistant/hassio/issues/186

For a datapoint I did a rebuild last night with Hassbian 1.23 and 0.53.0 and weatherundergound is working find. May be a HASSio issue only.

1 Like

I’m also having errors from WU, but not all the time.
Maybe the issue is on their API site? Yesterday after update it ran without problems.

After trying to restart while doing some troubleshooting, Hass.io got hung up on “Uploading data”. I did some more troubleshooting and (by accident) got Weather Underground working again. Here’s how:

I commented out the sensor in the config file and restarted Hass.io.

# Weather prediction
#sensor: !include sensors.yaml

I then un-commented the sensor in config file and restarted again.
# Weather prediction
sensor: !include sensors.yaml

After that, everything worked and I do not get any errors in the log…fingers crossed for continued success!

1 Like

Forgot to look at my logs, I have errors popping up also, however, no issues with restarts and Im getting weather data on the front end.

Well, my logs are still full of errors. This repeats many many times:

2017-09-11 16:50:06 ERROR (SyncWorker_15) [homeassistant.components.sensor.wunderground] Check WUnderground API ('you must supply a key',)
2017-09-11 16:50:06 ERROR (MainThread) [homeassistant.components.sensor] Error while update entity from wunderground in sensor
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/homeassistant/helpers/entity_component.py", line 450, in _update_entity_states
    yield from update_coro
  File "/usr/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 256, in async_update_ha_state
    self._attr_setter('entity_picture', str, ATTR_ENTITY_PICTURE, attr)
  File "/usr/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 323, in _attr_setter
    value = getattr(self, name)
  File "/usr/lib/python3.6/site-packages/homeassistant/components/sensor/wunderground.py", line 712, in entity_picture
    return re.sub(r'^http://', 'https://', url, flags=re.IGNORECASE)
  File "/usr/lib/python3.6/re.py", line 191, in sub
    return _compile(pattern, flags).sub(repl, string, count)

Technology is fun. We must be patient.

wunderground didn’t work for me on hass.io 0.53, but started working when I upgraded to 0.53.1.

There are still some errors in the log, but info is pulling down and updating.

2017-09-14 14:38:33 ERROR (MainThread) [homeassistant.components.sensor] Error while update entity from wunderground in sensor
Traceback (most recent call last):
File “/usr/lib/python3.6/site-packages/homeassistant/helpers/entity_component.py”, line 450, in _update_entity_states
yield from update_coro
File “/usr/lib/python3.6/site-packages/homeassistant/helpers/entity.py”, line 247, in async_update_ha_state
device_attr = self.device_state_attributes
File “/usr/lib/python3.6/site-packages/homeassistant/components/sensor/wunderground.py”, line 689, in device_state_attributes
for (attr, callback) in attrs.items():
AttributeError: ‘function’ object has no attribute ‘items’

I’ve been seeing those errors since I started with HASS a couple of months ago, using both Hassbian and HASS.IO (I’m running 0.53 HASS right now). I’ve tried removing each of the WU sensors individually, without success. Data does come down, but the log is full of errors. I saw the fix in 0.53.1 and will try that this weekend to see if it improves things.

12+hrs of use and no Wunderground errors on 0.53.1.