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
61 stars 55 forks source link

New provider: City of Austin Utilities #63

Closed max2697 closed 8 months ago

max2697 commented 9 months ago

Hello!

Currently working on adding a new provider, City of Austin Utilities (https://github.com/max2697/opower/pull/1). It's also working on opower but I found some differences from this repos code.

First of all it's failing when it try to call _async_get_customers. This endpoint just redirecting to some html page via 302 code. I made some research and found different endpoint with the same data: https://dss-coa.opower.com/webcenter/edge/apis/multi-account-v1/cws/coa/customers

Some differences:

Found all 4 endpoints in my version of portal:

       /ei/edge/apis/DataBrowser-v1/cws/cost/utilityAccount/...
/webcenter/edge/apis/DataBrowser-v1/cws/cost/utilityAccount/...

       /ei/edge/apis/DataBrowser-v1/cws/utilities/{subdomain}/utilityAccounts/.../reads
/webcenter/edge/apis/DataBrowser-v1/cws/utilities/{utilityCode}/utilityAccounts/.../reads

       /ei/edge/apis/bill-forecast-cws-v1/cws/{subdomain}/customers/.../combined-forecast
/webcenter/edge/apis/bill-forecast-cws-v1/cws/{utilityCode}/customers/.../combined-forecast

       /ei/edge/apis/multi-account-v1/cws/{subdomain}/customers
/webcenter/edge/apis/multi-account-v1/cws/{utilityCode}/customers

So basically City of Austin Utilities is using different version of a Digital Self Servicedescribe on this page: https://docs.oracle.com/en/industries/energy-water/digital-self-service/transactions-seamless/Content/Transactions/SeamlessIntegration/Introduction_Seamless.htm

Have anybody heard about this different version of Opower web interface? What's the address of home page for Opower for other providers? Mine is https://dss-coa.opower.com/dss/overview

max2697 commented 9 months ago

Well, I found an endpoint to get data about user accounts (not utilities accounts) and changed the code to allow it work with DSS: https://github.com/max2697/opower/pull/1/commits/df4aa016e8d8e75cfc42aa596b837f551d363222 It's working now so I'll think about better way to integrate both portal version into one solution and will send a PR for this.