Giter Club home page Giter Club logo

Comments (13)

sven-debug avatar sven-debug commented on July 17, 2024 1

Here you go...
home-assistant.log

from core.

home-assistant avatar home-assistant commented on July 17, 2024

volkszaehler documentation
volkszaehler source

from core.

mib1185 avatar mib1185 commented on July 17, 2024

you need to set the proper port in your yaml (seems to be 8081 in your case)

from core.

sven-debug avatar sven-debug commented on July 17, 2024

@mib1185 That does not work at all.

Neither XXX.XXX.XXX.XXX:8081
Nor `# Standard-VZ-Integration

  • platform: volkszaehler
    host: XXX.XXX.XXX.XXX
    port: 8081
    uuid: "8d3353b0-1140-11ef-a931-df6ccdXXXXXX"
    name: "Volkszähler Verbrauch"
    monitored_conditions:
    • average
    • consumption
    • min
    • max`

works. The latter one throws:
`Logger: homeassistant.components.sensor
Quelle: helpers/entity_platform.py:366
Integration: Sensor (Dokumentation, Probleme)
Erstmals aufgetreten: 11:38:05 (2 Vorkommnisse)
Zuletzt protokolliert: 11:38:05

Error while setting up volkszaehler platform for sensor
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 366, in _async_setup_platform
await asyncio.shield(awaitable)
File "/usr/src/homeassistant/homeassistant/components/volkszaehler/sensor.py", line 106, in async_setup_platform
await vz_api.async_update()
File "/usr/src/homeassistant/homeassistant/components/volkszaehler/sensor.py", line 160, in async_update
await self.api.get_data()
File "/usr/local/lib/python3.12/site-packages/volkszaehler/init.py", line 68, in get_data
self.average = self.data["data"]["average"]
~~~~~~~~~~~~~~~~~^^^^^^^^^^^
TypeError: list indices must be integers or slices, not str`

from core.

mib1185 avatar mib1185 commented on July 17, 2024

is the error message every time (when trying XXX.XXX.XXX.XXX:8081 or port: 8081 or without port) the same?

from core.

sven-debug avatar sven-debug commented on July 17, 2024

No, the call with http://XXX.XXX.XXX.XXX:8081

produces this message:
`Logger: homeassistant.components.volkszaehler.sensor
Quelle: components/volkszaehler/sensor.py:163
Integration: volkszaehler (Dokumentation, Probleme)
Erstmals aufgetreten: 12:29:55 (4 Vorkommnisse)
Zuletzt protokolliert: 12:30:20

Unable to fetch data from the Volkszaehler API`

When I try it with no port added, I do not even get an error. But there are no values put through.

When I compare the examples on the official integration page (https://www.home-assistant.io/integrations/volkszaehler/) with my config, it is pretty equal. Only thing that is different, I configured using an IP adress instead of a qualified hostname. But that worked fpr months now. Don't know what is different now and changed from 2024.6.2 to 2024.6.3.

from core.

mib1185 avatar mib1185 commented on July 17, 2024

Don't know what is different now and changed from 2024.6.2 to 2024.6.3.

last change in volkszaehler is 3 months ago, so there is no recent code change

from core.

mib1185 avatar mib1185 commented on July 17, 2024
File "/usr/local/lib/python3.12/site-packages/volkszaehler/init.py", line 68, in get_data
self.average = self.data["data"]["average"]
~~~~~~~~~~~~~~~~~^^^^^^^^^^^
TypeError: list indices must be integers or slices, not str`

this indicates that your volkszaehler may be return data in wrong format or the python-volkszaehler lib may needs an update to consider maybe new volkszaehler device firmware?

from core.

mib1185 avatar mib1185 commented on July 17, 2024

Please enable debug logging (when configured with the port: 8081 option), restart HA and provide the home-assistant.log afterwards:
To do so add the following to your configuration.yaml:

logger:
  default: info
  logs:
    homeassistant.components.volkszaehler: debug
    volkszaehler: debug

Note: it is better to drag the log into the comment (which will add it as an attachment) and not copy paste as it is hard to read logs in GitHub.

from core.

mib1185 avatar mib1185 commented on July 17, 2024
2024-06-18 15:19:38.339 DEBUG (MainThread) [volkszaehler] Response from Volkszaehler API: 404
2024-06-18 15:19:38.340 DEBUG (MainThread) [volkszaehler] {'version': '0.8.6', 'generator': 'vzlogger', 'data': []}

404 = "not found" ... it seems your volkszaehler has an issue - a quick search provide this forum post

from core.

sven-debug avatar sven-debug commented on July 17, 2024

Funny thing is, it worked until 2 days before wthout any changes. NEither has vzlogger or volkszaehler as such changed nor did my config. Only thing that changed was Home Assistant. Plus: The REST-Calls to vzlogger API work fine. Just the VZ integration doesn't...

from core.

sven-debug avatar sven-debug commented on July 17, 2024

And even more "interesting"... When I comment the port and only stick to the IP address, the result is:

2024-06-18 15:56:00.685 DEBUG (MainThread) [volkszaehler] Response from Volkszaehler API: 200
2024-06-18 15:56:00.686 DEBUG (MainThread) [volkszaehler] Response from Volkszaehler API: 200
2024-06-18 15:56:00.710 DEBUG (MainThread) [volkszaehler] {'version': '0.3', 'data': {'tuples': [[1718584585766, 719.472, 1]], 'uuid': '8d3353b0-1140-11ef-a931-df6ccd247a20', 'from': 1718584555744, 'to': 1718584585766, 'min': [1718584585766, 719.4723870628372], 'max': [1718584585766, 719.4723870628372], 'average': 719.472, 'consumption': 6, 'rows': 2}}
2024-06-18 15:56:00.712 DEBUG (MainThread) [volkszaehler] {'version': '0.3', 'data': {'tuples': [[1718584380346, 0, 1]], 'uuid': '480f7900-1140-11ef-b2bb-dd3e03d1aa11', 'from': 1718583750455, 'to': 1718584380346, 'min': [1718584380346, 0], 'max': [1718584380346, 0], 'average': 0, 'consumption': 0, 'rows': 2}}

But there is no values in my dashboards and not even in the developer tools...

home-assistant.log

from core.

cniweb avatar cniweb commented on July 17, 2024

I get an identical error message during integration:

Logger: homeassistant.components.sensor
Quelle: helpers/entity_platform.py:366
Integration: Sensor (Dokumentation, Probleme)
Erstmals aufgetreten: 21:13:44 (2 Vorkommnisse)
Zuletzt protokolliert: 21:13:44

Error while setting up volkszaehler platform for sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 366, in _async_setup_platform
    await asyncio.shield(awaitable)
  File "/usr/src/homeassistant/homeassistant/components/volkszaehler/sensor.py", line 106, in async_setup_platform
    await vz_api.async_update()
  File "/usr/src/homeassistant/homeassistant/components/volkszaehler/sensor.py", line 160, in async_update
    await self.api.get_data()
  File "/usr/local/lib/python3.12/site-packages/volkszaehler/__init__.py", line 68, in get_data
    self.average = self.data["data"]["average"]
                   ~~~~~~~~~~~~~~~~~^^^^^^^^^^^
TypeError: list indices must be integers or slices, not str

I can confirm, the REST-Calls to vzlogger API work fine.

from core.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.