core icon indicating copy to clipboard operation
core copied to clipboard

Create Opower integration, currently only PG&E is supported

Open tronikos opened this issue 1 year ago • 3 comments

Proposed change

Create Opower integration. More than 175 utilities use Opower. Currently only Pacific Gas and Electric Company (PG&E) is supported (because that's my utility :) ) which is the largest (by revenue) utility in US. Anyone can update the underlying library to support logging in to their utility website and this integration should automatically pick up their utility after bumping the version.

Type of change

  • [ ] Dependency upgrade
  • [ ] Bugfix (non-breaking change which fixes an issue)
  • [x] New integration (thank you!)
  • [ ] New feature (which adds functionality to an existing integration)
  • [ ] Deprecation (breaking change to happen in the future)
  • [ ] Breaking change (fix/feature causing existing functionality to break)
  • [ ] Code quality improvements to existing code or addition of tests

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue:
  • Link to documentation pull request: https://github.com/home-assistant/home-assistant.io/pull/26793

Checklist

  • [x] The code change is tested and works locally.
  • [x] Local tests pass. Your PR cannot be merged unless tests pass
  • [x] There is no commented out code in this PR.
  • [x] I have followed the development checklist
  • [x] I have followed the perfect PR recommendations
  • [x] The code has been formatted using Black (black --fast homeassistant tests)
  • [x] Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • [x] The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • [x] New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • [x] For the updated dependencies - a link to the changelog, or at minimum a diff between library versions is added to the PR description.
  • [x] Untested files have been added to .coveragerc.

To help with the load of incoming pull requests:

tronikos avatar Mar 30 '23 04:03 tronikos

I would also add into the description why only PG&E is supported and how future utilities could be added

Lash-L avatar Mar 30 '23 17:03 Lash-L

I would also add into the description why only PG&E is supported and how future utilities could be added

Updated.

tronikos avatar Mar 31 '23 01:03 tronikos

Just following up, @Lash-L any chance we can get this reviewed? :)

borski avatar May 01 '23 08:05 borski

@borski I'm not a core maintainer. My review doesn't matter for anything other than just trying to help out

Lash-L avatar May 11 '23 20:05 Lash-L

FYI, for anyone that will review this since https://developers.home-assistant.io/docs/review-process?_highlight=review#who-is-responsible-for-reviewing-prs recommends dropping a comment "I tested this using ... and it works", many users have started successfully using this via https://github.com/tronikos/opower-hacs See also https://community.home-assistant.io/t/pg-e-energy-monitoring-integration/336038

tronikos avatar May 18 '23 21:05 tronikos

FYI, the underlying library now supports 8 utilities in US. The supported utilities serve over 15 million US households.

tronikos avatar Jun 15 '23 07:06 tronikos

That's awesome. If I can express a wish to add support https://www.duquesnelight.com which also supports Opower. The API is at https://duq.opower.com.

domoritz avatar Jun 15 '23 21:06 domoritz

Without access to an account I cannot support logging in to other utilities. You are on your own on that. Feel free to send me a PR to the underlying library https://github.com/tronikos/opower if you figure out how to programmatically login to your utility website and get the access token for opower. The current implementation for other utilities should help.

tronikos avatar Jun 15 '23 22:06 tronikos

👀

robbiet480 avatar Jun 29 '23 09:06 robbiet480

Thanks. Addressing your comments in https://github.com/home-assistant/core/pull/95763

tronikos avatar Jul 03 '23 11:07 tronikos