SunSpec SunSpec Model 802 — Battery Base Model Modbus TCP template

SunSpec Model 802 — Battery Base Model

SunSpec Model 802 is the Battery Base Model defined by the SunSpec Alliance, the mandatory foundation register block that all SunSpec-compliant battery storage systems must expose. Using Modbus TCP, this template reads nameplate ratings (amp-hour and watt-hour capacity, maximum charge and discharge power), live measurements (state of charge, depth of discharge, state of health, cycle count, DC voltage, current, and power), cell-level voltage extremes, and event bitfields for fault detection. Write registers allow remote control of reserve SoC limits, operation commands, inverter state, and alarm resets. One template covers any SunSpec 802-compliant battery regardless of chemistry or manufacturer.

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

Registers (58)

58 read, 6 write

NameUnitAccessAddress (Hidden until you enter your email)Function (hidden)Type (hidden)
idRead
lRead
ahrtgAhRead
whrtgWhRead
wchartemaxWRead
wdischartemaxWRead
discharte%WHRtgRead
socmax%WHRtgRead
socmin%WHRtgRead
socrsvmax%WHRtgRead and write
socrsvmin%WHRtgRead and write
soc%WHRtgRead
dod%Read
soh%Read
ncyccountRead
chastRead
locremctlRead
hbRead
ctrlhbRead and write
almrstRead and write
typRead
stateRead
statevndRead
warrdtRead
evt1Read
evt2Read
evtvnd1Read
evtvnd2Read
vVRead
vmaxVRead
vminVRead
cellvmaxVRead
cellvmaxstrRead
cellvmaxmodRead
cellvminVRead
cellvminstrRead
cellvminmodRead
cellvavgVRead
aARead
achamaxARead
adischamaxARead
wWRead
reqinvstateRead
reqwWRead
setopRead and write
setinvstateRead and write
ahrtg_sfRead
whrtg_sfRead
wchadischamax_sfRead
discharte_sfRead
soc_sfRead
dod_sfRead
soh_sfRead
v_sfRead
cellv_sfRead
a_sfRead
amax_sfRead
w_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 state of charge and depth of discharge continuously to detect abnormal depletion patterns between charge cycles.
  • Track state-of-health and cycle count over months to identify capacity fade before it affects site autonomy.
  • Alert on evt1 or evt2 bitfield changes to catch battery bank faults such as over-temperature or voltage imbalance early.
  • Compare cellvmax and cellvmin over time to spot cell or string imbalance that signals maintenance is due.
  • Verify that reserve SoC setpoints socrsvmin and socrsvmax remain within expected bounds after any remote configuration change.

Installation

  1. Enable Modbus TCP on the battery system or its inverter gateway by navigating to the communication or Modbus section of the device web interface or display panel and confirming port 502 is active.

  2. Connect the battery management system or inverter to the same local network as the ModbusCloud Gateway, ensuring no firewall blocks TCP port 502 between the two devices.

  3. In the ModbusCloud portal, add a new device, select the ModbusCloud Gateway as the transport, import the SunSpec Model 802 template, and set the correct Modbus unit ID matching the battery slave address.

  4. Confirm the connection by reading registers id (address 0) and l (address 1): id must return 802 and l must return the documented block length; then spot-check soc (address 11) against the battery display.

Things to watch for

All register values read as 0x8000 or 0xFFFF. What is wrong?

Those are SunSpec 'Not Implemented' sentinel values, meaning the battery does not expose that data point for its chemistry or configuration. Unsupported optional registers in Model 802 must be set to the appropriate unimplemented value per the SunSpec specification. Check whether your battery model documents which points are mandatory versus optional.

Voltage and current readings look wrong by a factor of 10 or 100.

Every measurement register in Model 802 has a paired scale-factor register (v_sf, a_sf, w_sf, etc.). The raw register value must be multiplied by 10 raised to the power of the signed scale factor. Confirm that your portal or polling client is applying the correct sf register to each measurement rather than treating the raw value as the final number.

The gateway connects but no data appears after importing the template.

SunSpec devices place Model 802 at a dynamic offset within the holding register space, not at a fixed absolute address. The SunSpec scan must first locate the SunS marker (0x5375 0x6E53) at address 40000, 0, or 50000, then walk the model chain to find Model 802. If the polling client uses a hard-coded start address it will miss the block. Verify the unit ID and confirm the SunSpec scan completes before reading offsets.

Is it safe to write socrsvmin, socrsvmax, setop, or setinvstate remotely?

Use caution with all write registers. Writing setop or setinvstate can trigger immediate connect, disconnect, or charge commands on the battery bank, which may trip protection circuits or violate the battery management system's operating envelope. Confirm acceptable ranges with the battery manufacturer before writing, and coordinate with on-site personnel when issuing commands remotely.

Want to see how it works?

Electrician working in an open distribution board