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

srp_energy component not working: Value error connecting to SRP. too many values to unpack (expected 4) #18899

Closed
ConnorGriffin opened this issue Dec 1, 2018 · 7 comments

Comments

@ConnorGriffin
Copy link

ConnorGriffin commented Dec 1, 2018

Getting an error on startup when using the srp_energy component.

Error: Value error connecting to SRP. too many values to unpack (expected 4)

Config:

- platform: srp_energy
  username: !secret srp_username
  password: !secret srp_password
  id: !secret srp_id

AdrianG on the forums is getting the same error: https://community.home-assistant.io/t/srp-energy-sensor-added-in-83-not-working-getting-errors/81804

@ConnorGriffin
Copy link
Author

ConnorGriffin commented Dec 13, 2018

Seems like this issue is caused by the data containing an unexpected extra column. In my case this is the 'rate' column that defines whether the power was consumed on-peak or off-peak.

Here are the parts of the code that are probably throwing the error:

        history = [{
            ATTR_READING_TIME: isodate,
            ATTR_READING_USAGE: kwh,
            ATTR_READING_COST: cost
            } for _, _, isodate, kwh, cost in self._usage]
            for _, _, _, kwh, _ in usage:
                daily_usage += float(kwh)

I'm not sure what the solution is, since it seems like not everyone will have this extra 'rate' column. I guess we'd have to strip that column out of self._usage if it exists?

@keassol
Copy link

keassol commented Mar 6, 2019

Has there been any progress on this? I would be happy to provide test data or do what I can to help.

@ConnorGriffin
Copy link
Author

No progress from me on this. I will see what I can do this week. It should be a relatively easy fix I just don't have any kind of HomeAssistant development environment setup right now.

@keassol
Copy link

keassol commented Mar 22, 2019

It looks like this was fixed in srpenergy 1.0.6 and pushed to PyPI so if we change line 22 to
REQUIREMENTS = ['srpenergy==1.0.6']
and update the package it may work.

@robbiet480
Copy link
Member

@keassol Please test my PR #22307. Will merge it once I hear back from you.

@keassol
Copy link

keassol commented Mar 22, 2019

FYI, just tested this as a custom component and it works. No more error and the sensor is being loaded with the data from SRP.

@robbiet480
Copy link
Member

@keassol Mind marking that PR "approved" then?

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

4 participants