
SMA Sunny Boy Storage 3.7/5.0/6.0 (Modbus) (battery)
The SMA Sunny Boy Storage 3.7/5.0/6.0 is a residential battery inverter that couples high-voltage battery storage to an existing PV system. This ModbusCloud template connects over Modbus TCP and reads AC power flow, cumulative energy throughput, and battery state of charge. It also exposes the full six-register BMS control group (operating mode, minimum and maximum charge power, minimum and maximum discharge power, and grid transfer setpoint), enabling closed-loop charge management from your portal. Use this template to monitor storage behavior and coordinate demand-side control across a residential site.
- Protocol
- Modbus TCP
- Connection
- Ethernet, Modbus TCP
- Registers
- 9, read and write
- Brand
- SMA
- Last updated
Registers (9)
3 read, 6 write
| Name | Unit | Access | Address (Hidden until you enter your email) | Function (hidden) | Type (hidden) |
|---|---|---|---|---|---|
| power | W | Read | 30775 | FC04 | int32 |
| energy | Read | 30513 | FC03 | uint64 | |
| soc | % | Read | 30845 | FC03 | uint32 |
| batterymode_a | Write | 40236 | FC16 | uint32 | |
| batterymode_b | W | Write | 40793 | FC16 | uint32 |
| batterymode_c | W | Write | |||
| batterymode_d | W | Write | |||
| batterymode_e | W | Write | |||
| batterymode_f | W | Write |
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 battery state of charge continuously to detect capacity degradation across seasons.
- Track AC power flow to verify the inverter is delivering or absorbing the expected load.
- Alert on state-of-charge dropping below a configured threshold during overnight discharge periods.
- Compare cumulative energy throughput against installation date to estimate battery cycle count.
- Write coordinated BMS setpoints to limit charging power during grid peak-tariff windows.
Installation
Log into the Sunny Boy Storage web interface, navigate to the communication or Modbus section under External Communication, and activate the Modbus TCP server on port 502.
Connect the inverter's RJ45 Ethernet port to the same local network as the ModbusCloud Gateway, confirming the inverter receives a static IP address or a DHCP reservation.
In the ModbusCloud portal, add the Gateway, import the SMA Sunny Boy Storage 3.7/5.0/6.0 template, and set the unit ID to 3 (or the value assigned to your inverter; SMA documentation also references unit ID 126 for direct access).
Verify the connection by checking that register 30845 returns a plausible state-of-charge value and register 30775 returns a signed AC power reading in the portal's live view.
Things to watch for
Register 30775 always returns NaN or 2147483648. Why?
SMA inverters return the NaN sentinel value 0x80000000 (2147483648 for a uint32 interpretation) when a register is unavailable, for example outside daylight hours or during a fault state. Confirm the inverter is in feed-in or standby operation, and read the register as a signed int32 as specified in the SMA Modbus profile.
The gateway connects but no live values appear. What now?
The Modbus TCP server is disabled by default on the Sunny Boy Storage. Open the inverter's web interface, go to the Modbus section under External Communication, and explicitly activate the TCP server on port 502. Also confirm no firewall on the local network is blocking that port.
I wrote batterymode_a but the inverter ignores it. What is wrong?
The SMA Sunny Boy Storage requires all six BMS registers (40236, 40793, 40795, 40797, 40799, and 40801) to be written within a 60-second window, and they must continue to be written cyclically. Writing only one register has no effect. Configure your portal automation to send all six values together in each cycle. ModbusCloud writes registers at most once per minute, so keeping this 60-second window is borderline and not guaranteed.
Is it safe to write BMS setpoint registers during normal operation?
Use caution. Writing incorrect values to the BMS operating mode or power limit registers can override the inverter's internal protection logic, force unintended charge or discharge cycles, and may affect warranty conditions. Always validate setpoint values against the SMA Modbus parameter documentation before deploying automated writes to these registers.
Knowledge base articles for this device

Getting an SMA PUK and switching on Modbus TCP
SMA PUK: free in the Online Service Center for firmware below 4.00, PUK2.0 from 4.00. Then set a new installer password and switch on Modbus TCP.
SMA Modbus: reading a Sunny Boy over Modbus TCP (installers)
SMA Modbus explained: enable the Modbus TCP server on port 502, choose between the SMA profile (unit ID 3) and SunSpec (unit ID 126), read the right registers, and handle the NaN values at night. Practical guide for installers.
Want to see how it works?










