GivEnergy API into Home Assistant

15 comments started 2021-11-17 last 2021-12-04
APIsHome AutomationHome Assistant
S
#1 Simon

Hello all!

I currently use Home Assistant however I have never played around with API's before with the exception of pre-built tools. Im looking to integrate the GivEnergy API into Home Assistant but due to the previous sentence, I have no idea how to get started with this!

Has anyone in the forum successfully got this to work or something similar? If so what kind of 'integration' did you use in Home Assistant or what have you managed to configure on the configuration.yaml?

Thanks in advance.

Simon.

C
#2 chrisw

Simon
I would be very interested in anything along these lines!!

M
#3 MrChaz

It depends a bit on what you're wanting to do but from a brief look you'd need to write something that can translate messages between the systems.
Simplest would probably be to use a Raspberry PI or something to get data out of one system and then call the other.
So if you wanted Home Assistant to, say, receive the current solar output you'd get the pi to

call the GivEnergy API ( plant/getPlantSummary maybe)
convert that into a format that Home Assistant likes
send it to Home Assistant (using the events api maybe)
do something in Home Assistant make it visible

S
#4 Simon

Ive been working on this with the help of Simon@Givenergy. Managed to crack it with the Home Assistant add on for NodeRed. That then actions the RestAPI and pulls the data into a new entity in HS. So far i've managed to get consumption, battery charge/load, grid load etc onto a dashboard. Still work in progress for myself

There should be something on GitHub in the near future which is pretty simple to configure with your own API keys and such.

A
#5 anglefire

After a call with Simon the other week, I've joined the community but have been lurking!
But now I've been playing with Home Assistant for a couple of days thought I'd join in!
I've not got my solar and batteries installed yet - should be all done by the end of the week! So I'm very new to all this stuff!

I've managed to get my consumption into HA running on a RPI4 in Docker via IOTstack from Octopus and hopefully have learnt enough to make the integration easy!

Not got the data onto a dashboard yet - not sure why its not coming into the energy dashboard as I can see the 1/2 hour data in the developer section - I just get a straight line on the sensor and the dashboard is waiting for data...

But can't spend all day on it as I have some stuff to do!

But I'm sure I will be back looking for some help!

Mark

T
#6 Tim

Hope this doesn't sound like a sales pitch - I have no connection to the company. I don't use HA but do want to access smart meter real-time data so I can get the granularity I want. While searching for a way to connect a device to my Smart Meter (has to be over Zigbee apparently) that I can then connect to the rest of my home monitoring, I came across reference to [(https://shop.glowmarkt.com/products/glow-stick)]. They are sold out of everything so you can't buy their products currently, whether you have a SMETS1 or 2 meter. However, they do have access to the same Data Communications Company 30 minute summary data that your electricity supplier uses to bill you. If you download the Bright App and enter your MPAN or the MAC address of your smart meter (shows up on In-Home Display), provided you have a SMETS2 meter or your SMETS1 meter has been enrolled (as mine has), you can see the 30 minute data for the last 13 months. The company also enables MQTT access to your dataset if you have one of their products. I don't (they're sold out) but have asked if they will open this up for me, I'll wait and see. If this route is viable, it means that it doesn't matter who your supplier is, you can access the data anyway. It doesn't give me the granularity I am looking for but if 30 minute summary data is good enough for you, then you can try this route.
If anyone has a means of harvesting real-time data from a SMETS1 or 2 meter without going through cloud-based services, I'd be very glad to hear.

https://shop.glowmarkt.com/products/glow-stick

#7 hoggy

Tim
n3rgy offers a similar free service with api access if that helps.

S
#8 Seye

I had a Hildebrand IHD to do just this. Thats the GlowMarkt one. I used MQTT to get my data from the smart meter. Unfortunatly when my smart meter was changed it became a brick. I also found the new smart meter didnt record exporting power in the data feed as I am not on an export tariff. My original L&G one did, so I lost the ability to read data quickly and the ability to even see exported values on the IHD. After a year of talking with energy companies and device suppliers I gave up.

If you have an ancillary meter that has modbus then its very easy to extract the data locally. I bought a very cheep (<£5) usb modbus adapter for a Pi and plugged it into the EM115 for my battery system. A simple NodeRed flow and real time energy monitoring was sorted. Data every 2s. Even buying the Pi, far cheeper than the off the sheld solutions, but I had one anyway so

If any device on you network can read that data, it can be published locally with little effort.

A
#9 anglefire

I have found this integration for Octopus https://github.com/BottlecapDave/HomeAssistant-OctopusEnergy - which does work in so far in that it does get the data from the API - but doesn't seem to be getting the 1/2 hour data - which is not ideal. Not sure what will happen when it pulls some more tomorrow for today.
I have devices on my network that can read modbus - and have a meter already installed which I read, but Givenergy won't issue the modbus tables and prefer the API route - which is fine and something that I have no real issue with (Except having to learn API calls etc! 🤣 )

T
#10 Tim

Does anyone have a meter on their inverter output that they are able to interface directly with? Our Givenergy system isn't installed yet so I have opportunity to specify a meter that I can get data from by Modbus/MQTT/whatever?

T
#11 Tim

Seye can you advise on which organisation I should be speaking to about getting Zigbee access to my smart meter? Is it the electricity supplier (E-On Next) or my DNO (Scottish Power)? I'm guessing I need someone to pair my Zigbee device (don't have one yet, any suggestions) to the smart meter as well as the IHD.

S
#12 Seye

I don't think you can pair devices yourself as they need certifications to do so. The devices from Hildebrand have passed those processes. If you have one of those you deal with them, not energy supplier or dno.
I assume other suppliers of third party metering will be the same.

A
#13 anglefire

anglefire
The data for yesterday has come in ok today - but only as one lump at about 8am this morning. No 1/2hour data which is disappointing when I know its in the incoming file for at least one of the ways I've pulled it in.

A
#15 anglefire

As this really isn't the place for Octopus API's (Sorry my fault for starting it I think!), I thought I would end it by saying that current data is only available as day+1 and dumps it in the energy graph at about 8am the next day - which I didn't like - as its wrong!
But I've now found this - with the hint from @Seye https://github.com/HandyHat/ha-hildebrandglow-dcc - which works a treat - and should work for any smartmeter. Its about 1/2delayed - so there technically is 1/2hour in the wrong day - but I can live with that - it is solvable with a dongle from Glow- I'm not that bothered!