8000 Request: Support opower guest accounts for coautilities · Issue #81 · tronikos/opower · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Request: Support opower guest accounts for coautilities #81

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

Open
trv opened this issue Jun 1, 2024 · 5 comments
Open

Request: Support opower guest accounts for coautilities #81

trv opened this issue Jun 1, 2024 · 5 comments
Labels
enhancement New feature or request

Comments

@trv
Copy link
trv commented Jun 1, 2024

For coautilities (not sure about others), you can create a guest account at https://dss-coa.opower.com/dss/account/manage-web-account under "Connected accounts > + Add guest user". This allows you to set the access level to effectively read-only ("Usage & Financial Info"). It'd be nice if we could take advantage of this access control to apply the principle of least privilege.

The main login credentials work fine with demo.py (release version 0.4.6).

I can use this guest login via the browser to access usage data, but demo.py fails with:

DEBUG:/config/custom_components/opower-0.4.6/src/opower/opower.py:Fetching: https://dss-coa.opower.com/webcenter/edge/apis/dss-invite-v1/cws/v1/utilities/connectedaccounts?pageOffset=0&pageLimit=100
Level 9:/config/custom_components/opower-0.4.6/src/opower/opower.py:Fetched: {
  "accounts": [],
  "totalRecords": 0
}
Traceback (most recent call last):
  File "/config/custom_components/opower-0.4.6/src/demo.py", line 172, in <module>
    asyncio.run(_main())
  File "/usr/local/lib/python3.12/asyncio/runners.py", line 194, in run
    return runner.run(main)
           ^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/asyncio/runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 685, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/config/custom_components/opower-0.4.6/src/demo.py", line 91, in _main
    for forecast in await opower.async_get_forecast():
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/opower-0.4.6/src/opower/opower.py", line 247, in async_get_forecast
    for customer in await self._async_get_customers():
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/opower-0.4.6/src/opower/opower.py", line 327, in _async_get_customers
    await self._async_get_user_accounts()
  File "/config/custom_components/opower-0.4.6/src/opower/opower.py", line 374, in _async_get_user_accounts
    assert self.user_accounts
AssertionError

Tracing the network calls when using the guest account from a browser session, I see

Presumably guest logins require a less-direct method to dig up the missing accounts info?

@tronikos tronikos changed the title Request: Support opower guest accounts Request: Support opower guest accounts for coautilities Jun 1, 2024
@tronikos tronikos added the enhancement New feature or request label Jun 1, 2024
@max2697
Copy link
Contributor
max2697 commented Aug 5, 2024

Hello @trv. It’s a good idea. I’ll take a look at how it could be used and what changes are required.

@max2697
Copy link
Contributor
max2697 commented Aug 5, 2024

Hm, I tried to create a guest account, and now it wants my SSN or driver’s license number for account verification. @trv, have you also completed this step? It seems a bit excessive for a guest account just to gain access

@trv
Copy link
Author
trv commented Sep 5, 2024

I had an existing coautilities account that I added as a guest, so I didn't go through the new account flow recently.

@max2697
Copy link
Contributor
max2697 commented Sep 14, 2024

Unfortunately, I can't recreate this case. I can only suggest using the main account to retrieve the information for now

@jmillsy
Copy link
jmillsy commented Nov 22, 2024

If it helps, I tried connecting using a connected account and I get back a 500:

aiohttp.client_exceptions.ClientResponseError: 500, message='Internal Server Error', url='https://dss-coa.opower.com/webcenter/edge/apis/dss-invite-v1/cws/v1/utilities/connectedaccounts?pageOffset=0&pageLimit=100'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants
0