DarwinsBuddy / WienerNetzeSmartmeter

A home-assistant integration supporting WienerNetze Smartmeters as sensors
134 stars 14 forks source link

no data showing up after (version 1.43) KeyError: "Sum" in Logfile #212

Closed W-M-B closed 8 months ago

W-M-B commented 8 months ago

Hello, I am using the latest version from home assistant in x86 PC and using WNSM module since October including the data. I like it very much having all in 1 System. I had the data interruption due to the api change in December and updated to version 1.43 the day it was released. But I still have no data showing up. I restarted Home assistant x2 no change. This is the logfile extract

Logger: homeassistant.components.sensor
Source: helpers/entity_platform.py:573
Integration: Sensor (documentation, issues)
First occurred: 14. Januar 2024 um 14:19:25 (1 occurrences)
Last logged: 14. Januar 2024 um 14:19:25

wnsm: Error on device update!
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 573, in _async_add_entity
await entity.async_device_update(warning=False)
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1216, in async_device_update
await self.async_update()
File "/config/custom_components/wnsm/statistics_sensor.py", line 80, in async_update
_sum = Decimal(last_inserted_stat[self._id][0]["sum"])
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^
KeyError: 'sum'

the webportal from WienerNetze shows data. is this something on my device I can do, or is this something in the code? I can look.

GH-ChristianHauser commented 8 months ago

I am quiet new with HA and had the Smartmeter Integration never up and running. But I think I'm facing the same issue. Posted about my status here: https://github.com/DarwinsBuddy/WienerNetzeSmartmeter/discussions/211

DarwinsBuddy commented 8 months ago

I released a new version with some fixes to the statistics import. Please remove the whole integration once and reinstall it. I'll close this ticket, please reopen a new ticket when the issue still persists.

W-M-B commented 8 months ago

hi,

  1. I first removed the integration entities (HA requested this prior to removing the wnsm integration)
  2. real reboot of HA
  3. I removed the wnsm integration in hacs
    1. real reboot of HA
  4. checked that integration is gone.
  5. install wnsm via HACS
  6. real reboot of HA
  7. configured wnsm via GUI

all data there 👯‍♂️ very happy. I was expected to have lost some data. Problem Solved ! thank you @DarwinsBuddy