Skip to content

ejpenney/ha-portlandgeneral

Repository files navigation

DEPRECATED: Use Home Assistant's built-in OPower Integration, it now supports Portland General Electric, and their implementation is rock-solid.

Version Downloads Code style: black StandWithUkraine Coverage Status

Portland General Electric for Home Assistant

Installation

HACS - (RECOMMENDED)

  1. Have HACS installed, this will allow you to easily update
  2. Add https://github.com/ejpenney/ha-portlandgeneral as a custom repository as Type: Integration
  3. Click install under "HA Portland General Electric"
  4. Restart Home Assistant.

Manual

Copy custom_components/portland_general_electric into your Home Assistant config directory.

Post installation steps

  • Restart HA
  • Browse to your Home Assistant instance
  • In the sidebar click on Settings.
  • From the configuration menu select: Devices & Services.
  • In the bottom right, click on the Add Integration button.
  • From the list, search and select “HA Portland General Electric”.
  • Follow the instruction on screen to complete the set up.

What is this?

Based heavily on the work of portlandgeneral-api this component is meant to add energy usage entities to Home Assistant for Portland General Electric customers who don't have smart meters, or other means of live measurement. The hope is to use these in the Energy Dashboard

Support

Hey dude! Help me out for a couple of 🍻 or a ☕!

coffee

Known limitations

Hourly Sensor

It does not appear PGE updates this data until 24-48 hours after the fact, so it appears useless for "live" monitoring of usage. I've left it turned on while I continue to experiment.

Daily Sensor

PGE's daily sensor suffers from similar issues, the number doesn't finalize until around midnight therefore we cannot get "today's" usage. Instead we're using the utility_cost_daily() call, this data is mostly accurate. It appears to be updated 2-3 times per day. This has the added bonus of reporting "Provided Cost".

Cost Sensor

Assumes PGE tiers up to 1,000 KWH at one price and the second price for beyond. This is typically true. Contains an attribute with a calculated total consumption this billing period. Not 100% accurate but should be close.

WIP Disclaimer

This integration is still WIP, I'm running it locally on a test instance of HASS, it is NOT working at the moment, as in it doesn't do anything particularly useful. I'm still working out the best way to leverage the intermittently updated data, while simultaneously learning about writing custom components.

Development

Developed using VSCode, testing in Docker. UnitTests have not yet been written. I would like to get the development environment including docker configuration added to this repository when I've had a chance to clean it up.