Green Button Connect in Ontario Canada

Hi! I wanted to ask the community if someone could pick up where the last dev left off. There was a Green Button Connect integration GitHub - vqvu/home-assistant-green-button: Custom Home Assistant integration for automatically importing Green Button XML files., but it had been archived last Februrary. This would be a really cool feature to have seeing that you could get so much data from it. If someone can do this I’ll buy you some drinks.

Thanks,

I’ve had some success in getting my electricity data consumption into the energy dashboard after forking and doing a bunch of re-work on the original repo. It’s still early days and a bit rough but it’s working. My green button provider lets me download the atom feed version of the ESPI xml, not a full xsd-compliant xml file - I have no idea if that’s what other providers supply so this may be a bespoke solution unless the atom feed format for green button data is used more commonly. Anyway, if you want to play with it, warts and all, it can be found at the rhounsell fork of the vqvu project (dev branch at the moment). You’ll have to copy/paste the actual xml into the XML field during the integration setup and then use the Import ESPI XML service/activity under developer tools to add subsequent XML. I’ve been focused on getting the data to display, but if things solidify this could probably be improved.

1 Like

I think I’m very close to a solution, at least for the happy path. I haven’t tested all the edge cases yet.

1 Like

Thanks for your work on this. I tried importing via file and xml path with no luck today. I have Enbridge and Hydro One. Both provide 2 files - account info and usage. The account info files seem to be accepted by the integration, but no entities or info appear when loaded in. Both usage files result in Invalid ESPI XML error. I am not savvy enough to know what the issue but figured I’d share for those searching and in case I could be of any value in testing.

@Hamsterbrain Thanks for reviving this.

Your github repo doesn’t have issues enabled so hopefully you can help here. I’m hoping to get Toronto Hydro supported.

Toronto Hydro uses W as a unit of measurement with code 38 (UtilityAPI - Docs - Green Button XML Format).

38 - W

I note this section of code:

_UOM_MAP: Final = {
# Use strings to keep model generic across energy and gas
“72”: “Wh”, # Watt-hours (electricity)
“42”: “m³”, # Cubic meters (gas)
“80”: “currency”,
}

I’m encountering the following error:

Failed to check flowDirection for /UsagePoint/1/MeterReading/1: Invalid value '38' at path 
'./atom:content/espi:ReadingType/espi:uom' of entry: 
<ns0:entry xmlns:ns0="http://www.w3.org/2005/Atom" xmlns:ns1="http://naesb.org/espi"> <ns0:id>urn:uuid:8ef6f3bd-fe2f-4329-84e6-94241c5ace1d</ns0:id> 
<ns0:link href="/ReadingType/1" rel="self" /> 
<ns0:link href="/ReadingType" rel="up" /> 
<ns0:title>Energy Delivered (W_ELE_DEL)</ns0:title> <ns0:content type="xml"> <ns1:ReadingType> <ns1:accumulationBehaviour>0</ns1:accumulationBehaviour> <ns1:commodity>1</ns1:commodity> <ns1:dataQualifier>0</ns1:dataQualifier> <ns1:flowDirection>0</ns1:flowDirection> <ns1:kind>8</ns1:kind> <ns1:phase>0</ns1:phase> <ns1:powerOfTenMultiplier>0</ns1:powerOfTenMultiplier> <ns1:timeAttribute>0</ns1:timeAttribute> <ns1:uom>38</ns1:uom> </ns1:ReadingType> </ns0:content> <ns0:updated>2025-11-07T12:34:00-05:00</ns0:updated> </ns0:entry> , including by default

The green button parser doesn’t use anything from the Account Info data. When I download from from Hydro Ottawa I select “Electricity Usage Data”. Is there anything in the system logs for “green button”?

From what I can see the code should just skip to parsing the next ReadingType block. Do you see any other green_button logs in the System HA Core log buffer?

Do you have any uom values in your green button xml of “72”? It may be that Toronto Hydro provides both. A Watt (W) is a measure of power, not energy, so I don’t know how that would be mapped in to anything in the energy dashboard unless we have a time period that could also be used, or maybe the integral integration, or something.

If you don’t have any uom values of 72, maybe the duration value in the IntervalBlock can be used to calculate the energy for that time period. I’ve tried to implement that as an experiment in the new “watts” branch of my repo - give it a try and see if it works for you, and if the resulting values make sense.

When I started poking around with this, my concern was that formats might be different between various providers so I don’t know how universal my parser is.

Got your add-on working well for Hydro Ottawa through Savage on manual dowloads although just usage, not TOU usage.
Out of curiosity, how are you downloading the data currently ? Just manually? or using @evan.cooper’s script?

1 Like

At the moment, I manually download the xml. At some point I hope to automate the entire process.

I download the usage and billing data for Hydro Ottawa. It will give me hourly usage. Also just got the Enbridge Gas parsing working, although its resolution is monthly, not hourly.

Same here for electricity.

For the gas, I just created a helper and I go have a look at the meter when I feel like it. That’s my source for now until they do remote metering or until I attach a device to read the pulses…

Hi everyone, I wanted to share my solution that pulls data from HydroOttawa automatically: Ontario Canada will be able to pull their data from Green Button - #59 by eljojo