{
  "spec_version": 1,
  "slug": "saj-r5-string-inverters",
  "manufacturer": "SAJ",
  "model": "R5 series single- and three-phase on-grid string inverters (R5-3K/5K/6K-S2, R6, C6)",
  "category": "Solar inverter",
  "supplier_url": "https://www.saj-electric.com/",
  "default_configuration": {
    "protocol": "modbus_rtu",
    "unit_id": 1,
    "addressing": "zero_based",
    "byte_order": "BigEndian",
    "word_order": "HighFirst",
    "native_interface": "rs485",
    "serial": {
      "baud_rate": 9600,
      "parity": "None",
      "data_bits": 8,
      "stop_bits": 1
    }
  },
  "coils": [],
  "discrete_inputs": [],
  "input_registers": [],
  "holding_registers": [
    {
      "address": 256,
      "count": 1,
      "name": "Inverter working mode",
      "data_type": "UInt16",
      "units": "",
      "scale_factor": 1,
      "offset": 0,
      "access": "R"
    },
    {
      "address": 257,
      "count": 2,
      "name": "Inverter fault message, ErrorData0",
      "data_type": "UInt32",
      "units": "",
      "scale_factor": 1,
      "offset": 0,
      "access": "R",
      "description": "Bits 31..0 of the fault message: section d decodes them as Err33...Err81 (master-side faults) and Err01...Err32. The document reads 0101H as one six-register FaultMSG row; section d splits it into ErrorData0/1/2 and its worked example returns 00 08 00 00 for ErrorData0 = 0x00080000, i.e. the high register first."
    },
    {
      "address": 259,
      "count": 2,
      "name": "Inverter fault message, ErrorData1",
      "data_type": "UInt32",
      "units": "",
      "scale_factor": 1,
      "offset": 0,
      "access": "R",
      "description": "Bits 63..32 of the fault message: section d decodes them as Err25...Err32 and Err01...Err27. The document reads 0101H as one six-register FaultMSG row; section d splits it into ErrorData0/1/2 and its worked example returns 00 08 00 00 for ErrorData0 = 0x00080000, i.e. the high register first."
    },
    {
      "address": 261,
      "count": 2,
      "name": "Inverter fault message, ErrorData2",
      "data_type": "UInt32",
      "units": "",
      "scale_factor": 1,
      "offset": 0,
      "access": "R",
      "description": "Bits 95..64 of the fault message: section d decodes them as Err50...Err81 (slave-side faults). The document reads 0101H as one six-register FaultMSG row; section d splits it into ErrorData0/1/2 and its worked example returns 00 08 00 00 for ErrorData0 = 0x00080000, i.e. the high register first."
    },
    {
      "address": 263,
      "count": 1,
      "name": "PV1 voltage",
      "data_type": "UInt16",
      "units": "V",
      "scale_factor": 0.1,
      "offset": 0,
      "access": "R"
    },
    {
      "address": 264,
      "count": 1,
      "name": "PV1 total current",
      "data_type": "UInt16",
      "units": "A",
      "scale_factor": 0.01,
      "offset": 0,
      "access": "R"
    },
    {
      "address": 265,
      "count": 1,
      "name": "PV1 power",
      "data_type": "UInt16",
      "units": "W",
      "scale_factor": 1,
      "offset": 0,
      "access": "R"
    },
    {
      "address": 266,
      "count": 1,
      "name": "PV2 voltage",
      "data_type": "UInt16",
      "units": "V",
      "scale_factor": 0.1,
      "offset": 0,
      "access": "R"
    },
    {
      "address": 267,
      "count": 1,
      "name": "PV2 total current",
      "data_type": "UInt16",
      "units": "A",
      "scale_factor": 0.01,
      "offset": 0,
      "access": "R"
    },
    {
      "address": 268,
      "count": 1,
      "name": "PV2 power",
      "data_type": "UInt16",
      "units": "W",
      "scale_factor": 1,
      "offset": 0,
      "access": "R"
    },
    {
      "address": 269,
      "count": 1,
      "name": "PV3 voltage",
      "data_type": "UInt16",
      "units": "V",
      "scale_factor": 0.1,
      "offset": 0,
      "access": "R"
    },
    {
      "address": 270,
      "count": 1,
      "name": "PV3 total current",
      "data_type": "UInt16",
      "units": "A",
      "scale_factor": 0.01,
      "offset": 0,
      "access": "R"
    },
    {
      "address": 271,
      "count": 1,
      "name": "PV3 power",
      "data_type": "UInt16",
      "units": "W",
      "scale_factor": 1,
      "offset": 0,
      "access": "R"
    },
    {
      "address": 272,
      "count": 1,
      "name": "BUS voltage",
      "data_type": "UInt16",
      "units": "V",
      "scale_factor": 0.1,
      "offset": 0,
      "access": "R"
    },
    {
      "address": 273,
      "count": 1,
      "name": "Inverter temperature",
      "data_type": "Int16",
      "units": "°C",
      "scale_factor": 0.1,
      "offset": 0,
      "access": "R"
    },
    {
      "address": 274,
      "count": 1,
      "name": "GFCI",
      "data_type": "Int16",
      "units": "mA",
      "scale_factor": 1,
      "offset": 0,
      "access": "R"
    },
    {
      "address": 275,
      "count": 1,
      "name": "Active power of inverter total output",
      "data_type": "UInt16",
      "units": "W",
      "scale_factor": 1,
      "offset": 0,
      "access": "R"
    },
    {
      "address": 276,
      "count": 1,
      "name": "Reactive power of inverter total output",
      "data_type": "Int16",
      "units": "Var",
      "scale_factor": 1,
      "offset": 0,
      "access": "R"
    },
    {
      "address": 277,
      "count": 1,
      "name": "Total power factor of inverter",
      "data_type": "Int16",
      "units": "",
      "scale_factor": 0.001,
      "offset": 0,
      "access": "R"
    },
    {
      "address": 278,
      "count": 1,
      "name": "L1 voltage",
      "data_type": "UInt16",
      "units": "V",
      "scale_factor": 0.1,
      "offset": 0,
      "access": "R"
    },
    {
      "address": 279,
      "count": 1,
      "name": "L1 current",
      "data_type": "UInt16",
      "units": "A",
      "scale_factor": 0.01,
      "offset": 0,
      "access": "R"
    },
    {
      "address": 280,
      "count": 1,
      "name": "L1 frequency",
      "data_type": "UInt16",
      "units": "Hz",
      "scale_factor": 0.01,
      "offset": 0,
      "access": "R"
    },
    {
      "address": 281,
      "count": 1,
      "name": "L1 DC component",
      "data_type": "Int16",
      "units": "mA",
      "scale_factor": 1,
      "offset": 0,
      "access": "R",
      "description": "L1 direct current component"
    },
    {
      "address": 282,
      "count": 1,
      "name": "L1 power",
      "data_type": "UInt16",
      "units": "W",
      "scale_factor": 1,
      "offset": 0,
      "access": "R",
      "description": "L1power"
    },
    {
      "address": 283,
      "count": 1,
      "name": "L1 power factor",
      "data_type": "Int16",
      "units": "",
      "scale_factor": 0.001,
      "offset": 0,
      "access": "R"
    },
    {
      "address": 284,
      "count": 1,
      "name": "L2 voltage",
      "data_type": "UInt16",
      "units": "V",
      "scale_factor": 0.1,
      "offset": 0,
      "access": "R"
    },
    {
      "address": 285,
      "count": 1,
      "name": "L2 current",
      "data_type": "UInt16",
      "units": "A",
      "scale_factor": 0.01,
      "offset": 0,
      "access": "R"
    },
    {
      "address": 286,
      "count": 1,
      "name": "L2 frequency",
      "data_type": "UInt16",
      "units": "Hz",
      "scale_factor": 0.01,
      "offset": 0,
      "access": "R"
    },
    {
      "address": 287,
      "count": 1,
      "name": "L2 DC component",
      "data_type": "Int16",
      "units": "mA",
      "scale_factor": 1,
      "offset": 0,
      "access": "R"
    },
    {
      "address": 288,
      "count": 1,
      "name": "L2 power",
      "data_type": "UInt16",
      "units": "W",
      "scale_factor": 1,
      "offset": 0,
      "access": "R"
    },
    {
      "address": 289,
      "count": 1,
      "name": "L2 power factor",
      "data_type": "Int16",
      "units": "",
      "scale_factor": 0.001,
      "offset": 0,
      "access": "R"
    },
    {
      "address": 290,
      "count": 1,
      "name": "L3 voltage",
      "data_type": "UInt16",
      "units": "V",
      "scale_factor": 0.1,
      "offset": 0,
      "access": "R"
    },
    {
      "address": 291,
      "count": 1,
      "name": "L3 current",
      "data_type": "UInt16",
      "units": "A",
      "scale_factor": 0.01,
      "offset": 0,
      "access": "R"
    },
    {
      "address": 292,
      "count": 1,
      "name": "L3 frequency",
      "data_type": "UInt16",
      "units": "Hz",
      "scale_factor": 0.01,
      "offset": 0,
      "access": "R"
    },
    {
      "address": 293,
      "count": 1,
      "name": "L3 DC component",
      "data_type": "Int16",
      "units": "mA",
      "scale_factor": 1,
      "offset": 0,
      "access": "R"
    },
    {
      "address": 294,
      "count": 1,
      "name": "L3 power",
      "data_type": "UInt16",
      "units": "W",
      "scale_factor": 1,
      "offset": 0,
      "access": "R"
    },
    {
      "address": 295,
      "count": 1,
      "name": "L3 power factor",
      "data_type": "Int16",
      "units": "",
      "scale_factor": 0.001,
      "offset": 0,
      "access": "R"
    },
    {
      "address": 296,
      "count": 1,
      "name": "PV1+_ISO",
      "data_type": "UInt16",
      "units": "kΩ",
      "scale_factor": 1,
      "offset": 0,
      "access": "R"
    },
    {
      "address": 297,
      "count": 1,
      "name": "PV2+_ISO",
      "data_type": "UInt16",
      "units": "kΩ",
      "scale_factor": 1,
      "offset": 0,
      "access": "R"
    },
    {
      "address": 298,
      "count": 1,
      "name": "PV3+_ISO",
      "data_type": "UInt16",
      "units": "kΩ",
      "scale_factor": 1,
      "offset": 0,
      "access": "R"
    },
    {
      "address": 299,
      "count": 1,
      "name": "PV ISO",
      "data_type": "UInt16",
      "units": "kΩ",
      "scale_factor": 1,
      "offset": 0,
      "access": "R"
    },
    {
      "address": 300,
      "count": 1,
      "name": "Energy generated today",
      "data_type": "UInt16",
      "units": "kWh",
      "scale_factor": 0.01,
      "offset": 0,
      "access": "R",
      "description": "power generation on current day"
    },
    {
      "address": 301,
      "count": 2,
      "name": "Energy generated in the current month",
      "data_type": "UInt32",
      "units": "kWh",
      "scale_factor": 0.01,
      "offset": 0,
      "access": "R",
      "description": "power generation in the current month"
    },
    {
      "address": 303,
      "count": 2,
      "name": "Energy generated in the current year",
      "data_type": "UInt32",
      "units": "kWh",
      "scale_factor": 0.01,
      "offset": 0,
      "access": "R",
      "description": "power generation in current year"
    },
    {
      "address": 305,
      "count": 2,
      "name": "Total energy generated",
      "data_type": "UInt32",
      "units": "kWh",
      "scale_factor": 0.01,
      "offset": 0,
      "access": "R",
      "description": "Total power generation"
    },
    {
      "address": 307,
      "count": 1,
      "name": "Daily working hours",
      "data_type": "UInt16",
      "units": "h",
      "scale_factor": 0.1,
      "offset": 0,
      "access": "R"
    },
    {
      "address": 308,
      "count": 2,
      "name": "Total working hours",
      "data_type": "UInt32",
      "units": "h",
      "scale_factor": 0.1,
      "offset": 0,
      "access": "R"
    },
    {
      "address": 310,
      "count": 1,
      "name": "Error count",
      "data_type": "UInt16",
      "units": "",
      "scale_factor": 1,
      "offset": 0,
      "access": "R"
    },
    {
      "address": 315,
      "count": 1,
      "name": "PV1 string 1 current",
      "data_type": "UInt16",
      "units": "A",
      "scale_factor": 0.01,
      "offset": 0,
      "access": "R"
    },
    {
      "address": 316,
      "count": 1,
      "name": "PV1 string 2 current",
      "data_type": "UInt16",
      "units": "A",
      "scale_factor": 0.01,
      "offset": 0,
      "access": "R"
    },
    {
      "address": 317,
      "count": 1,
      "name": "PV1 string 3 current",
      "data_type": "UInt16",
      "units": "A",
      "scale_factor": 0.01,
      "offset": 0,
      "access": "R"
    },
    {
      "address": 318,
      "count": 1,
      "name": "PV1 string 4 current",
      "data_type": "UInt16",
      "units": "A",
      "scale_factor": 0.01,
      "offset": 0,
      "access": "R"
    },
    {
      "address": 319,
      "count": 1,
      "name": "PV2 string 1 current",
      "data_type": "UInt16",
      "units": "A",
      "scale_factor": 0.01,
      "offset": 0,
      "access": "R"
    },
    {
      "address": 320,
      "count": 1,
      "name": "PV2 string 2 current",
      "data_type": "UInt16",
      "units": "A",
      "scale_factor": 0.01,
      "offset": 0,
      "access": "R"
    },
    {
      "address": 321,
      "count": 1,
      "name": "PV2 string 3 current",
      "data_type": "UInt16",
      "units": "A",
      "scale_factor": 0.01,
      "offset": 0,
      "access": "R"
    },
    {
      "address": 322,
      "count": 1,
      "name": "PV2 string 4 current",
      "data_type": "UInt16",
      "units": "A",
      "scale_factor": 0.01,
      "offset": 0,
      "access": "R"
    },
    {
      "address": 323,
      "count": 1,
      "name": "PV3 string 1 current",
      "data_type": "UInt16",
      "units": "A",
      "scale_factor": 0.01,
      "offset": 0,
      "access": "R"
    },
    {
      "address": 324,
      "count": 1,
      "name": "PV3 string 2 current",
      "data_type": "UInt16",
      "units": "A",
      "scale_factor": 0.01,
      "offset": 0,
      "access": "R"
    },
    {
      "address": 325,
      "count": 1,
      "name": "PV3 string 3 current",
      "data_type": "UInt16",
      "units": "A",
      "scale_factor": 0.01,
      "offset": 0,
      "access": "R"
    },
    {
      "address": 326,
      "count": 1,
      "name": "PV3 string 4 current",
      "data_type": "UInt16",
      "units": "A",
      "scale_factor": 0.01,
      "offset": 0,
      "access": "R"
    },
    {
      "address": 327,
      "count": 1,
      "name": "PV4 string 1 current",
      "data_type": "UInt16",
      "units": "A",
      "scale_factor": 0.01,
      "offset": 0,
      "access": "R"
    },
    {
      "address": 328,
      "count": 1,
      "name": "PV4 string 2 current",
      "data_type": "UInt16",
      "units": "A",
      "scale_factor": 0.01,
      "offset": 0,
      "access": "R"
    },
    {
      "address": 329,
      "count": 1,
      "name": "PV4 string 3 current",
      "data_type": "UInt16",
      "units": "A",
      "scale_factor": 0.01,
      "offset": 0,
      "access": "R"
    },
    {
      "address": 330,
      "count": 1,
      "name": "PV4 string 4 current",
      "data_type": "UInt16",
      "units": "A",
      "scale_factor": 0.01,
      "offset": 0,
      "access": "R",
      "description": "PV4 String Current 4"
    },
    {
      "address": 36608,
      "count": 1,
      "name": "Device type code",
      "data_type": "UInt16",
      "units": "",
      "scale_factor": 1,
      "offset": 0,
      "access": "R",
      "description": "0x0013 = R5 series inverter, single phase, one MPPT (per the document's notes)"
    },
    {
      "address": 36609,
      "count": 1,
      "name": "Device sub-type code",
      "data_type": "UInt16",
      "units": "",
      "scale_factor": 1,
      "offset": 0,
      "access": "R",
      "description": "Sub-type code of the model series"
    },
    {
      "address": 36610,
      "count": 1,
      "name": "Communication protocol version",
      "data_type": "UInt16",
      "units": "",
      "scale_factor": 0.001,
      "offset": 0,
      "access": "R",
      "description": "Comms Protocol Version"
    },
    {
      "address": 36611,
      "count": 10,
      "name": "Serial number (20 ASCII characters)",
      "data_type": "Ascii",
      "units": "",
      "scale_factor": 1,
      "offset": 0,
      "access": "R",
      "description": "Serial Number"
    },
    {
      "address": 36621,
      "count": 10,
      "name": "Product code (20 ASCII characters)",
      "data_type": "Ascii",
      "units": "",
      "scale_factor": 1,
      "offset": 0,
      "access": "R",
      "description": "Product Code"
    },
    {
      "address": 36631,
      "count": 1,
      "name": "Display software version",
      "data_type": "UInt16",
      "units": "",
      "scale_factor": 0.001,
      "offset": 0,
      "access": "R",
      "description": "Display Software Version"
    },
    {
      "address": 36632,
      "count": 1,
      "name": "Master controller software version",
      "data_type": "UInt16",
      "units": "",
      "scale_factor": 0.001,
      "offset": 0,
      "access": "R",
      "description": "Master Ctrl Software Version"
    },
    {
      "address": 36633,
      "count": 1,
      "name": "Slave controller software version",
      "data_type": "UInt16",
      "units": "",
      "scale_factor": 0.001,
      "offset": 0,
      "access": "R",
      "description": "Slave Ctrl Software Version"
    },
    {
      "address": 36634,
      "count": 1,
      "name": "Display board hardware version",
      "data_type": "UInt16",
      "units": "",
      "scale_factor": 0.001,
      "offset": 0,
      "access": "R",
      "description": "Display Board Hardware Version"
    },
    {
      "address": 36635,
      "count": 1,
      "name": "Control board hardware version",
      "data_type": "UInt16",
      "units": "",
      "scale_factor": 0.001,
      "offset": 0,
      "access": "R",
      "description": "Cntrl Board Hardware Version"
    },
    {
      "address": 36636,
      "count": 1,
      "name": "Power board hardware version",
      "data_type": "UInt16",
      "units": "",
      "scale_factor": 0.001,
      "offset": 0,
      "access": "R",
      "description": "Power BoardHardware Vesion"
    },
    {
      "address": 36637,
      "count": 1,
      "name": "RS485 baud rate and slave address setting",
      "data_type": "UInt16",
      "units": "",
      "scale_factor": 1,
      "offset": 0,
      "access": "R",
      "description": "Low byte = RS485 baud rate code (4 = 9600, 5 = 4800, 6 = 2400, 7 = 1200), high byte = slave number 1-32"
    }
  ],
  "combined_registers": [],
  "notes": "Source: SAJ \"SAJ Modbus Communication Protocol\", doc. J-RD-SW-G-1503002, Version A, Edition 2.0, 2019-03-15, covering the R5 series single- and three-phase on-grid inverters (section 1). Copy read: the mirrored vendor PDF at https://raw.githubusercontent.com/wimb0/home-assistant-saj-r5-modbus/main/SAJ%20Modbus%20Protocol_EN_R5.pdf (SHA-256 4e62f339f0cd6fdc90c2330d794492b809dfa04726b9c3147634186ddacb2d47); the newer revision (Version A, Edition 7.1, 2022-11-18, PLUS R5/R6/C6) was cross-checked and agrees on the block. Section 2 gives the frame: Modbus RTU, 8 data bits, 1 stop bit, no parity, RS485 default 9600 bps (RS232 115200). Section 3 gives the slave address range 0-247 (0 = broadcast) and function codes 0x03/0x10, so every row is a holding register. Registers are printed in hex with the scale as a decimal exponent, converted here to the factor 10^exponent. 32-bit rows are high word first: section d FaultMSG example returns 00 08 for ErrorData0 = 0x00080000. 0101H FaultMSG is printed as one six-register row and is seeded as its three documented 32-bit error words (ErrorData0/1/2 at 0101H/0103H/0105H). Unit id 1 is a placeholder: the document prints only the 0-247 range and keeps the slave number in 8F1DH (low byte baud code, high byte slave number 1-32), so the address comes from the inverter menu. Not seeded: 014BH (Reserved), 0137H Time (four packed-HEX registers, no matching schema type), the 0A00H-0ABDH historical energy block, the 0B00H-0EE2H error-history block (100 records of 4-register BCD timestamps plus 6-register messages) and the writable special registers 8014H/8020H. This seed carries every row of the 0100H-014AH real-time block and the 8F00H-8F1DH device-information block."
}
