GuyKh / iec-custom-component

HomeAssistant Custom Component for IEC
MIT License
128 stars 5 forks source link

Unexpected error fetching Iec data #192

Open Voklaif opened 4 hours ago

Voklaif commented 4 hours ago

System Health details

System Information

version core-2024.7.4
installation_type Home Assistant Container
dev false
hassio false
docker true
user root
virtualenv false
python_version 3.12.4
os_name Linux
os_version 6.1.0-26-amd64
arch x86_64
timezone Asia/Jerusalem
config_dir /config
Home Assistant Community Store GitHub API | ok -- | -- GitHub Content | ok GitHub Web | ok GitHub API Calls Remaining | 4767 Installed Version | 1.34.0 Stage | running Available Repositories | 1455 Downloaded Repositories | 31
Home Assistant Cloud logged_in | false -- | -- can_reach_cert_server | ok can_reach_cloud_auth | ok can_reach_cloud | ok
Dashboards dashboards | 9 -- | -- resources | 17 views | 11 mode | storage
Recorder oldest_recorder_run | October 15, 2024 at 5:58 AM -- | -- current_recorder_run | October 25, 2024 at 8:40 PM estimated_db_size | 425.27 MiB database_engine | sqlite database_version | 3.45.3

Checklist

Describe the issue

Error of Failed to setup.

Error log:

This error originated from a custom integration.

Logger: custom_components.iec.coordinator
Source: helpers/update_coordinator.py:312
integration: Israel Electric Corporation (IEC) (documentation, issues)
First occurred: 8:40:56 PM (32 occurrences)
Last logged: 9:24:24 PM

Unexpected error fetching Iec data
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 312, in _async_refresh
    self.data = await self._async_update_data()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/iec/coordinator.py", line 547, in _async_update_data
    if not future_consumption[device.device_number].future_consumption:
           ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
KeyError: '23418759'

Reproduction steps

No idea, it used to work and now it stopped.

Debug logs

2024-10-25 20:40:45.175 INFO (MainThread) [homeassistant.setup] Setting up iec
2024-10-25 20:40:45.175 INFO (MainThread) [homeassistant.setup] Setup of domain iec took 0.00 seconds
2024-10-25 20:40:45.176 DEBUG (MainThread) [custom_components.iec.coordinator] Loading API token from config entry
2024-10-25 20:40:45.177 DEBUG (MainThread) [iec_api.iec_client] jwt.py token expired, refreshing token
2024-10-25 20:40:45.177 DEBUG (MainThread) [iec_api.commons] HTTP POST: https://iec-ext.okta.com/oauth2/default/v1/token

Diagnostics dump

No response

GuyKh commented 3 hours ago

It looks like your device number is wrong. Did they change somehow your meter or so?