Skip to content

Add Opower integration for getting electricity/gas usage and cost for many utilities#90489

Merged
balloob merged 31 commits into
home-assistant:devfrom
tronikos:opower
Jul 3, 2023
Merged

Add Opower integration for getting electricity/gas usage and cost for many utilities#90489
balloob merged 31 commits into
home-assistant:devfrom
tronikos:opower

Conversation

@tronikos
Copy link
Copy Markdown
Member

@tronikos tronikos commented Mar 30, 2023

Proposed change

Add Opower integration. More than 175 utilities use Opower. Currently the following utilities are supported:

  • Pacific Gas & Electric (PG&E), California's largest utility, also largest (by revenue) utility in US
  • Puget Sound Energy (PSE), Washington's largest utility
  • Exelon subsidiaries
    • Atlantic City Electric, New Jersey
    • Baltimore Gas and Electric (BGE), Maryland’s largest utility
    • Commonwealth Edison (ComEd), Illinois' largest utility
    • Delmarva Power, Delaware
    • PECO Energy Company (PECO), Pennsylvania's largest utility
    • Potomac Electric Power Company (Pepco), Washington, D.C. and Maryland

According to wikipedia all the above utilities serve over 15 million households.

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)
  • 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

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • I have followed the perfect PR recommendations
  • The code has been formatted using Black (black --fast homeassistant tests)
  • 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:

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

To help with the load of incoming pull requests:

@tronikos tronikos changed the title Create Opower integration, currently supports PG&E Create Opower integration, currently only PG&E is supported Mar 30, 2023
Copy link
Copy Markdown
Contributor

@Lash-L Lash-L left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few things I noticed, hope this helps!

Comment thread homeassistant/components/opower/config_flow.py Outdated
Comment thread homeassistant/components/opower/config_flow.py Outdated
Comment thread homeassistant/components/opower/coordinator.py
Comment thread homeassistant/components/opower/coordinator.py
Comment thread homeassistant/components/opower/coordinator.py Outdated
Comment thread homeassistant/components/opower/sensor.py
@Lash-L
Copy link
Copy Markdown
Contributor

Lash-L commented Mar 30, 2023

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

@tronikos
Copy link
Copy Markdown
Member Author

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

Updated.

@borski
Copy link
Copy Markdown

borski commented May 1, 2023

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

@Lash-L
Copy link
Copy Markdown
Contributor

Lash-L commented May 11, 2023

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

@tronikos tronikos changed the title Create Opower integration, currently only PG&E is supported Create Opower integration, currently PG&E and PSE are supported May 18, 2023
@tronikos tronikos changed the title Create Opower integration, currently PG&E and PSE are supported Add Opower integration, currently PG&E and PSE are supported Jun 12, 2023
@tronikos tronikos changed the title Add Opower integration, currently PG&E and PSE are supported Add Opower integration, currently PG&E, PSE, and BGE are supported Jun 12, 2023
@tronikos tronikos changed the title Add Opower integration, currently PG&E, PSE, and BGE are supported Add Opower integration for getting electricity/gas usage and cost for many utilities Jun 15, 2023
@tronikos
Copy link
Copy Markdown
Member Author

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

@domoritz
Copy link
Copy Markdown

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.

@tronikos
Copy link
Copy Markdown
Member Author

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.

@robbiet480
Copy link
Copy Markdown
Contributor

👀

Comment thread homeassistant/components/opower/strings.json Outdated
@balloob balloob merged commit caaeb28 into home-assistant:dev Jul 3, 2023
Copy link
Copy Markdown
Member

@MartinHjelmare MartinHjelmare left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please address the comments in a new PR. Thanks!

Comment thread homeassistant/components/opower/sensor.py
Comment thread homeassistant/components/opower/sensor.py
Comment thread homeassistant/components/opower/sensor.py
Comment thread homeassistant/components/opower/sensor.py
Comment thread tests/components/opower/conftest.py
Comment thread homeassistant/components/opower/strings.json
@tronikos tronikos mentioned this pull request Jul 3, 2023
20 tasks
@tronikos
Copy link
Copy Markdown
Member Author

tronikos commented Jul 3, 2023

Thanks. Addressing your comments in #95763

@github-actions github-actions Bot locked and limited conversation to collaborators Jul 4, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants