question

jm0278 avatar image
jm0278 asked

ModbusTCP Register with Best State of Charge value?

I've written a program to implement ESS mode 2 control and it's working well. But the only register I've been able to use for State of Charge is 843 and 843 always returns an integer. I know there has to be an SoC stored out there somewhere with one digit to the right of the decimal point because the remote console displays it. Anyone know the register to use to get a "float" value returned for SoC?


Thanks.

ESSModbus TCP
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

3 Answers
Alistair Warburton avatar image
Alistair Warburton answered ·

I just added a smart shunt, via VE.Direct.

I am using a CCGX which means VE.Direct 1 has an instance ID of 255 which maps to device 247.
Note that the instance, GX/VRM, is not the same as the Modbus device ID, see mapping sheet.

The shunt itself shows up as a battery, com.victronenergy.battery, with SOC being register 266.
It returns a uINT which is SOC X 10.

Also be careful with INT's (sINT) they look correct when positive but due to the way they are encoded will be wrong when negative unless you handle them as 'signed integers' when reading.

(A Modbus read will return a 16 bit word OK but unsigned integers use the MSB as sign and code in 2's compliment when negative.
10000000 00000001 is in fact -32767 not 32769 which is what the same bit pattern in a UINT is.)

I am building flows for flows for this now and would be happy to collaborate,

I am pretty new to Node Red, and Victron for that matter, but have worked with industrial controls for decades.

2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

elvis avatar image
elvis answered ·

You didn't say what equipment you have.

Register 266 for the BMV will get you what you want.

Did you download the ModBus TCP Register Spreadsheet?

2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

jm0278 avatar image
jm0278 answered ·

Thanks, elvis. I have a Multiplus-II, Smart Shunt 500, and SmartSolar MPPT with a Cerbo GX. But my batteries are Ampere Time 200+ and have an internal BMS. I just tried 266 in my test bed program and did not receive a return value for the register read; the actual return in Python was "NoneType".

2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.