class

Matter::Cluster::OnOffCluster

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

On/Off Cluster Implementation (0x0006) Provides binary on/off control with optional lighting and timing features

Features:

  • Lighting (LT): Enables level control interaction and global scene management
  • DeadFrontBehavior (DF): Device exhibits "dead front" when off
  • OffOnly: Device can only be turned off (On/Toggle not supported)

Matter Spec: Application Clusters 1.5

Constants

ACCEPTED_COMMAND_LIST = 65529_u32
ATTR_GLOBAL_SCENE_CONTROL = 16384_u32
ATTR_OFF_WAIT_TIME = 16386_u32
ATTR_ON_OFF = 0_u32

Attribute IDs

ATTR_ON_TIME = 16385_u32
ATTR_START_UP_ON_OFF = 16387_u32
ATTRIBUTE_LIST = 65531_u32
CLUSTER_ID = 6_u32
CLUSTER_REVISION = 65533_u32

Global attributes

CMD_OFF = 0_u32

Command IDs

CMD_OFF_WITH_EFFECT = 64_u32
CMD_ON = 1_u32
CMD_ON_WITH_RECALL_GLOBAL_SCENE = 65_u32
CMD_ON_WITH_TIMED_OFF = 66_u32
CMD_TOGGLE = 2_u32
FEATURE_MAP = 65532_u32
GENERATED_COMMAND_LIST = 65528_u32

Constructors

new(endpoint_id : DataType::EndpointNumber, on_off : Bool = false, feature_map : Feature = Feature::None)
Source

Class methods

cluster_id

On/Off Cluster Implementation (0x0006) Provides binary on/off control with optional lighting and timing features

Features:

  • Lighting (LT): Enables level control interaction and global scene management
  • DeadFrontBehavior (DF): Device exhibits "dead front" when off
  • OffOnly: Device can only be turned off (On/Toggle not supported)

Matter Spec: Application Clusters 1.5

Source

Instance methods

apply_scene_extension_field_set(field_set : ScenesManagementCluster::ExtensionFieldSet) : Bool
Source
attributes

Get all attribute metadata

Source
commands

Get all command metadata

Source
feature_map
Source
feature_map=(feature_map : Feature)
Source
global_scene_control=(global_scene_control : Bool)

Lighting feature attributes

Source
global_scene_control?

Lighting feature attributes

Source
name

Get cluster name

Source
off?
Source
off_wait_time
Source
off_wait_time=(off_wait_time : UInt16)
Source
on=(state : Bool) : Bool
Source
on_off=(on_off : Bool)

State

Source
on_off?

State

Source
on_state_changed

Set callback for state changes

Source
on_time
Source
on_time=(on_time : UInt16)
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
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_on_off
Source
start_up_on_off=(start_up_on_off : StartUpOnOff | Nil)
Source
store_scene_extension_field_set

ScenesManagement extension field sets

Source
toggle
Source
write_attribute(attribute_id : UInt32, value : Bytes) : InteractionModel::Status

Write an attribute value

Source

Nested types