class

Matter::Cluster::LevelControlCluster

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

Level Control Cluster Implementation (0x0008)

Provides level control (dimming) functionality for lights, volume controls, blinds, and other devices with adjustable levels.

Features:

  • OnOff (OO): Dependency with the On/Off cluster
  • Lighting (LT): Lighting control interface (affects level semantics)
  • Frequency (FQ): Frequency control support (provisional)

Matter Spec: Application 1.6

Constants

ATTR_CURRENT_FREQUENCY = 4_u32
ATTR_CURRENT_LEVEL = 0_u32

Attributes

ATTR_DEFAULT_MOVE_RATE = 20_u32
ATTR_MAX_FREQUENCY = 6_u32
ATTR_MAX_LEVEL = 3_u32
ATTR_MIN_FREQUENCY = 5_u32
ATTR_MIN_LEVEL = 2_u32
ATTR_OFF_TRANSITION_TIME = 19_u32
ATTR_ON_LEVEL = 17_u32
ATTR_ON_OFF_TRANSITION_TIME = 16_u32
ATTR_ON_TRANSITION_TIME = 18_u32
ATTR_OPTIONS = 15_u32
ATTR_REMAINING_TIME = 1_u32
ATTR_START_UP_CURRENT_LEVEL = 16384_u32
CLUSTER_ID = 8_u32
CLUSTER_REVISION = 65533_u32

Global attributes

CMD_MOVE = 1_u32
CMD_MOVE_TO_CLOSEST_FREQUENCY = 8_u32
CMD_MOVE_TO_LEVEL = 0_u32

Commands

CMD_MOVE_TO_LEVEL_WITH_ON_OFF = 4_u32
CMD_MOVE_WITH_ON_OFF = 5_u32
CMD_STEP = 2_u32
CMD_STEP_WITH_ON_OFF = 6_u32
CMD_STOP = 3_u32
CMD_STOP_WITH_ON_OFF = 7_u32
FEATURE_MAP = 65532_u32
Log = ::Log.for("matter.cluster.level_control")

Constructors

new(endpoint_id : DataType::EndpointNumber, current_level : UInt8 = 0_u8, min_level : UInt8 = 0_u8, max_level : UInt8 = 254_u8, on_level : UInt8 | Nil = nil, options : UInt8 = 0_u8, feature_map : Feature = Feature::OnOff | Feature::Lighting)
Source

Class methods

cluster_id

Level Control Cluster Implementation (0x0008)

Provides level control (dimming) functionality for lights, volume controls, blinds, and other devices with adjustable levels.

Features:

  • OnOff (OO): Dependency with the On/Off cluster
  • Lighting (LT): Lighting control interface (affects level semantics)
  • Frequency (FQ): Frequency control support (provisional)

Matter Spec: Application 1.6

Source

Instance methods

attributes

Get all attribute metadata

Source
commands

Get all command metadata

Source
current_frequency

Frequency feature attributes

Source
current_frequency=(current_frequency : UInt16)

Frequency feature attributes

Source
current_level

Base attributes

Source
current_level=(current_level : UInt8)

Base attributes

Source
default_move_rate
Source
default_move_rate=(default_move_rate : UInt8 | Nil)
Source
feature_map

Feature map

Source
feature_map=(feature_map : Feature)

Feature map

Source
level=(level : UInt8) : UInt8
Source
level=(level : Float)

level as a percentage 0.0 - 100.0

Source
max_frequency
Source
max_frequency=(max_frequency : UInt16)
Source
max_level
Source
max_level=(max_level : UInt8)
Source
min_frequency
Source
min_frequency=(min_frequency : UInt16)
Source
min_level
Source
min_level=(min_level : UInt8)
Source
name

Get cluster name

Source
off_transition_time
Source
off_transition_time=(off_transition_time : UInt16 | Nil)
Source
on_level
Source
on_level=(on_level : UInt8 | Nil)
Source
on_level_changed

Set callback for level changes

Source
on_off_transition_time
Source
on_off_transition_time=(on_off_transition_time : UInt16)
Source
on_transition_time
Source
on_transition_time=(on_transition_time : UInt16 | Nil)
Source
options
Source
options=(options : UInt8)
Source
read_attribute(attribute_id : UInt32, fabric_index : UInt8 | Nil = nil) : InteractionModel::Status | Bytes

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

Source
remaining_time

Lighting feature attributes

Source
remaining_time=(remaining_time : UInt16)

Lighting feature attributes

Source
restore_state(json : String) : Nil

Restore cluster state from JSON. Override in subclasses that need to restore state. The json parameter is the string returned by save_state.

Source
save_state

Save cluster state to JSON for persistence. Override in subclasses that need to persist state (e.g., scenes, groups). Returns nil if no state needs to be persisted.

Source
start_up_current_level
Source
start_up_current_level=(start_up_current_level : UInt8 | Nil)
Source
write_attribute(attribute_id : UInt32, value : Bytes) : InteractionModel::Status

Write an attribute value

Source

Nested types