home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
73.7k stars 30.83k forks source link

Zestimate Failing #23272

Closed edif30 closed 5 years ago

edif30 commented 5 years ago

Home Assistant release with the issue: Any**

Last working Home Assistant release (if known):ALL are affected**

Operating environment (Hass.io/Docker/Windows/etc.):Docker**

Component/platform:Zestimate**

Description of problem:See traceback** Component fails to load on restart.

Traceback (if applicable):

2019-04-20 12:13:39 ERROR (MainThread) [homeassistant.components.sensor] zestimate: Error on device update!
Traceback (most recent call last):
  File "/usr/src/app/homeassistant/helpers/entity_platform.py", line 261, in _async_add_entity
    await entity.async_device_update(warning=False)
  File "/usr/src/app/homeassistant/helpers/entity.py", line 379, in async_device_update
    await self.hass.async_add_executor_job(self.update)
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/app/homeassistant/util/__init__.py", line 224, in wrapper
    result = method(*args, **kwargs)
  File "/usr/src/app/homeassistant/components/zestimate/sensor.py", line 126, in update
    details[ATTR_CHANGE] = int(data['valueChange']['#text'])
TypeError: 'NoneType' object is not subscriptable
dreed47 commented 5 years ago

I'm seeing exact same behavior and error message.

dshokouhi commented 5 years ago

Maybe Zillow is having issues? Seeing same issue here.

dreed47 commented 5 years ago

Their API seems to be working ok

http://www.zillow.com/webservice/GetZestimate.htm?zws-id=&zpid=48749425

dshokouhi commented 5 years ago

Look at the response it gave you. Did the API change?

dreed47 commented 5 years ago

sorry, meant ....

http://www.zillow.com/webservice/GetZestimate.htm?zws-id=YOURZWSID&zpid=48749425

where YOURZWSID is yours. This returned valid data for me.

dshokouhi commented 5 years ago

@dreed47 look at the variable for valueChange is yours blank? This is what I see <valueChange/> Def the reason for the error.

Edit: it looks like your ZPID has the same data as mine.

dreed47 commented 5 years ago

Yeah, not sure if it's an official change in their API or just an issue on their side. https://www.zillow.com/howto/api/GetZestimate.htm

But it seems the HA code should handle an empty value just in case.

dshokouhi commented 5 years ago

@dreed47 not in this particular case: https://github.com/home-assistant/home-assistant/blob/dev/homeassistant/components/zestimate/sensor.py#L119

The code just checks if the API is there, then it assumes all the data is present.

dreed47 commented 5 years ago

yeah, just saw that :(