Duke Energy shut down the Gateway pilot program at the end of June 2023. This integration has stopped functioning and is deprecated.
This is a custom integration for Home Assistant. It pulls real-time energy usage from Duke Energy via the Duke Energy Gateway pilot program.
This integration leverages the pyduke-energy
library, also written by me, to pull data. This API is very unofficial and may stop working at any time (see Disclaimer).
You are required to have a Duke Energy Gateway connected to your smartmeter for this to work. This is a separate device than your Smart Meter and is provided by an invitation only program at the moment. If you don't know what this is, then you probably don't have it. This integration does not support any other method of retrieving data (see Gateway Requirement).
This component will set up the following entities:
sensor.duke_energy_current_usage_w
sensor.duke_energy_usage_today_kwh
sensor, or you need to feed this real-time sensor through the Riemann sum integral integration.sensor.duke_energy_usage_today_kwh
pyduke-energy
repo.).mjmeli/ha-duke-energy-gateway
and choose Integration
as the Category.configuration.yaml
).custom_components
directory (folder) there, you need to create it.custom_components
directory (folder) create a new folder called duke_energy_gateway
.custom_components/duke_energy_gateway/
directory (folder) in this repository.Configuration will be done in the UI. Initially, you will need to provide the following data:
Data | Description |
---|---|
email |
Your login email to Duke Energy. |
password |
Your login password to Duke Energy. |
After the integration is setup, you will be able to do further configuration by clicking "Configure" on the integration page. This will allow you to modify the following options:
Data | Description |
---|---|
Real-time Usage Update Interval (sec) |
By default, the real-time usage sensor will be updated any time a reading comes in. If this data is too frequent, you can configure this value to throttle the data. When set to a positive integer X , the sensor will only be updated once every X seconds. In other words, if set to 30, you will get a new real-time usage every ~30 seconds. |
The configuration flow will automatically attempt to identify your gateway and smartmeter. Right now, only one is supported per account. The first one identified will be used. If one cannot be found, the configuration process should fail.
If your meter selection fails, a first step should be to enable logging for the component (see Logging). If this does not give insight into the problem, please open a GitHub issue.
If you run into any issues and want to look into the logs, this integration provides verbose logging at the debug level. That can be enabled by adding the following to your configuration.yaml
file.
logger:
default: info
logs:
custom_components.duke_energy_gateway: debug
pyduke_energy.client: debug
pyduke_energy.realtime: debug
I suggest using the dev container for development by opening in Visual Studio Code with code .
and clicking on the option to re-open with dev container. In VS Code, you can run the task "Run Home Assistant on the port 9123" and then access it via http://localhost:9123.
If you want to install manually, you can install dev dependencies with pip install -r requirements_dev.txt
.
Before commiting, run pre-commit run --all-files
.
pyduke-energy
VersionsIf you are working on implementing new changes from pyduke-energy
but do not want to release version of that library, you can set up your development environment to install from a remote working branch.
requirements_dev.txt
to replace the main
in git+https://github.com/mjmeli/pyduke-energy@main
with your working branch and update the username if you have a fork (e.g. git+https://github.com/notmjmeli/pyduke-energy@new-feature-dev-branch
)pyduke-energy
: pip uninstall -y pyduke-energy
pip install -r requirements_dev.txt
If you want to contribute to this please read the Contribution guidelines
This project was generated from @oncleben31's Home Assistant Custom Component Cookiecutter template.
Code template was mainly taken from @Ludeeus's integration_blueprint template