tronikos / opower

A Python library for getting historical and forecasted usage/cost from utilities that use opower.com such as PG&E
Apache License 2.0
53 stars 49 forks source link

ConEd first authentication can fail, succeeds on reload #52

Open rct opened 8 months ago

rct commented 8 months ago

For some users, the initial ConEd authentication through Home Assistant can fail. However, valid credentials have been entered and the authentication succeeds when the integration is reloaded or Home Assistant is restarted.

The error is Config entry 'Consolidated Edison (ConEd) (user@host)' for opower integration could not authenticate: 2FA code was invalid. Is the secret wrong?

@Sebmaster didn't run into the problem with his own account during development, but I think his theory was (from my logs in discussion #30) that a second authentication attempt was occurring which reused the TOTP code before it rolled over, possibly due to multiple accounts under the same user.

The problem does not occur with demo.py. The logging that seems to be available with debug doesn't yield much.

I've seen other reports of this problem on the hass forum IIRC.

holocronology commented 2 months ago

I had the same issue when finally setting this up yesterday. Resolved itself after a restart.