Skip to content

Modbus

/stm.cgi?modbus_sensor

Only in HW 3.5+

Select the module connected to the serial port (Modbus).

GET /stm.cgi?modbus_sensor=AB
  • A is index of Modbus slot 1-3, integer 0-2
  • B is a connected module, integer 0-9, 100-104

    {
        "0": "OFF",
        "1": "SDM120",
        "2": "SDM72D-M",
        "3": "RDO-PRO-X",
        "4": "Epever Tracer",
        "5": "Sofarsolar",
        "6": "GTIL",
        "7": "Danfos EKC 202C",
        "8": "SDM630/72D-v2", // added in HW 3.5+ SW 1.57
        "9": "CHINT-DTSU666", // added in HW 3.5+ SW 1.57
        "100": "custom1 (custom)",
        "101": "custom2 (custom)",
        "102": "custom3 (custom)",
        "103": "custom4 (custom)", // added in HW 3.5+ SW 1.57
        "104": "custom5 (custom)", // added in HW 3.5+ SW 1.57
    }
    

Example:

http://192.168.1.100/stm.cgi?modbus_sensor=00
GET /stm.cgi?modbus_sensor=A
  • A is a connected module, integer 0-7

    {
        "0": "OFF",
        "1": "SDM120",
        "2": "SDM72D-M",
        "3": "RDO-PRO-X",
        "4": "Epever Tracer",
        "5": "Sofarsolar",
        "6": "GTIL",
        "7": "Danfos EKC 202C",
    }
    

Example:

http://192.168.1.100/stm.cgi?modbus_sensor=0

/stm.cgi?modbusid

Only in HW 3.5+

Set the slave ID for the Modbus RTU sensor.

GET /stm.cgi?modbusid=AB
  • A is index of Modbus slot 1-3, integer 0-2
  • B is the ID, integer

Example:

http://192.168.1.100/stm.cgi?modbusid=01
GET /stm.cgi?modbusid=A
  • A is the ID, integer

Example:

http://192.168.1.100/stm.cgi?modbusid=1

/stm.cgi?modbusmapping

Added in HW 3.5+ SW 1.36

Set the mapping of Modbus and additional 1-Wire (since HW 3.5+ SW 1.57) readings to variables m1-m30, for use in HTTP client, MQTT client, OLED, VOLED, Power and Energy.

GET /stm.cgi?modbusmapping=A
  • A is a list of 30 pairs of slot number (integer 0-6, where 0 is inactive, 1-3 are Modbus modules, 4-6 are additional 1-Wire sensors) and reading number (integer 0-29)

Example:

http://192.168.1.100/stm.cgi?modbusmapping=10*11*12*13*14*15*16*17*18*00*00*00*00*00*00*00*00*00*00*00*00*00*00*00*00*00*00*00*00*00

/stm.cgi?mod_custom_set

Added in HW 3.5+ SW 1.36

Set the custom device name and communication parameters such as bitrate, parity bit and stop bit.

GET /stm.cgi?mod_custom_setA=B*C*D*E*F
  • A is a index of custom configuration, integer 0-4 (0-2 till HW 3.5+ SW 1.57)
  • B is a name, string
  • C is a bitrate, integer 0-5

    {
        "5": "4800", // added in SW 1.42b
        "0": "9600",
        "1": "19200",
        "2": "38400",
        "3": "57600",
        "4": "115200",
    }
    
  • D is a parity bit, integer 0-2

    {
        "0": "none",
        "1": "even",
        "2": "odd", // added in SW 1.57
    }
    
  • E is a stop bit, integer

  • F is delay between register reads, integer (when divided by 10 equals real value in seconds), added in SW 1.40

Example:

http://192.168.1.100/stm.cgi?mod_custom_set0=sdm72_custom*0*0*1*1

/post.cgi?mod_custom_save

Added in HW 3.5+ SW 1.36

Set the list of readings for a custom device, specifying name, unit, divisor, register address, function code, type for each.

POST /post.cgi?mod_custom_save

&mAB=C*D*E*F*G*H*I&mAB=C*D*E*F*G*H*I&mAB=C*D*E*F*G*H*I&mAB=C*D*E*F*G*H*I&mAB=C*D*E*F*G*H*I&&
  • A is a index of custom configuration, integer 0-4 (0-2 till HW 3.5+ SW 1.57)
  • B is a index of reading, integer 0-29
  • C is a name of reading, string
  • D is an unit, string
  • E is a divisor, integer 0-3 (1, 10, 100 till HW 3.5+ SW 1.49)

    {
        "0": "1",
        "1": "10",
        "2": "100",
        "3": "1000",
        "4": "10000", // added in HW 3.5+ SW 1.57
    }
    
  • F is a register address in decimal format, integer

  • G is a function code, integer 1-4

    {
        "1": "0x1",
        "2": "0x2",
        "3": "0x3",
        "4": "0x4",
    }
    
  • H is a type of variable, integer 0-2

    {
        "0": "int16",
        "1": "int32",
        "2": "float",
    }
    
  • I defines endian option, integer 0-3, added in SW 1.57

    {
        "0": "no swap",
        "1": "swap byte",
        "2": "swap word",
        "3": "swap byte and word",
    }
    

Example:

http://192.168.1.100/post.cgi?mod_custom_save

&m00=Total Power*W*2*52*4*2*0&m01=import*kWh*2*72*4*2*0&m02=export*kWh*2*74*4*2*0&m03=total energy*kwh*2*342*4*2*0&m04=set total ene*kwh*2*384*4*2*0&&

/stm.cgi?modbuson

Only in HW 3.5+

Enable the Modbus TCP Server.

GET /stm.cgi?modbuson=A
  • A determines whether the function is enabled, integer 0-1

Example:

http://192.168.1.100/stm.cgi?modbuson=0