TemperatureMeasurement Cluster

Cluster ID: 0x0402  |  Endpoint: Typically on Endpoint 1+ (application endpoint)

TemperatureMeasurement is one of the simplest sensor Clusters — it has only 4 Attributes and no Commands. The device acts as a Server, passively reporting temperature data, while the App (Client) simply reads or subscribes. Commonly found on temperature/humidity sensors, thermostats, and HVAC panels.

Temperature Unit Pitfall: 0.01°C

All temperature Attribute values are in units of 0.01°C. A device returning 2550 means an actual temperature of 25.50°C; returning -500 means -5.00°C. You must divide by 100 before displaying, otherwise users will see "2550 degrees".

Meaning of null Values

MeasuredValue, MinMeasuredValue, and MaxMeasuredValue are all Nullable. A null return means the data is currently invalid or the sensor has not yet completed a measurement. The App should display "--" rather than 0.

Attribute Overview

TemperatureMeasurement has only four Attributes, of which MeasuredValue is the most commonly used. Click an Attribute ID to jump to its detailed description.

ID Name Type Access Description
0x00 MeasuredValue int16 Read-only Current temperature (unit: 0.01°C), Nullable
0x01 MinMeasuredValue int16 Read-only Minimum measurable temperature, Nullable
0x02 MaxMeasuredValue int16 Read-only Maximum measurable temperature, Nullable
0x03 Tolerance uint16 Read-only Measurement tolerance (unit: 0.01°C)

Attributes

MeasuredValue (Current Measured Temperature)

The most recently measured temperature from the sensor, in units of 0.01°C. This is the most important Attribute of the entire Cluster.

  • Type: int16 (signed, supports negative temperatures)
  • Range: -27315 (-273.15°C, absolute zero) to 32767 (327.67°C)
  • Nullable: null indicates the sensor data is invalid or the first measurement has not yet completed
  • Conversion: Actual temperature = MeasuredValue / 100
Common Values Quick Reference

0 = 0.00°C  |  2000 = 20.00°C  |  2550 = 25.50°C  |  3700 = 37.00°C  |  -1000 = -10.00°C

MinMeasuredValue (Minimum Measurable Temperature)

The lowest temperature the sensor can measure, in units of 0.01°C. The App can use this to set the lower bound of the temperature display range, or to determine whether the current reading has reached the minimum.

  • Type: int16, Nullable
  • Range: -27315 to MaxMeasuredValue - 1
  • Nullable: null indicates the device has not defined a lower limit

MaxMeasuredValue (Maximum Measurable Temperature)

The highest temperature the sensor can measure, in units of 0.01°C. When MeasuredValue approaches this upper limit, it may indicate the sensor has exceeded its normal operating range.

  • Type: int16, Nullable
  • Range: MinMeasuredValue + 1 to 32767
  • Nullable: null indicates the device has not defined an upper limit

Tolerance (Measurement Tolerance)

The measurement tolerance of the sensor, in units of 0.01°C. For example, a value of 50 means a measurement accuracy of ±0.50°C. This Attribute is optional and not all devices report it.

  • Type: uint16 (unsigned, tolerance cannot be negative)
  • Range: 0 to 2048 (i.e., 0 to ±20.48°C)
Practical Use of Tolerance

If the sensor reports MeasuredValue = 2550 (25.50°C) and Tolerance = 50 (±0.50°C), the actual temperature is between 25.00°C and 26.00°C. When setting up temperature threshold automations, you should factor in the tolerance to avoid frequent triggering near the threshold.

Commands

TemperatureMeasurement is a read-only Server Cluster with no Commands. The device is responsible for collecting temperature data and updating Attributes; the App only needs to Read or Subscribe to obtain data.

Example Data

Reading the TemperatureMeasurement Cluster Attributes from a temperature/humidity sensor:

{
  // --- TemperatureMeasurement Cluster (Endpoint 1) ---
  "0x0": 2550,       // MeasuredValue = 2550 → actual 25.50°C
  "0x1": -1000,      // MinMeasuredValue = -1000 → actual -10.00°C
  "0x2": 6000,       // MaxMeasuredValue = 6000 → actual 60.00°C
  "0x3": 50          // Tolerance = 50 → actual ±0.50°C
}

Read request example — retrieve all Cluster Attributes at once:

{
  // Read all Attributes of the temperature sensor
  "readRequests": [{
    "attributePath": {
      "endpointId": 1,
      "clusterId": "0x0402"
      // No attributeId specified → read all Attributes of this Cluster
    }
  }]
}

Subscribe to temperature changes — track temperature updates in real time:

{
  // Subscribe to temperature changes (report every 30 seconds to 5 minutes)
  "subscribeRequests": [{
    "attributePath": {
      "endpointId": 1,
      "clusterId": "0x0402",
      "attributeId": "0x00"        // MeasuredValue
    },
    "minIntervalFloor": 30,        // Report at least every 30 seconds
    "maxIntervalCeiling": 300      // Report at most every 5 minutes
  }]
}
Temperature Conversion Code Reference

Key logic for processing device return values:

{`// Device returns MeasuredValue = 2550
val rawValue: Int? = 2550    // Nullable, may be null
val tempCelsius = rawValue?.let { it / 100.0 }  // → 25.50°C
val tempFahrenheit = tempCelsius?.let { it * 9.0 / 5.0 + 32 }  // → 77.90°F

// Handle null when displaying
val display = tempCelsius?.let { String.format("%.1f°C", it) } ?: "--"`}

Common Scenarios

Scenario 1: Reading the Current Temperature
  1. Read MeasuredValue (0x00) — first check whether it is null
  2. Divide by 100 to convert to Celsius: 2550 → 25.50°C
  3. If Fahrenheit is needed, apply another conversion: °F = °C × 9/5 + 32
  4. Optional: Read Tolerance (0x03) to assess data reliability
Scenario 2: Displaying a Temperature Card on the App Home Screen
  1. Subscribe to MeasuredValue (0x00) with a reasonable reporting interval (e.g., 30 seconds to 5 minutes)
  2. Divide the received value by 100 and display with one decimal place (e.g., 25.5°C)
  3. Handle null values — display "--" or "Sensor offline", do not show 0°C
  4. Optional: Read MinMeasuredValue / MaxMeasuredValue to determine the sensor range and alert on anomalies
Scenario 3: Temperature Threshold Automation
  1. Subscribe to MeasuredValue (0x00) to continuously monitor temperature changes
  2. Factor in Tolerance when setting thresholds — if tolerance is ±0.5°C and the threshold is set to 30°C, the actual trigger range is 29.5°C to 30.5°C
  3. Add debounce logic: when temperature fluctuates near the threshold, require N consecutive readings above the threshold before triggering, to avoid frequently toggling AC/fans
  4. Combine with the Thermostat Cluster (0x0201) for closed-loop control: the temperature sensor reports room temperature, the thermostat adjusts the setpoint