Skip to content

I2C and 1-Wire sensors

/stm.cgi?dswrite

Read or set DS ID depending on parameters.

To read subsequent IDs to variable <--#dsid-->, which can be find under key dsid in /json/dsi2c.json:

GET /stm.cgi?dswrite=0

To set DS ID on chosen position:

GET /stm.cgi?dswrite=A:B
  • A determines for which position the ID is set, integer 1-8 (DS1-DS8)
  • B is the ID to set, string (in form of XX:XX:XX:XX:XX:XX:XX:XX, where X is 0-9, A-F)

Example:

http://192.168.1.100/stm.cgi?dswrite=1:0:0:0:0:0:0:0:0

/stm.cgi?dsOffset

Set offset of DS reading. The value that will be added to the original reading so that multiple readings can be calibrated.

```h

GET /stm.cgi?dsOffset=A:B - `A` determines for which position the offset is set, integer `1-8` (*DS1-DS8*) - `B` is the offset value to set, integer (value multiplied by 10) Example:h http://192.168.1.100/stm.cgi?dsOffset1=10 ```

/stm.cgi?i2csensors

Set up the I2C sensors.

GET /stm.cgi?i2csensors=A
  • A determines which sensors are selected, integer 1-222 (sum of values for SPS30, SCD40 and one of the others)

    {
        "1": "NONE",
        "2": "BME280",
        "4": "AM2320",
        "8": "HTS221",
        "16": "SPS30",
        "32": "BME680", // added in SW 1.40
        "64": "AM2301B/AHT25/AHT20", // added in SW 1.47
        "128": "SCD40", // added in SW 1.57
    }
    

Example:

# NONE (1)
http://192.168.1.100/stm.cgi?i2csensors=1
# BME680 + SPS30 (32 + 16 = 48)
http://192.168.1.100/stm.cgi?i2csensors=48

/stm.cgi?i2csfreq

Set the communication frequency with the I2C sensor.

GET /stm.cgi?i2csfreq=A
  • A is the frequency in kHz, integer 5-100

Example:

http://192.168.1.100/stm.cgi?i2csfreq=20

/stm.cgi?onewirename

Added in HW 3.5+ SW 1.57

Set the reading name for custom 1Wire sensor.

GET /stm.cgi?onewirenameAB=C
  • A is the sensor number 0-2
  • B is the reading number 0-2
  • C is reading name, string up to 15 chars

Example:

http://192.168.1.100/stm.cgi?onewirename10=co2

/stm.cgi?onewirereadid=0

Added in HW 3.5+ SW 1.57

Read ID of custom 1Wire sensor.

GET /stm.cgi?onewirereadid=0

Example:

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

/stm.cgi?onewireid

Added in HW 3.5+ SW 1.57

Set ID of custom 1Wire sensor.

GET /stm.cgi?onewireidA=B
  • A is the sensor number 0-2
  • B is the ID to set, string (in form of XX:XX:XX:XX:XX:XX:XX:XX, where X is 0-9, A-F)

Example:

http://192.168.1.100/stm.cgi?onewireid0=56:DE:69:0:0:0:0:87

/stm.cgi?onewiresensor

Added in HW 3.5+ SW 1.57

Set the 1Wire sensor type on the desired position.

GET /stm.cgi?onewiresensorA=B
  • A is the sensor number 0-2
  • B is the sensor type, integer 0-1 (none or SCD40)

Example:

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