0.78.3 Volkszaehler

I was using Rest to fetch the data from my volkszaehler installation and that is working

  • platform: rest
    name: vzLoggerT
    resource: http://192.168.188.85:8080
    value_template: ‘{{ value_json.data[0].tuples[0][1] }}’
    unit_of:measurement: “Wh”
  • platform: rest
    name: vzLoggerC
    resource: http://192.168.188.85:8080
    value_template: ‘{{ value_json.data[1].tuples[0][1] }}’
    unit_of:measurement: “W”

but when trying the new volkszaehler sensor it is not working
e.g.

  • platform: volkszaehler
    host: 192.168.188.85
    port: 8080
    uuid: ‘fde8f1d0-c5d0-11e0-856e-XXXXXXX’
    monitored_conditions:
    • average

did somebody get it working

I only get an error in log
documentation also does not tell me which uuid to take. there is one for the total sum and one for the current watts …

Any help appreciated thanks,
Chris

Wed Sep 26 2018 11:46:06 GMT+0200 (Mitteleuropäische Sommerzeit)

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 tryed this example on the homepage from home assistant.
With the uuid: from volkszaehler.org.

Example configuration.yaml entry

sensor:

  • platform: volkszaehler
    host: demo.volkszaehler.org
    uuid: ‘57acbef0-88a9-11e4-934f-6b0f9ecd95a8’
    monitored_conditions:
    • average
    • consumption
    • min
    • max

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!

has anyone a clou ?? and can help please ?

I see a traceback during startup but the underlying module seems to work fine.

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

@Phoenix I got exactly the same error because I added the port behind the ip address(host: 192.168.1.x:8080) but the port address must be in a separate line! See https://www.home-assistant.io/integrations/volkszaehler/

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'

Anybody got any ideas why this happens ?

Protokolldetails ( ERROR )

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

If i use the ip adresse instead the hostname it works fine

 - platform: volkszaehler
    host: 192.168.0.1
    uuid: 'enter your uuid'
    monitored_conditions:
      - average
      - consumption
      - min
      - max

Have fun!

I have the same Problem:

volkszaehler: Error on device update!
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 319, in _async_add_entity
    await entity.async_device_update(warning=False)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 463, in async_device_update
    await self.async_update()  # type: ignore
  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

Now, after a few Restarts it works.
But the values differ from the Volkszähler web interface

Hello,

Unfortunately I was not lucky with multiple restarts.
Could you share your configuration one more time?

Is someone working on this bug?

Regards

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:

This setup is so far very stable.