Live GivEnergy PV Inverter Data in Home Assistant
I recently had solar panels installed, which included an inverter from GivEnergy.
If you want to analyse your usage, the GivEnergy portal allows you to do that, with graphs to explore the data over time. However, it has one big limitation: the data in the web portal is sent every 5 minutes from the inverter, meaning you can't get live data out of the system.
GivEnergy do publish a tool which you can run inside your home network, which will connect to the inverter over TCP, then forward any data it sends to an MQTT broker.
Data Visualisation
That's where Home Assistant comes in: you can subscribe to the MQTT broker, and all of the data from the inverter will show up as sensor data within Home Assistant. This allows automations, dashboarding and historical data capture.
Custom dashboard showing live inverter statistics for now
The statistics update roughly every 2 seconds, which is near enough instant for the vast majority of usages. It makes a dashboard showing gauges update live - with the above dashboard you can see the needles jump around as the PV, house load, battery etc change.
Custom dashboard showing historical data from the inverter
Setting up Ingestion
For my use case I am using two Raspberry Pi 4 Model B connected to my network.
I am running Home Assistant on the first Pi: https://www.home-assistant.io/installation/
On the second Pi, I have Docker installed, and a container running GivTCP, and another container running an MQTT broker. My Docker Swarm definitions look like this:
GivTCP
I'm specifying the inverter IP address explicitly as the auto discovery didn't work (I gave the inverter a static IP). More information on the configuration parameters here: https://github.com/GivEnergy/giv_tcp
version: '3.2'
services:
givenergy:
image: britkat/giv_tcp-ma
ports:
- 6345:6345
environment:
- INVERTOR_IP=<inverter ip>
- MQTT_OUTPUT=True
- MQTT_ADDRESS=<mqtt broker ip>
- MQTT_USERNAME=<mqtt username>
- MQTT_PASSWORD=<mqtt password>
deploy:
restart_policy:
condition: any
I saved this as stack.yml
and ran it with:
docker stack deploy -c stack.yml givtcp
Mosquitto
This is the MQTT broker I picked. Instructions around configuration and setting up credentials can be found here: https://hub.docker.com/_/eclipse-mosquitto
version: '3'
services:
mosquitto:
image: eclipse-mosquitto
ports:
- 1883:1883
- 9001:9001
volumes:
- ./data:/mosquitto
deploy:
restart_policy:
condition: any
I saved this as stack.yml
and ran it with:
docker stack deploy -c stack.yml mosquitto
Connecting to Home Assistant
Once GivTcp and the MQTT broker are set up and running, you can connect them to Home Assistant. That's as easy as adding the MQTT integration:
Once that's done, you will see around 45 entities show up:
... and from there you can start using them!
🏷️ data inverter assistant mqtt broker live givenergy dashboard connect pi givtcp pv install portal network
Please click here to load comments.