Error while setting up platform volkszaehler
Traceback (most recent call last):
File “/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py”, line 128, in _async_setup_platform
SLOW_SETUP_MAX_WAIT, loop=hass.loop)
File “/usr/local/lib/python3.6/asyncio/tasks.py”, line 358, in wait_for
return fut.result()
File “/usr/local/lib/python3.6/site-packages/homeassistant/components/sensor/volkszaehler.py”, line 65, in async_setup_platform
await vz_api.async_update()
File “/usr/local/lib/python3.6/site-packages/homeassistant/components/sensor/volkszaehler.py”, line 134, in async_update
await self.api.get_data()
File “/usr/local/lib/python3.6/site-packages/volkszaehler/init.py”, line 44, in get_data
self.average = self.data[‘data’][‘average’]
TypeError: list indices must be integers or slices, not str
i got 019-10-16 20:52:56 ERROR (MainThread) [volkszaehler] Can not load data from Volkszaehler API
2019-10-16 20:52:56 ERROR (MainThread) [homeassistant.components.volkszaehler.sensor] Unable to fetch data from the Volkszaehler API
2019-10-16 20:53:00 ERROR (MainThread) [homeassistant.components.sensor] volkszaehler: Error on device update!
Have you an Idea what i could do ? or is the Problem on Volkszaehler.org ?
i got these errors but i don´t know how i can solved it.
019-10-16 21:47:54 ERROR (MainThread) [volkszaehler] Can not load data from Volkszaehler API
2019-10-16 21:47:54 ERROR (MainThread) [homeassistant.components.volkszaehler.sensor] Unable to fetch data from the Volkszaehler API
2019-10-16 21:47:54 WARNING (MainThread) [homeassistant.components.sensor] Setup of platform volkszaehler is taking over 10 seconds.
2019-10-16 21:47:57 ERROR (MainThread) [homeassistant.components.sensor] volkszaehler: Error on device update!
Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/helpers/entity_platform.py”, line 292, in _async_add_entity
await entity.async_device_update(warning=False)
File “/usr/src/homeassistant/homeassistant/helpers/entity.py”, line 439, in async_device_update
await self.async_update()
File “/usr/src/homeassistant/homeassistant/components/volkszaehler/sensor.py”, line 119, in async_update
self._state = round(getattr(self.vz_api.api, self.type), 2)
TypeError: type NoneType doesn’t define round method
But now I might have the same problem as the author of the thread. I get the following error message:
2020-03-12 17:55:33 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up volkszaehler platform for sensor
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 179, in _async_setup_platform
await asyncio.wait_for(asyncio.shield(task), SLOW_SETUP_MAX_WAIT)
File "/usr/local/lib/python3.7/asyncio/tasks.py", line 442, in wait_for
return fut.result()
File "/usr/src/homeassistant/homeassistant/components/volkszaehler/sensor.py", line 68, in async_setup_platform
await vz_api.async_update()
File "/usr/src/homeassistant/homeassistant/components/volkszaehler/sensor.py", line 136, in async_update
await self.api.get_data()
File "/usr/local/lib/python3.7/site-packages/volkszaehler/__init__.py", line 44, in get_data
self.average = self.data['data']['average']
KeyError: 'data'
Logger: homeassistant.components.sensor
Source: components/volkszaehler/sensor.py:120
Integration: Sensor (documentation, issues)
First occurred: 15:43:10 (4 occurrences)
Last logged: 15:43:10
volkszaehler: Error on device update!
Same Problem here:
Traceback (most recent call last): File “/usr/src/homeassistant/homeassistant/helpers/entity_platform.py”, line 324, in _async_add_entity await entity.async_device_update(warning=False) File “/usr/src/homeassistant/homeassistant/helpers/entity.py”, line 474, in async_device_update await self.async_update() File “/usr/src/homeassistant/homeassistant/components/volkszaehler/sensor.py”, line 120, in async_update self._state = round(getattr(self.vz_api.api, self.type), 2) TypeError: type NoneType doesn’t define round method
Hi,
I did not like to have the middleware running and only connect directly with vzlogger (via MQTT). You can setup mqtt in the vzlogger.conf and use the Mosquitto Addon in homeassistant. See also my post here:
Url have to have this format:
{{protocol}}://{{ip-address}}/middleware.php/data/{{uuid}}.json
Wrong url is (without middleware.php):
{{protocol}}://{{ip-address}}/data/{{uuid}}.json