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
70.45k stars 29.38k forks source link

integration: volkszaehler not working #95670

Closed winkler-winsen closed 3 weeks ago

winkler-winsen commented 1 year ago

The problem

volkszaehler.org integration not working properly

My volkszaehler (vz) works well on Raspi and later as Docker container. vzlogger collects data and transmits to middleware. Middleware is working and useable at http://192.168.178.46:8080. 192.168.178.46 is Docker host for Home Assistant (HA) and volkszaehler (vz). Vz middleware http://192.168.178.46:8080 is reachable from inside other Docker containers. Tested with curl.

my tries:

  1. First I tried with vz on separate Raspi. Didn't work. So I moved to volkszaehler Docker container for managing faster config change.
  2. Tried this with a new container installation. Reset all data in /config. Same error
  3. Tried with vz hostname, localhost and IP in config/configuration.yaml

vz build from source

$ tail -f /var/log/vzlogger/vzlogger.log
[Jul 01 13:22:46][main] vzlogger v0.8.1 based on heads/master-0-g27eb8d1566 from Wed, 28 Sep 2022 16:27:45 +0200 started.
$ vzlogger -V
0.8.1
 based on git version: heads/master-0-g27eb8d1566
 last commit date: Wed, 28 Sep 2022 16:27:45 +0200

HA docker-compose.yaml

version: '3'
services:
  homeassistant:
    container_name: homeassistant
    image: "ghcr.io/home-assistant/home-assistant:stable"
    volumes:
      - /PATH_TO_YOUR_CONFIG:/config
      - /etc/localtime:/etc/localtime:ro
    restart: unless-stopped
    privileged: true
    network_mode: host

(PATH_TO_YOUR_CONFIG ist properly set and working)

HA /config/configuration.yaml

# Loads default set of integrations. Do not remove.
default_config:

# Load frontend themes from the themes folder
frontend:
  themes: !include_dir_merge_named themes

# Text-to-speech
tts:
  - platform: google_translate

automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml

sensor:
  - platform: volkszaehler
    host: "192.168.178.46"
    port: "8080"
    uuid: "55a83bf0-1801-11ee-86b7-25b3ff36c640"

my tries in /config/configuration.yaml

  1. uuid: is double checked!
  2. host: with localhost, hostname and IP
  3. monitored_conditions: with and without
  4. monitored_conditions: with sample config from integration page - average - consumption - min - max
  5. monitored_conditions: with sample config from integration page without - average

What version of Home Assistant Core has the issue?

core-2023.6.3

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Container

Integration causing the issue

volkszaehler

Link to integration documentation on our website

https://www.home-assistant.io/integrations/volkszaehler

Diagnostics information

home-assistant.log

Example YAML snippet

sensor:
  - platform: volkszaehler
    host: "192.168.178.46"
    port: "8080"
    uuid: "55a83bf0-1801-11ee-86b7-25b3ff36c640"

Anything in the logs that might be useful for us?

2023-07-01 14:48:32.934 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 320, in _async_setup_platform
    await asyncio.shield(task)
  File "/usr/src/homeassistant/homeassistant/components/volkszaehler/sensor.py", line 105, in async_setup_platform
    await vz_api.async_update()
  File "/usr/src/homeassistant/homeassistant/components/volkszaehler/sensor.py", line 159, in async_update
    await self.api.get_data()
  File "/usr/local/lib/python3.11/site-packages/volkszaehler/__init__.py", line 68, in get_data
    self.average = self.data["data"]["average"]
                   ~~~~~~~~~^^^^^^^^
KeyError: 'data'

Additional information

No response

home-assistant[bot] commented 1 year ago

volkszaehler documentation volkszaehler source

LokAndFeel commented 1 year ago

I see the same error on my installation

winkler-winsen commented 1 year ago

Same error on new Version core-2023.7.1 (Container)

2023-07-10 14:29:05.577 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 353, in _async_setup_platform
    await asyncio.shield(task)
  File "/usr/src/homeassistant/homeassistant/components/volkszaehler/sensor.py", line 105, in async_setup_platform
    await vz_api.async_update()
  File "/usr/src/homeassistant/homeassistant/components/volkszaehler/sensor.py", line 159, in async_update
    await self.api.get_data()
  File "/usr/local/lib/python3.11/site-packages/volkszaehler/__init__.py", line 68, in get_data
    self.average = self.data["data"]["average"]
                   ~~~~~~~~~^^^^^^^^
KeyError: 'data'
issue-triage-workflows[bot] commented 10 months ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

winkler-winsen commented 10 months ago

Same error on new Version core-2023.10.1 (Container)

2023-10-10 23:43:08.834 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 359, in _async_setup_platform
    await asyncio.shield(task)
  File "/usr/src/homeassistant/homeassistant/components/volkszaehler/sensor.py", line 105, in async_setup_platform
    await vz_api.async_update()
  File "/usr/src/homeassistant/homeassistant/components/volkszaehler/sensor.py", line 159, in async_update
    await self.api.get_data()
  File "/usr/local/lib/python3.11/site-packages/volkszaehler/__init__.py", line 68, in get_data
    self.average = self.data["data"]["average"]
                   ~~~~~~~~~^^^^^^^^
KeyError: 'data'
issue-triage-workflows[bot] commented 7 months ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

winkler-winsen commented 7 months ago

Still not working on 2024.1.2

2024-01-07 05:19:45.300 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 360, in _async_setup_platform
await asyncio.shield(task)
File "/usr/src/homeassistant/homeassistant/components/volkszaehler/sensor.py", line 105, in async_setup_platform
await vz_api.async_update()
File "/usr/src/homeassistant/homeassistant/components/volkszaehler/sensor.py", line 159, in async_update
await self.api.get_data()
File "/usr/local/lib/python3.11/site-packages/volkszaehler/__init__.py", line 68, in get_data
self.average = self.data["data"]["average"]
~~~~~~~~~^^^^^^^^
KeyError: 'data'
Benj-a-min commented 6 months ago

Just installed Sensor, connecting to latest 2022-06-10-raspi-complete image. Perfect. Config as described:

uuid = Channel-uuid

jan666 commented 4 months ago

I have the same "issue". But it's more like a configuraton issue I guess.

In my vzlogger.conf I have channels - { "aggmode": "none" } so my data looks like this:

{
  "version": "0.8.3",
  "generator": "vzlogger",
  "data": [
    {
      "uuid": "...",
      "last": 1713168179862,
      "interval": -1,
      "protocol": "sml",
      "tuples": [
        [
          1713168179862,
          197.68390000000002
        ]
      ]
    }
  ]
}

No average, no min, no max. But the integration seems to only support those.

Could you maybe add "last" to "monitored_conditions"? I want to write the raw data without aggregation to influxdb via vzlogger so I dont want to change the aggmode

issue-triage-workflows[bot] commented 1 month ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.