GreenButton Smartmeter integration

I have an Sensus (FlexNet) Icon smart-meter for my electricity. I currently use an IR sensor to watch the consumption (something like, but built with MySensors), but I wanted to correlate that against my power bill.
I was unable to find the frequency info for the FlexNet meters used in my area, and I believe the FlexNet data is encrypted (I haven’t seen anyone able to read from the RF on these meters). However, my utility company does provide the data in a downloadable form using the GreenButton initiative. I haven’t found any data on how to apply for third-party integration, but GreenButton does provide a customer-download option to manually retrieve data. Unfortunately, this button is hidden deep within my utility’s Ajax driven web-site. So I wrote a PhantomJS driven python module to login, and grab the relevant XML file. After all that work, I found out that data is only available once a day, and ia given day’s data sn’t available until 9PM the following day. So I am not sure there is any value in actually integrating such old data with HomeAssistant after all. Instead I’m currently just directly inserting it into my influxdb so I can graph it with Grafana.

The module is currently limited to my provider (Portland General Electric) but if there is interest, it should be pretty easy to extend to any other provider with GreenButton data access.

Is there any use for providing historical data (rather than live data) to HomeAssistant?

I had a lot of difficulty searching the web for a GreenButton interface, so I thought I’d post my progress here in case anyone finds it useful.

My python module lives here:


I started looking into this for Oncor (Texas). Course, I can’t get into the Oncor site right now, but they supposedly support Green Button - but I don’t yet know if they have the same limitation as your provider with regard to delayed reporting.

Is there any use for providing historical data (rather than live data) to HomeAssistant?

I think so. It’s useful for monitoring metered or thresholded service - perhaps there is discretionary usage that you could postpone or eliminate if you’re about to cross into a higher cost structure (that actually happened to me a few months ago and I didn’t realize it).

I assume the unsupported “third party” download you mention is the CMD (Connect My Data). It’s too bad they didn’t support it - I’d blindly hope it would provide more real-time info.

In looking into this, I also found a few others:

Hi, is this still something you’re working on? I am interested…

For real this would be great to have with the new energy dashboard in home assistant.

yes it would.
The original poster hasn’t made changes to his code in 4 years, so I’m guessing this went inactive.

I did request help getting my provider added and he responded. I’m not sure I can do any of the things he mentioned though since I’m using hassOS and I have no idea what to change where.

Maybe if someone could make it so that you just need to enter your cookie and URL to get the information into home assistant but again way way above my knowledge level.

With a platform to run his code, an influx db to store it, then home assistant could use the db as a sensor

Ping me if you get it going. Good luck I’m definitely looking forward to it.

I too am interested in this. Please keep us in the loop if there is active development. Thank-you

The plugin I wrote uses selenium to do screen-scraping to grab the greenbutton data. This has proven to be very brittle as my provider has changed the interface multiple times. Managing the resulting data isn’t necessarily difficult (though I personally just insert it directly into influxdb so I can view it in Grafana). But managing the scraper is a real issue that I don’t have a good solution to.

I would love to see COMED green button integrated. they actually have info on line for the api. I am in Illinois. With their data and my solar panels I could really see my energy usage in HA. I am not a programer so scant help with code but am willing to test.

This thread was dated 2017 so i tried to give it a bump by putting the Green Button up for a vote in feature requests.
If you’d like to see this in HA, please give it an up vote here:


1 Like

Looks like the existing ConEd integration is based on the same web site that is used by PECO in Pennsylvania and Portland General Electric in Oregon. So there is hope to get something generic going with Green button integration.

EDIT: I said existing, looks like the pull request was never completed. Add ConEdison smart energy meter sensor integration by bvlaicu · Pull Request #28668 · home-assistant/core · GitHub

The coned module that uses uses pyppeteer which I think is just a wrapper around selenium, and will likely be brittle (like my original code before I moved to OAuth2).
The problem though isn’t the part but the login itself which is generally done through your provider not through opower. I don’t have enough info yet as to whether that will be reusable between providers.

I finally got back to looking at this and sadly PECO seems to have switched to SAML authentication, as I know I originally saw the identitytoolkit the first time I looked :frowning: I will have to chat with a co-worker more familiar with SAML to see how to extract what I need to make the calls myself to get the signed token.