Closed bbrendon closed 6 years ago
Currently running 0.52.1 and seeing the same behavior. Wundergound sensor just throws whatever the API gives it:
EDIT - A restart fixes the issue. For what it's worth, this is the first time I've ever noticed this problem. I am seeing a similar problem in the logs after restart, but the sensor data (that I use, anyways) looks OK right now.
Traceback (most recent call last):
File "/srv/hass/hass_venv/lib/python3.4/site-packages/aiohttp/web_protocol.py", line 422, in start
resp = yield from self._request_handler(request)
File "/srv/hass/hass_venv/lib/python3.4/site-packages/aiohttp/web.py", line 306, in _handle
resp = yield from handler(request)
File "/usr/lib/python3.4/asyncio/coroutines.py", line 143, in coro
res = yield from res
File "/usr/lib/python3.4/asyncio/coroutines.py", line 143, in coro
res = yield from res
File "/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/components/http/ban.py", line 58, in ban_middleware_handler
return (yield from handler(request))
File "/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/components/http/__init__.py", line 421, in handle
result = handler(request, **request.match_info)
File "/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/components/api.py", line 186, in get
return self.json(request.app['hass'].states.async_all())
File "/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/components/http/__init__.py", line 363, in json
result, sort_keys=True, cls=rem.JSONEncoder).encode('UTF-8')
File "/usr/lib/python3.4/json/__init__.py", line 237, in dumps
**kw).encode(obj)
File "/usr/lib/python3.4/json/encoder.py", line 192, in encode
chunks = self.iterencode(o, _one_shot=True)
File "/usr/lib/python3.4/json/encoder.py", line 250, in iterencode
return _iterencode(o, 0)
File "/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/remote.py", line 141, in default
return json.JSONEncoder.default(self, o)
File "/usr/lib/python3.4/json/encoder.py", line 173, in default
raise TypeError(repr(o) + " is not JSON serializable")
TypeError: <function WUDailySimpleForecastSensorConfig.__init__.<locals>.<lambda> at 0x6e3812b8> is not JSON serializable
2017-09-09 16:29:31 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
File "/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/remote.py", line 132, in default
return json.JSONEncoder.default(self, o)
File "/usr/lib/python3.4/json/encoder.py", line 173, in default
raise TypeError(repr(o) + " is not JSON serializable")
TypeError: <function WUDailySimpleForecastSensorConfig.__init__.<locals>.<lambda> at 0x6e3812b8> is not JSON serializable
I am also seeing these in Wunderground. This looks relevant in the logs:
2017-09-11 13:04:34 ERROR (Thread-35) [homeassistant.sensor.wunderground] Check WUnderground API ('Expecting value: line 2 column 1 (char 1)',)
Hass 0.50.2
I found this in the database stored for my pws_temp_f entity while I was researching data reliability issues from wunderground (value based). I wasn't expecting to find a string where there is usually (should only be) float.
It appears wunderground sensor doesn't make sure its storing a float in the database. It just dumps whatever.