question

joel-cherian avatar image
joel-cherian asked

How to extract the battery state from cerbo GX using modbus tcp ( python)

Hello everyone,

I have a python script for getting several values from the cerbo gx using the modbus tcp protocol.

All the registers i used was from the modbus register list provided by victron. For example, i accessed the values like

Load = client.read_input_registers(860, 1)

Solar Voltage = client.read_input_registers(776,3,unit=226)


Unfortunately im not able to read any batterystate. The register used in the modbus list is 844, but i dont get any readings, such 0,1, or 2 . This is what i use.

batterystate= client.read_input_registers(844,1)

Any help is appreciated. Thanks !!

cerbo gxModbus TCP
1 comment
2 |3000

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

What batteries do you have? are they CAN bus connected or do you have a BMV? Depending on the battery monitor mode you are using the unit id can be different.

0 Likes 0 ·
1 Answer
Mike Dorsett avatar image
Mike Dorsett answered ·

Battery Voltage should be in register 3105 (from an inverter), 771 from a solar charger,

Last discharge 282
Average discharge 283
Charge cycles 284
Full discharges 285
Total Ah drawn 286
Minimum voltage 287
Maximum voltage 288
Time since last full charge 289

state of charge 266

from a smart shunt / battery monitor device.

Battery Voltage (System) 840
Battery Current (System) 841
Battery Power (System) 842
Battery State of Charge (System) 843
Battery state (System) 844
Battery Consumed Amphours (System) 845
Battery Time to Go (System) 846

Refer to the CCGX Modbus TCP register list from Victron for full details.

You will need one device reporting the battery state to the GX to get the information in the registers.

2 |3000

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