class

Matter::Cluster::IlluminanceMeasurementCluster

Inherits Matter::Cluster::Base < Reference < Object

Illuminance Measurement Cluster (0x0400)

Provides an interface to illuminance measurement functionality, including configuration and provision of notifications of illuminance measurements.

Illuminance values are expressed using a logarithmic scale: MeasuredValue = 10,000 x log10(illuminance) + 1 where illuminance is in lux (lx).

Special values:

  • 0 indicates illuminance too low to measure
  • null indicates invalid measurement
  • Range: 1 lx to 3.576 Mlx (MeasuredValue: 1 to 0xFFFE)

Specification: Matter 1.4 § 2.2

Constants

ATTR_LIGHT_SENSOR_TYPE = 4_u32
ATTR_MAX_MEASURED_VALUE = 2_u32
ATTR_MEASURED_VALUE = 0_u32

Attributes

ATTR_MIN_MEASURED_VALUE = 1_u32
ATTR_TOLERANCE = 3_u32
CLUSTER_ID = 1024_u32
MAX_ILLUMINANCE = 65534_u16
MIN_ILLUMINANCE = 0_u16

Illuminance value limits

Constructors

new(endpoint_id : DataType::EndpointNumber, measured_value : UInt16 | Nil = nil, min_measured_value : UInt16 | Nil = nil, max_measured_value : UInt16 | Nil = nil, tolerance : UInt16 | Nil = nil, light_sensor_type : LightSensorType | Nil = nil)
Source

Class methods

cluster_id

Illuminance Measurement Cluster (0x0400)

Provides an interface to illuminance measurement functionality, including configuration and provision of notifications of illuminance measurements.

Illuminance values are expressed using a logarithmic scale: MeasuredValue = 10,000 x log10(illuminance) + 1 where illuminance is in lux (lx).

Special values:

  • 0 indicates illuminance too low to measure
  • null indicates invalid measurement
  • Range: 1 lx to 3.576 Mlx (MeasuredValue: 1 to 0xFFFE)

Specification: Matter 1.4 § 2.2

Source
from_lux(lux : Float64) : UInt16

Convert from lux (illuminance) to measured value Formula: MeasuredValue = 10,000 x log10(illuminance) + 1 Valid range: 1 lx to 3.576 Mlx

Source
to_lux(measured_value : UInt16) : Float64

Convert from measured value to lux (illuminance) Formula: illuminance = 10^((MeasuredValue - 1) / 10000)

Source

Instance methods

attributes

Get all attribute metadata

Source
commands

Get all command metadata

Source
light_sensor_type

Light sensor type, optional

Source
light_sensor_type=(light_sensor_type : LightSensorType | Nil)

Light sensor type, optional

Source
max_measured_value

Maximum measurable illuminance (or nil)

Source
max_measured_value=(max_measured_value : UInt16 | Nil)

Maximum measurable illuminance (or nil)

Source
measured_value

Current measured illuminance, or nil if unknown Value of 0 indicates too low to measure

Source
measured_value=(measured_value : UInt16 | Nil)

Current measured illuminance, or nil if unknown Value of 0 indicates too low to measure

Source
min_measured_value

Minimum measurable illuminance (1-65533, or nil)

Source
min_measured_value=(min_measured_value : UInt16 | Nil)

Minimum measurable illuminance (1-65533, or nil)

Source
name

Get cluster name

Source
on_illuminance_changed
Source
read_attribute(attribute_id : UInt32, fabric_index : UInt8 | Nil = nil) : Bytes | InteractionModel::Status

Read an attribute value The fabric_index parameter is optional and used for fabric-scoped attributes like CurrentFabricIndex in OperationalCredentialsCluster

Source
tolerance

Measurement tolerance (max 2048), optional

Source
tolerance=(tolerance : UInt16 | Nil)

Measurement tolerance (max 2048), optional

Source
update_illuminance(value : UInt16 | Nil)

Update the measured illuminance value

Source

Nested types