Duke Energy Python Script to MQTT?

Hi everyone,

Complete newb when it comes to Python and MQTT, but I’m learning and looking for advice.

I’m using this:

d4yz/pydukeenergy: Access to the undocumented Duke Energy usage API (github.com)

to pull in my Duke Energy Daily Usage, but now am looking for how to get this into Home Assistant. This looks pretty basic, and is just printing a command. I’ll figure out how to have it run continuously, or for hourly usage at some point (not my script).

What I’m looking to do is to then send it to MQTT so I can pull the data into Home Assistant.

Unfortunately, my google searching has failed me, and I’m not finding out how to achieve this.

Anyone willing to assist me in this effort (or know of a better way to get Duke Energy data without the gateway into Home Assistant).

I tried an RTL dongle, but my meter is not compatible either.

Just to add my 2 cents, I looked at this a few months ago, and the drawback is that the usage data is for the prior day. I couldn’t find a way to add back history data into HA.

Yeah I just came across that. I was hopeful I could get yesterday’s data at least into the Energy Dashboard to look at.

Have you continued with this project? I’m in Florida and it doesn’t seem like we have the ability to get one of the gateways or connect to the meter in anyway. This seems like a great approach to at least grab past data and feed it into home assistant.