Reading Givenergy GivTCP

Hello,

I’m fully ready for the answer to my question to be ‘no’!

Is there any way to read the info from Givenergy systems into OEM via the GivTCP connection? I’m a bit of a numpty for doing too much technical editing of the program - I just wondered if it was easy(ish)…?

In theory anything is possible :slight_smile:

Do you have any documentation for the API?

There is a script to pull the data from Agile in the GitHub - emoncms/usefulscripts: Some useful scripts for administering Emoncms accounts repo, so it should be possible.

There’s some info starting here from GivEnergy on Github, but I’ve got to be honest I get a bit rabbit in headlights trying to understand even where to start!

Given this is just a means of connecting to the system via Modbus-TCP, you could probably configure the Modbus-TCP Interfacer for emonHub.

Have a dig around and see if you can find the actual Modbus specification.

I do something similar via HomeAssistant and Modbus-TCP (rather than emonHub) to talk to my Heat Recovery unit.

1 Like

I’ve (after some digging and faffing about unsuccessfully!) found this modbus library which - to my untrained eye - seems to have loads of info in, but I wouldn’t have the first clue how to make use of it.

I’m also struggling to find the relevant port ID to connect to…

It seems like there are lots of different systems that they supply.

Exactly what do you have, and what are you trying to extract and do with?

Not sure what you mean. If it is TCP then you need to connect the device to your LAN so there should be instructions on how to do that.

The “default” ModbusTCP port is usually 502. But that’s not “cast in stone.”

1 Like

I have an AC3.0 inverter with 2 battery packs.

They seem to supply all sorts of info (even down to cell voltages & temperatures in the battery pack) - but I’m more interested in things like state of charge.

I read info out of my solaredge system via modbus over TCP already, so was hoping it’d be relatively simple…

Ah, well you didn’t say that! You asked…

How do you read the data?

I have this running for the solaredge, which reads the AC output, DC input, and inverter temperature

[[ModbusTCP]]
    Type = EmonModbusTcpInterfacer
    [[[init_settings]]]
        modbus_IP = 192.168.68.56   
        modbus_port = 1502       
    [[[runtimesettings]]]
        rName = I_AC_Power_Combined,I_DC_Current_Combined,I_DC_Voltage_Combined,I_Temp_Sink,I_Temp_Sink_SF
	register = 40084,40097,40099,40104,40107
	nreg = 2,2,2,1,1
	rType = uint32,uint32,uint32,int16,int16
	nodeId = 27
        pubchannels = ToEmonCMS,
        interval = 5

Most people seem to access the Givenergy data using Home assistant but I’m not sure that’s a hole I want to venture down.

Edit-
Digging further, it seems you need to read the data from the Giv system into Docker first as some sort of bridge between the systems. This is the point it starts going over my head!!

I’m now totally confused.

You have, what is apparently, an emonHub config working? Is it reading data into emoncms?

What is the problem?

I use givenergy-local in Home Assistant HACS to read the data from my GiveEnergy battery into Home Assistant.

I then use Emoncms History - Home Assistant to post certain feeds data from Home Assistant to Emoncms. Here’s the .yaml config

emoncms_history:
  api_key: xxxxxx
  url: http://192.168.xxx.xxx
  inputnode: 19
  scan_interval: 10
  whitelist:
    - sensor.battery_percent
    - sensor.battery_power
    - sensor.inverter_charger_temperature
    - sensor.battery_temperature

I’m considering moving to using giv_tcp which runs as a docker container and will expose the givenergy data via MQTT, it looks like give_tcp can extract more data than givenergy-local e.g individual cell voltages and temperatures.

It is just a matter of knowing the modbus register number and data type.

Ok I’ll rewind and try to explain better

I have a solaredge edge system that I read data from into OEM via modbus over TCP successfully

I’ve also got a separate GivEnergy inverter/battery system that it is (allegedly) possible to read data from via what they call GivTCP. I’m just unsure how to do so. Many people read it via docker and home assistant, but that would appear to need an additional Pi in order to have the resource to run Home Assistant (and I’m not sure I want to set that up too). I cannot find much detail on the modbus registers etc that they use - other than passing references to its existence - so I was wondering if anyone else had tried to read it into OEM.

Without sounding monstrously stupid (!) can I run this on docker on the same Pi I have OEM running? This is along the lines of what I was wanting to try

That makes more sense :slight_smile:

No and I suspect that is the issue.

In theory yes, but not something I’d do.

Again - without sounding stupid - there’s this page here that has a modbus library for python. Is this of any use?

What you need is the actual modbus specification really. That giv_tcp docker seems to be produced by GivEnergy themselves so they know the modbus spec.