PiotrMachowski / Home-Assistant-custom-components-Tauron-AMIplus

This sensor uses unofficial API to get energy usage and generation data from https://elicznik.tauron-dystrybucja.pl.
MIT License
138 stars 34 forks source link

Sensors will not load on version v2.4.5 - KeyError: 'balanced_consumption' #96

Closed convicte closed 1 year ago

convicte commented 1 year ago
This error originated from a custom integration.

Logger: custom_components.tauron_amiplus.coordinator
Source: custom_components/tauron_amiplus/statistics.py:54
Integration: Tauron AMIplus (documentation, issues)
First occurred: January 24, 2023 at 18:27:36 (8 occurrences)
Last logged: 09:35:46

Unexpected error fetching tauron_amiplus data: 'balanced_consumption'
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 225, in _async_refresh
    self.data = await self._async_update_data()
  File "/config/custom_components/tauron_amiplus/coordinator.py", line 31, in _async_update_data
    await self.generate_statistics(data)
  File "/config/custom_components/tauron_amiplus/coordinator.py", line 37, in generate_statistics
    await statistics_updater.update_all(data)
  File "/config/custom_components/tauron_amiplus/statistics.py", line 54, in update_all
    stat = await self.get_stats(raw_data[v["data_source"]], s)
KeyError: 'balanced_consumption'

image

PiotrMachowski commented 1 year ago

This error has been fixed (#94), it seems that you don't have v2.4.5 installed, as the line number in log matches v2.4.4.

v2.4.5: image

v2.4.4: image

convicte commented 1 year ago

Thanks - worked like a charm!

I've checked in HACS, and it was showing me the latest version of 2.4.5, while it obviously wasn't on it. After I 're-downloaded' the version, things came back up! Sorry for the trouble.