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 http://www.roosterteeth.com/episode/rwby-volume-5-5-qoiljjj32e, 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:

5 Likes

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:
https://github.com/search?l=Python&q=greenbutton&type=Repositories

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

1 Like

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

1 Like

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

1 Like

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:

thanks!

2 Likes

Looks like the existing ConEd integration is based on the same opower.com 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 opower.com 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.

4 Likes

I also have Portland General as my provider and just started looking into this.
I found that using using an rtl-sdr dongle and GitHub - mdegat01/addon-amr2mqtt: HA Addon which runs rtlamr to read IDM power meter data and send to MQTT broker I was able to quickly access my gas meter (from NW Natural) but that as best I can tell from poking around what PGE uses in their smart meters is encrypted, so obviously won’t work.

I was curious about some accessing the Green Button data, but your description of how infrequent the updates are to the data is not encouraging - have you ever found someone at PGE who might be able/willing to help you? Even though it’s less than ideal to have the out of date info, it’d still be nice to have it.

I’ve also looked a bit at HAN devices like the Eagle 200 and Eagle 3 from Rainforest automation, but I don’t love the idea of shelling out $100 for something that may or may not work.

No. I did try to get info about the protocol for a monitored smart-hot-water-heater protocol, but never got anywhere on that.

I built an IR detector for my electric meter (something like Monitor Your Home’s Power Usage On The Cheap | Hackaday), and when it works it is very accurate and instantaneous…however, it is very sensitive to ambient light, and it is difficult to get it to work all the time without obstructing the transmit signal (such the PGE gets mad about not receiving updates). Maybe it would work better with a more advanced detector than the one I built.

I’m interested in a way to track my natural gas usage in HA and found this thread. I stumbled into this site which seems to have the GreenButton stuff figured out, though there are limits and a fee.

https://utilityapi.com/

Has anyone tried this out? It suggests that if you are in the Silicon Valley Power area the use of the site is free, else it suggests $2/mo for each meter being read (look at the 'Pay as you go Pricing block. hmm further looking suggests that is only once a month reading!).

Thoughts or comments?

Since opower was mentioned earlier in this thread and more than 175 utilities use them, if the energy dashboard of your utility is hosted on opower.com, e.g. pge.opower.com, then take a look into adding support in my library: GitHub - tronikos/opower: A Python library for getting historical and forecasted usage/cost from utilities that use opower.com such as PG&E

Integration is being added in: Create Opower integration, currently only PG&E is supported by tronikos · Pull Request #90489 · home-assistant/core · GitHub

Documentation in: Create documentation for Opower integration by tronikos · Pull Request #26793 · home-assistant/home-assistant.io · GitHub

1 Like