I rewrote the greenbutton fetch code to use Oauth/bearer-tokens here: GitHub - PhracturedBlue/smartmeter_greenbutton: Python code to read smart-meter data from utility company. It requires a one-time manual configuration to retrieve the account-id and refresh-token, but is then much simpler and more reliable once those have been obtained.
I looked into using rtl-amr, but my meter uses the FlexNet protocol which (a) apparently transmits infrequently making it hard to decode, (b) is encrypted, and (c) likely only has 1kW/hr resolution regardless. Iāve been using a homemade sensor to read instantateous usage using the IR LED (something like this: GitHub - foxharp/irmetermon: AVR-based monitoring of home electricity consumption). It works pretty well, but it was very finicky to get it to work in all lighting conditions.
Looks like PECO in Pennsylvania uses the same green button approach. It uses the <domain>.opower.com and Google identity API. I will do some digging to see how similar the access is. Is there a way to run your Python code in isolation outside of Home Assistant for testing?
The code in my repo actually has nothing to do with homeassistant. I use it to download the greenbutton data and import it directly into influx, but the downloader runs independently of the importer, so you can just run the download part and itāll dump out the raw data.
This has been an as time permits project. I have the data downloading from PECO, I am at the stage of playing around with long-term statistics to get the information presented correctly in the energy dashboard for both electricity and gas.
PECO seems to have shuffled some things around on the back end and are using Azure for OAuth now, which I couldnāt figure outā¦ but I did manage to cobble together a python script which uses selenium to grab a .zip with the last 30 daysā energy usage in csv.
Donāt have much of an idea what Iām doing with python OR selenium, so this is probably pretty messy but itās working over here. Now, to try and do some things with the actual data it spits outā¦
I agree that trying to find a use for the data is the hard part. My power company nominally supports Green Button, but I have to log on and navigate to the data, and then itās at least 24 hours old. I do that every so often. Iāve got lots of data, going back years. I never even look at it.
Obviously the better solution would be to receive real-time data directly from the smart meter. I donāt think thereās enough demand for my power company to invest in supporting that. They already have the conspiracy theorists making noise about the smart meters. They donāt need the security vulnerabilities that allowing customers to access them would bring. One of these days Iāll set up some CT clamps and monitor it myself.
Iām mainly posting here so that anyone with coding experience who uses https://www.butlerrural.coop can google and find this important thread. For those of us in Ohio (USA) in Rural areas (most of the state) we are part of a Touchstone energy cooperative. Smarthub is the name of the account management tool and Android application that allows browsing of energy consumption history. Downloading of it can be done with the download Green Button data option in that tool.
I do have some python coding experience and will look into the git repos of anyone that posts links here to see if I can help. I can certainly help with testing pieces of it. Perhaps helping with the documentation is a way I can also help. I can see there being several key tasks here that could be broken out for volunteers.
So, I live in Virginia and have DOMINION energy as well. We recently had a smart meter installed. After the system was fully switched over, I now have a detailed usage menu option in my account online. There I am provided with the ability to download my detailed usage up too the previous half hour mark. I can pull 30 minute usage history in txt, csv, xls, and xml formats. Iām pretty sure that the link to download this data included a unique key to be able to bookmark the link and pull it up later and it show the current data. I do know that the usage history works with other third party āgreen buttonā web applications. Would there be a way to pull this into home assistant to review historical energy usage data?
Iām in VA as well on the Dominion grid. It would be great if we could somehow pull the information from the dom website to collect consumption information.
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: