SunSpec SunSpec Model 804 — Lithium-Ion String Model Modbus TCP template

SunSpec Model 804 — Lithium-Ion String Model

SunSpec Model 804 is the Lithium-Ion String Model, an open interoperability standard published by the SunSpec Alliance for monitoring and controlling a single battery string within a multi-string energy storage system. The template reads string-level state of charge, depth of discharge, state of health, cycle count, DC current and voltage, per-cell minimum and maximum voltages with module location, module temperature extremes, contactor and event status over Modbus TCP. Write registers allow enabling or disabling the string and commanding the physical contactor. Import this template to track string health and detect imbalances across a battery bank in your ModbusCloud portal.

Protocol
Modbus TCP
Connection
Ethernet, Modbus TCP
Registers
37, read and write
Brand
SunSpec
Last updated

Registers (37)

37 read, 2 write

NameUnitAccessAddress (Hidden until you enter your email)Function (hidden)Type (hidden)
idRead
lRead
idxRead
nmodRead
stRead
confailRead
ncellbalRead
soc%Read
dod%Read
ncyccountRead
soh%Read
aARead
vVRead
cellvmaxVRead
cellvmaxmodRead
cellvminVRead
cellvminmodRead
cellvavgVRead
modtmpmax°CRead
modtmpmaxmodRead
modtmpmin°CRead
modtmpminmodRead
modtmpavg°CRead
constRead
evt1Read
evt2Read
evtvnd1Read
evtvnd2Read
setenaRead and write
setconRead and write
soc_sfRead
soh_sfRead
dod_sfRead
a_sfRead
v_sfRead
cellv_sfRead
modtmp_sfRead

Loading registers…

Send your device list

If a device is not in the library yet, we build the template for free as soon as we have the register data.

Use cases

  • Monitor string state of charge and state of health over time to detect capacity fade early.
  • Alert on cell voltage spread between cellvmax and cellvmin to catch balancing failures before damage occurs.
  • Track cumulative cycle count per string to compare aging between parallel strings in the same bank.
  • Verify module temperature extremes modtmpmax and modtmpmin remain within safe operating limits during charge cycles.
  • Report contactor status and event flags to confirm successful string connection after a maintenance shutdown.

Installation

  1. Enable Modbus TCP on the battery management system or gateway device, typically found under the communication or Modbus section of the device web interface or display panel.

  2. Connect the BMS or energy storage system to the same LAN as the ModbusCloud Gateway, ensuring TCP port 502 is reachable and no firewall blocks the connection.

  3. In the ModbusCloud portal, add a new device, import the SunSpec Model 804 template, and assign the correct unit ID matching the Modbus slave ID configured on the BMS.

  4. After the first poll cycle, open the register table and spot-check the soc and v registers against the BMS display to confirm correct unit ID, base address, and scale factor alignment.

Things to watch for

All measurement registers read zero or show unexpected values. Why?

SunSpec Model 804 uses signed scale-factor registers (soc_sf, v_sf, cellv_sf, etc.) that must be read and applied to the raw integer value. If your Modbus client reads the raw register without applying the corresponding scale factor exponent, every value will appear incorrect. Confirm that the template scale-factor registers are being polled and applied.

The gateway connects but the string status register st returns 0xFFFF. What now?

A value of 0xFFFF for a uint32 or uint16 in SunSpec indicates 'Not Implemented.' The BMS serving this string may not have implemented the st register. Check the BMS firmware version and SunSpec implementation notes. Try polling the id register first: if it returns 804, the model is present but individual optional points may still be unimplemented.

Why does the contactor not close after I write to setcon?

The SunSpec specification requires the string to be enabled before a connect command via setcon is accepted. If setena has not been set to the enabled state first, the contactor command will fail and the CONTACTOR_STATUS bit in the st register will not be set. Write the correct enable value to setena, then issue the setcon connect command.

Is it safe to write to setena and setcon during live operation?

Writing to setena or setcon commands physical contactors and directly affects whether the battery string is electrically connected. Issuing these commands during active charge or discharge can interrupt power flow, trigger BMS protection faults, or in some implementations, risk equipment damage. Test write commands only during planned maintenance windows and confirm with the BMS manufacturer that remote contactor control is supported and warranted.

Want to see how it works?

Electrician working in an open distribution board