IlluminanceMeasurement Cluster

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

IlluminanceMeasurement reports the ambient light intensity (in lux). This is a read-only Server Cluster — it has no Commands, only 5 Attributes. Commonly found on light sensors, multi-function environmental sensors, and smart curtain controllers.

Key Pitfall: Logarithmic Scale, Not Linear

MeasuredValue is not the direct lux value, but an integer after logarithmic transformation:

MeasuredValue = 10000 × log10(lux) + 1

Reverse conversion (the App must perform this):

lux = 10(MeasuredValue - 1) / 10000

For example, a device returning 10001 means an actual illuminance of 10 lux, not over ten thousand lux. Displaying the raw value would mislead users into thinking the brightness is extremely high. You must apply the logarithmic reverse conversion before displaying.

Common MeasuredValue Quick Reference

1 = 1 lux (moonlight)  |  10001 = 10 lux (dim hallway)  |  20001 = 100 lux (typical indoor)  |  30001 = 1000 lux (overcast outdoor)  |  40001 = 10000 lux (sunny outdoor)

A value of 0 means the illuminance is below the sensor's measurable minimum; null means the sensor has not completed a measurement or the data is invalid — the App should display "--".

Attribute Overview

IlluminanceMeasurement has 5 Attributes, of which MeasuredValue is the most important. Click an Attribute ID to jump to its detailed description.

ID Name Type Access Description
0x00 MeasuredValue uint16 / null Read-only Current illuminance (logarithmic scale), Nullable
0x01 MinMeasuredValue uint16 / null Read-only Minimum measurable illuminance, Nullable
0x02 MaxMeasuredValue uint16 / null Read-only Maximum measurable illuminance, Nullable
0x03 Tolerance uint16 Read-only Measurement tolerance (logarithmic scale)
0x04 LightSensorType enum8 / null Read-only Sensor type, Nullable

Attributes

MeasuredValue (Current Illuminance)

The most recently measured light intensity from the sensor, encoded on a logarithmic scale. This is the most important Attribute of the entire Cluster.

  • Type: uint16, Nullable
  • Valid range: 1 to 65534 (corresponding to approximately 1 lux to 3.5 × 106 lux)
  • Special values: 0 = illuminance below the measurable minimum; null = data invalid or measurement not completed
  • Conversion: lux = 10(MeasuredValue - 1) / 10000
Conversion Code Reference
{`// Device returns MeasuredValue
val rawValue: Int? = 10001    // Nullable, may be null
val lux = when {
    rawValue == null -> null           // Sensor not ready
    rawValue == 0    -> 0.0            // Below measurable minimum
    else -> Math.pow(10.0, (rawValue - 1).toDouble() / 10000.0)
}
// rawValue = 10001 → lux = 10.0
// rawValue = 20001 → lux = 100.0
// rawValue = 30001 → lux = 1000.0

// Handle null and precision when displaying
val display = lux?.let { String.format("%.0f lux", it) } ?: "--"`}

MinMeasuredValue (Minimum Measurable Illuminance)

The minimum illuminance value the sensor can measure (logarithmic scale encoded). When MeasuredValue is 0, it indicates the actual illuminance is below this lower limit.

  • Type: uint16, Nullable
  • Range: 1 to 65533
  • Nullable: null indicates the device has not defined a lower limit

MaxMeasuredValue (Maximum Measurable Illuminance)

The maximum illuminance value the sensor can measure (logarithmic scale encoded). MeasuredValue will not exceed this value.

  • Type: uint16, Nullable
  • Range: 2 to 65534, and must be greater than MinMeasuredValue
  • Nullable: null indicates the device has not defined an upper limit

Tolerance (Measurement Tolerance)

The measurement tolerance of the sensor, also on a logarithmic scale. This is an optional Attribute and not all devices report it.

  • Type: uint16 (unsigned)
  • Range: 0 to 2048

LightSensorType (Sensor Type)

Describes the type of light sensor used by the device. Different sensor types have varying spectral responses and sensitivities. A value of null indicates the sensor type is unknown.

LightSensorTypeEnum Enum Values

0
Photodiode Photodiode — fast response, good linearity, commonly found in professional lux meters
1
CMOS CMOS image sensor — low cost, high integration, commonly found in multi-function sensors
null
Unknown Sensor type unknown

Commands

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

Example Data

Reading the IlluminanceMeasurement Cluster Attributes from a light sensor:

{
  // --- IlluminanceMeasurement Cluster (Endpoint 1) ---
  "0x0":  10001,       // MeasuredValue = 10001 → 10 lux (typical hallway illuminance)
  "0x1":  1,           // MinMeasuredValue = 1 → 1 lux
  "0x2":  50001,       // MaxMeasuredValue = 50001 → 100000 lux
  "0x3":  0,           // Tolerance = 0 (tolerance not reported)
  "0x4":  0            // LightSensorType = Photodiode
}

Subscribe to illuminance changes — track light level updates in real time:

{
  // Subscribe to illuminance changes (report every 10 seconds to 2 minutes)
  "subscribeRequests": [{
    "attributePath": {
      "endpointId": 1,
      "clusterId": "0x0400",
      "attributeId": "0x00"        // MeasuredValue
    },
    "minIntervalFloor": 10,        // Report at least every 10 seconds
    "maxIntervalCeiling": 120      // Report at most every 2 minutes
  }]
}

Common Scenarios

Scenario 1: Reading and Displaying Current Illuminance
  1. Read MeasuredValue (0x00), checking for null (sensor not ready) and 0 (below measurable minimum)
  2. Apply logarithmic reverse conversion: lux = 10(MeasuredValue - 1) / 10000
  3. Choose an appropriate display unit based on the lux value — below 1000, show as an integer (e.g., "320 lux"); above 1000, consider using "klux" (e.g., "12.5 klux")
  4. Optional: Read LightSensorType (0x04) to display the sensor type on the device detail page
Scenario 2: Automatic Curtain / Lighting Automation
  1. Subscribe to MeasuredValue (0x00) to continuously monitor illuminance changes
  2. Set thresholds — e.g., automatically turn on lights when below 100 lux (corresponding to MeasuredValue ≈ 20001), and turn off when above 500 lux (corresponding to ≈ 26990)
  3. Add hysteresis — separate the on/off thresholds to avoid repeated toggling caused by intermittent cloud cover on overcast days
  4. Combine with OccupancySensing Cluster (0x0406): only respond to illuminance changes when occupied, keep lights off when unoccupied
Scenario 3: Daylight Statistics and Energy Analysis
  1. Periodically sample MeasuredValue (e.g., every 5 minutes), convert to lux, and store
  2. Generate daily illuminance curves — useful for determining room orientation and shading effectiveness
  3. Combine with dimming records from LevelControl Cluster (0x0008) to analyze natural light utilization and optimize lighting strategy
  4. The logarithmic scale is naturally suited for wide-range illuminance recording — from moonlight (1 lux) to direct sunlight (100000 lux) with precise representation