{
  "spec_version": 1,
  "slug": "sma-sunny-boy-storage",
  "manufacturer": "SMA",
  "model": "Sunny Boy Storage 2.5 / 3.7 / 5.0 / 6.0",
  "category": "Home battery",
  "supplier_url": "https://www.sma.de/en/products/product-features-interfaces/modbus-protocol-interface",
  "default_configuration": {
    "protocol": "modbus_tcp",
    "port": 502,
    "unit_id": 3,
    "addressing": "zero_based",
    "byte_order": "BigEndian",
    "word_order": "HighFirst"
  },
  "coils": [],
  "discrete_inputs": [],
  "input_registers": [
    {
      "address": 30001,
      "count": 2,
      "name": "SMA Modbus profile version",
      "data_type": "UInt32",
      "units": "",
      "scale_factor": 1,
      "offset": 0,
      "access": "R"
    },
    {
      "address": 30003,
      "count": 2,
      "name": "SUSy ID",
      "data_type": "UInt32",
      "units": "",
      "scale_factor": 1,
      "offset": 0,
      "access": "R"
    },
    {
      "address": 30005,
      "count": 2,
      "name": "Serial number",
      "data_type": "UInt32",
      "units": "",
      "scale_factor": 1,
      "offset": 0,
      "access": "R"
    },
    {
      "address": 30775,
      "count": 2,
      "name": "Active power, all line conductors (GridMs.TotW)",
      "data_type": "Int32",
      "units": "W",
      "scale_factor": 1,
      "offset": 0,
      "access": "R",
      "description": "Positive means export to the grid."
    },
    {
      "address": 30843,
      "count": 2,
      "name": "Battery current (Bat.Amps)",
      "data_type": "Int32",
      "units": "A",
      "scale_factor": 0.001,
      "offset": 0,
      "access": "R"
    },
    {
      "address": 30845,
      "count": 2,
      "name": "Battery state of charge (Bat.ChaStt)",
      "data_type": "UInt32",
      "units": "%",
      "scale_factor": 1,
      "offset": 0,
      "access": "R"
    },
    {
      "address": 30847,
      "count": 2,
      "name": "Battery capacity (Bat.Cap)",
      "data_type": "UInt32",
      "units": "%",
      "scale_factor": 1,
      "offset": 0,
      "access": "R"
    },
    {
      "address": 30849,
      "count": 2,
      "name": "Battery temperature (Bat.TmpVal)",
      "data_type": "Int32",
      "units": "°C",
      "scale_factor": 1,
      "offset": 0,
      "access": "R"
    },
    {
      "address": 30851,
      "count": 2,
      "name": "Battery voltage (Bat.Vtg)",
      "data_type": "UInt32",
      "units": "V",
      "scale_factor": 0.01,
      "offset": 0,
      "access": "R"
    },
    {
      "address": 30853,
      "count": 2,
      "name": "Active battery charging mode (Bat.ChaMod)",
      "data_type": "UInt32",
      "units": "",
      "scale_factor": 1,
      "offset": 0,
      "access": "R"
    },
    {
      "address": 30865,
      "count": 2,
      "name": "Power drawn from grid (Metering.GridMs.TotWIn)",
      "data_type": "Int32",
      "units": "W",
      "scale_factor": 1,
      "offset": 0,
      "access": "R"
    },
    {
      "address": 30867,
      "count": 2,
      "name": "Power fed to grid (Metering.GridMs.TotWOut)",
      "data_type": "Int32",
      "units": "W",
      "scale_factor": 1,
      "offset": 0,
      "access": "R"
    },
    {
      "address": 31393,
      "count": 2,
      "name": "Battery charge power (BatChrg.CurBatCha)",
      "data_type": "UInt32",
      "units": "W",
      "scale_factor": 1,
      "offset": 0,
      "access": "R"
    },
    {
      "address": 31395,
      "count": 2,
      "name": "Battery discharge power (BatDsch.CurBatDsch)",
      "data_type": "UInt32",
      "units": "W",
      "scale_factor": 1,
      "offset": 0,
      "access": "R"
    }
  ],
  "holding_registers": [
    {
      "address": 40236,
      "count": 2,
      "name": "BMS operating mode (CmpBMS.OpMod)",
      "data_type": "UInt32",
      "units": "",
      "scale_factor": 1,
      "offset": 0,
      "access": "RW",
      "description": "2424 = default operation, 2289 = battery charge mode."
    },
    {
      "address": 40793,
      "count": 2,
      "name": "Minimum battery charge power (CmpBMS.BatChaMinW)",
      "data_type": "UInt32",
      "units": "W",
      "scale_factor": 1,
      "offset": 0,
      "access": "RW"
    },
    {
      "address": 40795,
      "count": 2,
      "name": "Maximum battery charge power (CmpBMS.BatChaMaxW)",
      "data_type": "UInt32",
      "units": "W",
      "scale_factor": 1,
      "offset": 0,
      "access": "RW"
    },
    {
      "address": 40797,
      "count": 2,
      "name": "Minimum battery discharge power (CmpBMS.BatDschMinW)",
      "data_type": "UInt32",
      "units": "W",
      "scale_factor": 1,
      "offset": 0,
      "access": "RW"
    },
    {
      "address": 40799,
      "count": 2,
      "name": "Maximum battery discharge power (CmpBMS.BatDschMaxW)",
      "data_type": "UInt32",
      "units": "W",
      "scale_factor": 1,
      "offset": 0,
      "access": "RW"
    },
    {
      "address": 40801,
      "count": 2,
      "name": "Grid exchange power setpoint (CmpBMS.GridWSpt)",
      "data_type": "UInt32",
      "units": "W",
      "scale_factor": 1,
      "offset": 0,
      "access": "RW"
    }
  ],
  "combined_registers": [],
  "notes": "SMA Modbus profile registers, taken from the evcc templates https://raw.githubusercontent.com/evcc-io/evcc/master/templates/definition/meter/sma-sbs-modbus.yaml and https://raw.githubusercontent.com/evcc-io/evcc/master/templates/definition/meter/sma-hybrid.yaml and named the way the SMA Modbus profile document names them. Modbus TCP has to be enabled on the inverter (Communication -> Modbus -> TCP, slave = 3), port 502, unit ID 3. Measurement values live in the 30xxx area and are listed as input registers here, setpoints in the 40xxx area as holding registers - the same convention as the Sunny Boy/Tripower seed. Battery setpoints (CmpBMS) are 32-bit unsigned values in W; OpMod 2424 is the default operating mode, 2289 is 'battery charge'. The six CmpBMS holding registers (40236 and 40793-40801) are the only write registers in this map and are exactly what evcc writes for active battery control; every input register is read-only. The metering energy counters of this profile (Metering.TotWhIn/TotWhOut) are 64-bit values and are left out rather than split. Category changed from Battery inverter to Home battery (storage-centred)."
}
