Skip to content

Sensor Readings

This page explains one SensorState item inside peripherals.sensors.

SensorState Schema

FieldTypeRequiredDescription
indexintegerYesSensor interface or channel index, starting from 1
typestringYesType code. Current enum values: TEMP, HUMI
valuenumberNoCurrent value
unitstringYesMeasurement unit, for example C or %
statusstringYesSensor status. Enum: ONLINE, OFFLINE

Sensor type Enum

ValueDescription
TEMPTemperature
HUMIHumidity

Sensor status Enum

ValueDescription
ONLINESensor is online
OFFLINESensor is offline

Notes:

  • A single sensor interface may return multiple readings at the same index.
  • Use index + type to identify one sensor reading.
  • When the sensor is offline, value may be omitted.

Examples

Single-temperature sensor:

json
[
  {
    "index": 1,
    "type": "TEMP",
    "value": 30.4,
    "unit": "C",
    "status": "ONLINE"
  }
]

Temperature-humidity sensor:

json
[
  {
    "index": 2,
    "type": "TEMP",
    "value": 32.6,
    "unit": "C",
    "status": "ONLINE"
  },
  {
    "index": 2,
    "type": "HUMI",
    "value": 54,
    "unit": "%",
    "status": "ONLINE"
  }
]

Offline sensor:

json
[
  {
    "index": 1,
    "type": "TEMP",
    "unit": "C",
    "status": "OFFLINE"
  }
]
Docs buildVersion v1.2.19-20260602-174859-60
Copyright © 2026 WLTE