diy solar

diy solar

EG4 6000XP - reading SoH via modbus

Ambrotos

New Member
Joined
Feb 7, 2024
Messages
22
Location
Canada
I've been referring to the EG4 Modbus protocol spec (provided by EG4 here) and successfully polling my inverter for the usual suspects (inverter state, battery voltage, PV power in, load power out, bus current, etc.) directly via a DIY modbus controller I'm working on. The one thing I haven't been able to pull is the battery state of health.

As per the spec, both State of Charge (I believe that's a typo in the document, "capacity" is register 97!), and State of Health are input register address 5. I'm not sure how to interpret that. This isn't a register with multiple states mapped to individual bits where you can apply a bitmask to extract the information you want, since elsewhere they clearly spell out which bits map to which values. A good example of this is register 71 where bits 0-3 indicate AutoTestStart, and so on. Address 5 is the only register in the doc that's overloaded like this. I've tried querying both U_INT16 and U_INT32 values from it, and I've tried applying high- and low- WORD and DWORD masks to the return value. The only result I can extract is 42, which is the correct value for my battery's current State of Charge.

Has anyone had any success pulling the battery State of Health from the inverter?

Cheers,

-A

N.B. - since the inverter aggregates all of the batteries' status information into one representation, I'm making the assumption here that battery SoH would represent the worst value reported by any of the attached batteries' BMSs.
 
implemented eg4 6000xp protcol in this, but never tested cause i dont have one :p

this bit is where i process the values, from mutiple or individual registries to create WORDS ect...

oof, i have a typo in comments, the default type is USHORT

might give some answers...
 
Very interesting! Looking at your register map (here) made me realize that while I did try bitmasking on the WORD and D_WORD boundaries, one thing I didn't try was handling the high/low BYTES of the register as individual value. In retrospect, I'm not sure why that didn't occur to me ;) I'm going to give this a try once I'm home and have access to my inverter again.

Thanks for sharing. This might be the clue I needed.

-A
 
Very interesting! Looking at your register map (here) made me realize that while I did try bitmasking on the WORD and D_WORD boundaries, one thing I didn't try was handling the high/low BYTES of the register as individual value. In retrospect, I'm not sure why that didn't occur to me ;) I'm going to give this a try once I'm home and have access to my inverter again.

Thanks for sharing. This might be the clue I needed.

-A
Let us know if that works!
 
Let us know if that works!
Sorry, I suppose I should have updated this thread. No, unfortunately I'm still not able to poll SoH. I did check the high byte of the 16-bit return response from register 5, and it's always 0.

There aren't any other references to SoH or Health in the modbus protocol doc, and all of the references I've found online seem to be based on the project hotnoob linked above. In other words, based on the manufacturer's doc but untested.

I haven't had a lot of time to play this month, but I hope to get back to it shortly. I'll update this thread if I have any luck.

-A
 
Last edited:
Anyway to pull this data from inverter thru the 6000xp wifi dongle with out the EG4 app. Lets say directly to smart hub like Hubitat? Obviously a driver would need to be made for the hub.
 
Here is the 485 traffic captured using a 485 transceiver and a logic analyzer of a request to an EG4 18kPV (I think the 6000xp uses the same register mapping? I haven't looked at it)

modbus request:
modbus_request.png

modbus reply:

modbus_reply.png

The SOH of the battery bank is the 0x64 (100 decimal)
and the SOC is 0x63 (99 decimal)

Using the meter port there seems to be a delay of around 280 ms before the inverter will send a reply -- I've been looking at the other 485 port (the one that's shared with the wifi dongle) and might use that instead if the delay is less (although it looks like the protocol is a little different and the endianness is also different?)
 
Maybe Solar Assistant?
SA uses a raspberry pi. Place is off grid, trying to keep unnecessary device from drawing power. But will mull over there website and see if the SA data can be integrated into a smart hub so I can make rules to run or not run things bases on battery SOC. For example: if SOC is <25% do not run well pump, etc..
If EG4 has an open API then cloud data could theoretically be accessed by a smart hub. But even better if it can be access locally thru the wifi dongles IP address / port.
 
I have Solar Assistant, EG4 6000XP and ProPower Battery.

This is what I see in the settings page through SA.
1717874677194.png

This what I see in the Automation page:
1717874545228.png

Rule table options.

1717874349356.png
1717874359274.png

But there are limited triggers from there.
1717874601602.png

I hope this helps.
 

diy solar

diy solar
Back
Top