Closed CircuitSetup closed 1 year ago
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!
(message by CodeOwnersMention)
opower documentation opower source (message by IssueLinks)
Without access to an account it's hard to debug this. Do you think you could temporarily change your password and privately share username/password with me? You can find me in the community forum and discord as tronikos.
Actually I think I found the issue
Until the fix is reviewed, merged and released, could you please try https://github.com/tronikos/opower-hacs/ and report whether it fixed it for you?
Until the fix is reviewed, merged and released, could you please try https://github.com/tronikos/opower-hacs/ and report whether it fixed it for you?
Thanks so much! I'll take a look.
I realized that Peco's site is broken, and opower won't load at all. It's possible it was like this before I loaded your HACs version.
Now I'm getting this error: 403, message='Forbidden', url=URL('https://peco.opower.com/ei/edge/apis/multi-account-v1/cws/peco/customers?offset=0&batchSize=100&addressFilter=')
Can you try the latest 0.0.18 from https://github.com/tronikos/opower-hacs/?
You can also try the official one in the latest beta 2023.8.0b3
Back to this error, but the Peco site still doesn't load Opower data:
2023-08-01 15:13:42.611 ERROR (MainThread) [homeassistant.components.opower.coordinator] Unexpected error fetching Opower data: 'NoneType' object has no attribute 'group'
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 283, in _async_refresh
self.data = await self._async_update_data()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/opower/coordinator.py", line 67, in _async_update_data
await self.api.async_login()
File "/usr/local/lib/python3.11/site-packages/opower/opower.py", line 151, in async_login
self.access_token = await self.utility.async_login(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/opower/utilities/exelon.py", line 44, in async_login
settings = json.loads(re.search(r"var SETTINGS = ({.*});", result).group(1))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'group'
To get to the bottom of this I'd need access to a Peco account. If you could privately share your login information it would be great. You can message me in the community forum, discord, or gmail. My username is tronikos in all of them.
I'm not sure that it would matter at the moment since this is what I see when trying to view my usage on their site:
You should be getting a 403 error instead of the exception "AttributeError: 'NoneType' object has no attribute 'group'" that I thought I fixed earlier. I have access to a BGE account, another Exelon subsidiary, and the fix worked for that utility so I'm puzzled why it didn't work for PECO and Atlantic City Electric that use similar pages. Could you try temporarily disabling all other integrations, leaving only Opower to see if you stop getting AttributeError and start getting 403?
Ah, I see. I was only getting a 403 when async_get_clientsession(hass),
was changed to async_create_clientsession(hass),
I disabled all other integrations and got the same error as above.
How can I send you the login info?
You can message me in the community forum, discord, or gmail.com. My username is tronikos in all of them.
fwiw, I'm getting same error with a delmarva power account
2023-08-02 15:11:05.122 ERROR (MainThread) [homeassistant.components.opower.coordinator] Unexpected error fetching Opower data: 'NoneType' object has no attribute 'group'
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 283, in _async_refresh
self.data = await self._async_update_data()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/opower/coordinator.py", line 67, in _async_update_data
await self.api.async_login()
File "/usr/local/lib/python3.11/site-packages/opower/opower.py", line 151, in async_login
self.access_token = await self.utility.async_login(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/opower/utilities/exelon.py", line 44, in async_login
settings = json.loads(re.search(r"var SETTINGS = ({.*});", result).group(1))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'group'
I'm getting an "Unauthorized" error when trying both the HACS and Official version with Evergy. My user/pass are correct, as I can log into the site and view all my account details. Let me know if you need any additional info.
2023-08-02 17:53:54.499 WARNING (MainThread) [homeassistant.config_entries] Config entry 'Evergy (email.email@gmail.com)' for opower integration not ready yet: 401, message='Unauthorized', url=URL('https://kcpk.opower.com/ei/edge/apis/multi-account-v1/cws/kcpk/customers?offset=0&batchSize=100&addressFilter='); Retrying in background
@tube0013 #97651 @suheilpurewal please open up a new issue as it is probably not related to this issue
Same issue here on BGE.
2023-08-02 19:02:34.555 ERROR (MainThread) [homeassistant.components.opower.coordinator] Unexpected error fetching Opower data: 'NoneType' object has no attribute 'group'
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 283, in _async_refresh
self.data = await self._async_update_data()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/opower/coordinator.py", line 67, in _async_update_data
await self.api.async_login()
File "/usr/local/lib/python3.11/site-packages/opower/opower.py", line 151, in async_login
self.access_token = await self.utility.async_login(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/opower/utilities/exelon.py", line 44, in async_login
settings = json.loads(re.search(r"var SETTINGS = ({.*});", result).group(1))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'group'
FWIW their oauth login flow seems really janky and for some reason I can't login to their Android app at all. Maybe related? But if I enter the wrong password into the Opower setup, it does return 'Invalid authentication' so it must at least be getting that far.
EDIT: Ope, missed your note that your fix was successful at BGE in your testing. Will try now.
I have access to a BGE account, another Exelon subsidiary, and the fix worked for that utility
@tronikos I'm still getting the same error with BGE on v0.0.18 via HACS.
Aaaaand at some point in the last couple hours, it finished setting up and started working lol
@home-assistant rename Opower integration fails at setup for Exelon subsidiaries with AttributeError: 'NoneType' object has no attribute 'group'
I consolidated all other issues to this one since all Exelon utilities share the same authorization code anyway. I only have access to a BGE account that someone shared with me on discord. For me it works in a clean install without any other integrations. I suspect the issue is reusing the default client session that is shared among integrations. Could you try manually applying the changes in https://github.com/home-assistant/core/pull/97541? You have to manually edit homeassistant/components/opower/coordinator.py and replace async_get_clientsession with async_create_clientsession.
@tronikos I can give you my Atlantic City Electric login if it helps
Also seem to be having the same issue with Atlantic City Electric, I've enabled debugging but will need to try setting up from scratch to get decent logs if it will help.
Don't yet have time to try the manual fixes mentioned above yet though!
I have the same error as several others with Atlantic City Electric...
Logger: homeassistant.components.opower.coordinator Source: components/opower/coordinator.py:67 Integration: Opower (documentation, issues) First occurred: 8:34:45 PM (36 occurrences) Last logged: 9:07:14 PM
Unexpected error fetching Opower data: 'NoneType' object has no attribute 'group' Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 283, in _async_refresh self.data = await self._async_update_data() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/opower/coordinator.py", line 67, in _async_update_data await self.api.async_login() File "/usr/local/lib/python3.11/site-packages/opower/opower.py", line 151, in async_login self.access_token = await self.utility.async_login( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/opower/utilities/exelon.py", line 44, in async_login settings = json.loads(re.search(r"var SETTINGS = ({.*});", result).group(1)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'group'
Someone in https://github.com/tronikos/opower-hacs/issues/11 provided me with the HTML response when this parsing fails that hinted me that the session was already signed in. I fixed it in the underlying library. As a workaround, until the fix is merged and released you could try disabling the integration, restarting home assistant, and re-enabling the integration. I haven't tested this but if you are impatient waiting for the next bugfix release it might be worth trying.
Someone in tronikos/opower-hacs#11 provided me with the HTML response when this parsing fails that hinted me that the session was already signed in. I fixed it in the underlying library. As a workaround, until the fix is merged and released you could try disabling the integration, restarting home assistant, and re-enabling the integration. I haven't tested this but if you are impatient waiting for the next bugfix release it might be worth trying.
This didn't seem to work for me, but I can just wait for the downstream fix, thanks for the hardwork!
Seemed like the error was the same?
(MainThread) [homeassistant.setup] Setup of domain opower took 0.0 seconds 2023-08-04 04:47:04.702 DEBUG (MainThread) [homeassistant.components.opower.coordinator] Finished fetching Opower data in 6.827 seconds (success: False) 2023-08-04 04:47:04.703 WARNING (MainThread) [homeassistant.config_entries] Config entry 'Atlantic City Electric (midnitte@gmail.com)' for opower integration not ready yet: 404, message='Not Found', url=URL('https://ace.opower.com/ei/edge/apis/bill-forecast-cws-v1/cws/ace/customers/6456ce85-0a28-11ec-b7d8-020017009937/combined-forecast'); Retrying in background 2023-08-04 04:47:11.471 ERROR (MainThread) [homeassistant.components.opower.coordinator] Unexpected error fetching Opower data: 'NoneType' object has no attribute 'group' Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 283, in _async_refresh self.data = await self._async_update_data() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/opower/coordinator.py", line 67, in _async_update_data await self.api.async_login() File "/usr/local/lib/python3.11/site-packages/opower/opower.py", line 151, in async_login self.access_token = await self.utility.async_login( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/opower/utilities/exelon.py", line 44, in async_login settings = json.loads(re.search(r"var SETTINGS = ({.*});", result).group(1)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'group' 2023-08-04 04:47:11.479 DEBUG (MainThread) [homeassistant.components.opower.coordinator] Finished fetching Opower data in 1.314 seconds (success: False) 2023-08-04 04:47:26.503 ERROR (MainThread) [homeassistant.components.opower.coordinator] Unexpected error fetching Opower data: 'NoneType' object has no attribute 'group'
Uhm maybe Home Assistant restores the client session at restart? Maybe another workaround is to disable the integration, wait several hours (unknown how long) for the session to expire and then reenable the integration. If you want you could try the custom integration at https://github.com/tronikos/opower-hacs where I released the fix.
I have attempted the above items with the same exact result for Atlantic City Electric.
Logger: homeassistant.components.opower.coordinator Source: components/opower/coordinator.py:67 Integration: Opower (documentation, issues) First occurred: 1:21:48 PM (18 occurrences) Last logged: 1:37:39 PM
Unexpected error fetching Opower data: 'NoneType' object has no attribute 'group' Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 283, in _async_refresh self.data = await self._async_update_data() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/opower/coordinator.py", line 67, in _async_update_data await self.api.async_login() File "/usr/local/lib/python3.11/site-packages/opower/opower.py", line 151, in async_login self.access_token = await self.utility.async_login( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/opower/utilities/exelon.py", line 44, in async_login settings = json.loads(re.search(r"var SETTINGS = ({.*});", result).group(1)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'group'
I too have attempted above with Atlantic City Electric (ironically I work for Atlantic City Electric)
Logger: homeassistant.components.opower.coordinator Source: components/opower/coordinator.py:67 Integration: Opower (documentation, issues) First occurred: 6:23:31 PM (2 occurrences) Last logged: 6:23:38 PM
Unexpected error fetching Opower data: 'NoneType' object has no attribute 'group' Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 283, in _async_refresh self.data = await self._async_update_data() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/opower/coordinator.py", line 67, in _async_update_data await self.api.async_login() File "/usr/local/lib/python3.11/site-packages/opower/opower.py", line 151, in async_login self.access_token = await self.utility.async_login( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/opower/utilities/exelon.py", line 44, in async_login settings = json.loads(re.search(r"var SETTINGS = ({.*});", result).group(1)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'group'
2023.8.1 was just released that includes the fix
I am not so lucky as a few others. The bright side is it's a different error.
Logger: homeassistant.components.opower.coordinator Source: components/opower/coordinator.py:67 Integration: Opower (documentation, issues) First occurred: 6:20:43 PM (1 occurrences) Last logged: 6:20:43 PM
Unexpected error fetching Opower data: 502, message='Bad Gateway', url=URL('https://secure.atlanticcityelectric.com/Pages/Login.aspx?/login') Traceback (most recent call last): File "/usr/local/lib/python3.11/site-packages/opower/opower.py", line 151, in async_login self.access_token = await self.utility.async_login( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/opower/utilities/exelon.py", line 34, in async_login async with session.get( File "/usr/local/lib/python3.11/site-packages/aiohttp/client.py", line 1141, in aenter self._resp = await self._coro ^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/aiohttp/client.py", line 643, in _request resp.raise_for_status() File "/usr/local/lib/python3.11/site-packages/aiohttp/client_reqrep.py", line 1005, in raise_for_status raise ClientResponseError( aiohttp.client_exceptions.ClientResponseError: 502, message='Bad Gateway', url=URL('https://secure.atlanticcityelectric.com/Pages/Login.aspx?/login')
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 283, in _async_refresh self.data = await self._async_update_data() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/opower/coordinator.py", line 67, in _async_update_data await self.api.async_login() File "/usr/local/lib/python3.11/site-packages/opower/opower.py", line 158, in async_login raise CannotConnect(err) opower.exceptions.CannotConnect: 502, message='Bad Gateway', url=URL('https://secure.atlanticcityelectric.com/Pages/Login.aspx?/login')
I still seem to be encourting the same error on 2023.8.1, despite deleting the configuration and setting it up as new:
2023-08-04 19:27:28.654 WARNING (MainThread) [homeassistant.config_entries] Config entry 'Atlantic City Electric (midnitte@gmail.com)' for opower integration not ready yet: 404, message='Not Found', url=URL('https://ace.opower.com/ei/edge/apis/bill-forecast-cws-v1/cws/ace/customers/6456ce85-0a28-11ec-b7d8-020017009937/combined-forecast'); Retrying in background
2023-08-04 19:27:39.304 DEBUG (MainThread) [homeassistant.components.opower.coordinator] Finished fetching Opower data in 5.356 seconds (success: False)
2023-08-04 19:27:55.067 DEBUG (MainThread) [homeassistant.components.opower.coordinator] Finished fetching Opower data in 5.530 seconds (success: False)```
Home Assistant info:
` Home Assistant 2023.8.1 Supervisor 2023.07.1 Operating System 10.4 Frontend 20230802.0 - latest `
Both of the last 2 comments are different issues that should be reported separately. Make sure you can access energy data in your utility website before reporting an issue with the integration. If you can't access energy data in your utility website raise an issue to your utility, not here.
I can access full data on the website without issue.
fyi updated to 2023.8.2 still have the same problem
And so do I. The developer continues to close my posts calling them "duplicates". I would be interested to know the progress since no updates in a week.
Atlantic City seems to report only monthly data which is why you are still having issues. This was fixed in https://github.com/home-assistant/core/issues/97814. The fix will be available in 2023.8.3.
ok thought i saw a fix for 2023.8.2 --thank !!!!
The problem
Getting the error message "Failed setup, will retry". It continues to retry and fail.
What version of Home Assistant Core has the issue?
core-2023.8.0b2
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://rc.home-assistant.io/integrations/peco_opower
Diagnostics information
home-assistant_opower_2023-07-31T00-36-42.172Z.log
Example YAML snippet
No response
Anything in the logs that might be useful for us?
Additional information
No response