Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

opower core integration - list index out of range error #138955

Open
EagleDTW opened this issue Feb 20, 2025 · 4 comments
Open

opower core integration - list index out of range error #138955

EagleDTW opened this issue Feb 20, 2025 · 4 comments
Assignees

Comments

@EagleDTW
Copy link

The problem

List Index out of range error on opower integration for past 5 or so core updates for PG&E account. Had opower working about 3 months ago solid, then got the error in the title and thought it would resolve after a few major revisions of the integration...no luck, is there a method to reset the index back into the expected range?

HAOS
Core 2025.2.4
Supervisor 2025.02.1
Operating System 14.2
Frontend 20250214.0

Thank you,
Daniel

What version of Home Assistant Core has the issue?

2025.2.4

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

opower

Link to integration documentation on our website

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

Diagnostics information

No response

Example YAML snippet

Anything in the logs that might be useful for us?

Logger: homeassistant.components.opower.coordinator
Source: helpers/update_coordinator.py:380
integration: Opower (documentation, issues)
First occurred: 11:18:59 AM (524 occurrences)
Last logged: 11:43:48 PM

Unexpected error fetching Opower data
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 380, in _async_refresh
self.data = await self._async_update_data()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/opower/coordinator.py", line 96, in _async_update_data
await self._insert_statistics()
File "/usr/src/homeassistant/homeassistant/components/opower/coordinator.py", line 169, in _insert_statistics
cost_sum = cast(float, stats[cost_statistic_id][0]["sum"])
~~~~~~~~~~~~~~~~~~~~~~~~^^^
IndexError: list index out of range

Additional information

No response

@home-assistant
Copy link

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

Code owner commands

Code owners of opower 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 opower 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)


opower documentation
opower source
(message by IssueLinks)

@EagleDTW
Copy link
Author

Hi @tronikos,

Looks like this is the same possibly as #113916
don't fully know this command's breakdown, as I've tried a few variants and not successful it says that the file does not exist...should this be updated modified in some way?

docker exec -it $(docker ps -f name=homeassistant -q) bash nano /usr/src/homeassistant/homeassistant/components/opower/coordinator.py

Type :112 to go to line 112
Type i to go into insert mode
Change consumption_statistic_id to cost_statistic_id
Press Esc
Type :wq to write and quit
Restart home assistant

Thank you,
Daniel

@EagleDTW
Copy link
Author

apparently in docker image that's used there is no nano, when I use the command exactly as posted I get the addon terminal prompt to go down to bquote>

@EagleDTW
Copy link
Author

Is there any other way to get to the file to edit it I'm on the arm version of HAOS so not so easy to get an editor working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants