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
73.45k stars 30.69k forks source link

List index out of range error in iotawatt #125038

Open tomlut opened 2 months ago

tomlut commented 2 months ago

The problem

The following error is reported at midnight occasionally:

Logger: homeassistant.components.iotawatt.coordinator
Source: helpers/update_coordinator.py:354
integration: IoTaWatt (documentation, issues)
First occurred: 00:00:00 (1 occurrences)
Last logged: 00:00:00

Unexpected error fetching 10.1.1.250 data
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 354, in _async_refresh
    self.data = await self._async_update_data()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/iotawatt/coordinator.py", line 78, in _async_update_data
    await self.api.update(lastUpdate=self._last_run)
  File "/usr/local/lib/python3.12/site-packages/iotawattpy/iotawatt.py", line 81, in update
    await self._refreshSensors(timespan, lastUpdate)
  File "/usr/local/lib/python3.12/site-packages/iotawattpy/iotawatt.py", line 278, in _refreshSensors
    sensor.setValue(values[0][idx + 1])
                    ~~~~~~^^^
IndexError: list index out of range

What version of Home Assistant Core has the issue?

core-2024.9.0b1

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Iotawatt

Link to integration documentation on our website

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

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

home-assistant[bot] commented 2 months ago

Hey there @gtdiehl, @jyavenard, mind taking a look at this issue as it has been labeled with an integration (iotawatt) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `iotawatt` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign iotawatt` Removes the current integration label and assignees on the issue, add the integration domain after the command. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


iotawatt documentation iotawatt source (message by IssueLinks)