class
Matter::Cluster::OnOffCluster
- Matter::Cluster::OnOffCluster
- Matter::Cluster::Base
- Reference
- Object
Overview
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
Defined in:
matter/cluster/on_off_cluster.crConstant Summary
-
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
Class Method Summary
-
.cluster_id
On/Off Cluster Implementation (0x0006) Provides binary on/off control with optional lighting and timing features
Instance Method Summary
- #apply_scene_extension_field_set(field_set : ScenesManagementCluster::ExtensionFieldSet) : Bool
-
#attributes : Array(AttributeMetadata)
Get all attribute metadata
-
#commands : Array(CommandMetadata)
Get all command metadata
- #feature_map : Feature
- #feature_map=(feature_map : Feature)
-
#global_scene_control=(global_scene_control : Bool)
Lighting feature attributes
-
#global_scene_control? : Bool
Lighting feature attributes
-
#name : String
Get cluster name
- #off? : Bool
- #off_wait_time : UInt16
- #off_wait_time=(off_wait_time : UInt16)
- #on=(state : Bool) : Bool
- #on? : Bool
-
#on_off=(on_off : Bool)
State
-
#on_off? : Bool
State
-
#on_state_changed(&block : Bool -> Nil)
Set callback for state changes
- #on_time : UInt16
- #on_time=(on_time : UInt16)
-
#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
-
#restore_state(json : String) : Nil
Restore cluster state from JSON.
-
#save_state : String | Nil
Save cluster state to JSON for persistence.
- #start_up_on_off : StartUpOnOff | Nil
- #start_up_on_off=(start_up_on_off : StartUpOnOff | Nil)
-
#store_scene_extension_field_set : ScenesManagementCluster::ExtensionFieldSet | Nil
------------------------------------------------------------------------ ScenesManagement extension field sets ------------------------------------------------------------------------
- #toggle : Bool
-
#write_attribute(attribute_id : UInt32, value : Bytes) : InteractionModel::Status
Write an attribute value
Instance methods inherited from class Matter::Cluster::Base
apply_scene_extension_field_set(field_set : ScenesManagementCluster::ExtensionFieldSet) : Bool
apply_scene_extension_field_set,
attributes : Array(AttributeMetadata)
attributes,
cluster_id : DataType::ClusterId
cluster_id,
cluster_id=(cluster_id : DataType::ClusterId)
cluster_id=,
commands : Array(CommandMetadata)
commands,
data_version : UInt32
data_version,
data_version=(data_version : UInt32)
data_version=,
endpoint_id : DataType::EndpointNumber
endpoint_id,
endpoint_id=(endpoint_id : DataType::EndpointNumber)
endpoint_id=,
events : Array(EventMetadata)
events,
get_attribute_metadata(attribute_id : UInt32) : AttributeMetadata | Nil
get_attribute_metadata,
get_command_metadata(command_id : UInt32) : CommandMetadata | Nil
get_command_metadata,
invoke_command(command_id : UInt32, fields : Bytes = Bytes.new(0), session_id : UInt64 | Nil = nil, is_case_session : Bool = false, fabric_index : UInt8 | Nil = nil) : InteractionModel::Status | CommandResponse
invoke_command,
name : String
name,
on_attribute_changed : Proc(UInt16, UInt32, UInt32, Nil) | Nil
on_attribute_changed,
on_attribute_changed=(on_attribute_changed : Proc(UInt16, UInt32, UInt32, Nil) | Nil)
on_attribute_changed=,
persistence_key : String
persistence_key,
read_attribute(attribute_id : UInt32, fabric_index : UInt8 | Nil = nil) : InteractionModel::Status | Bytes
read_attribute,
request_fabric_index : UInt8 | Nil
request_fabric_index,
request_fabric_index=(request_fabric_index : UInt8 | Nil)
request_fabric_index=,
request_is_case_session=(request_is_case_session : Bool)
request_is_case_session=,
request_is_case_session? : Bool
request_is_case_session?,
request_peer_node_id : UInt64 | Nil
request_peer_node_id,
request_peer_node_id=(request_peer_node_id : UInt64 | Nil)
request_peer_node_id=,
request_session_id : UInt64 | Nil
request_session_id,
request_session_id=(request_session_id : UInt64 | Nil)
request_session_id=,
restore_state(json : String) : Nil
restore_state,
save_state : String | Nil
save_state,
store_scene_extension_field_set : ScenesManagementCluster::ExtensionFieldSet | Nil
store_scene_extension_field_set,
write_attribute(attribute_id : UInt32, value : Bytes) : InteractionModel::Status
write_attribute
Constructor methods inherited from class Matter::Cluster::Base
new(endpoint_id : DataType::EndpointNumber, cluster_id : DataType::ClusterId)
new
Constructor Detail
Class Method Detail
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
Instance Method Detail
Get all attribute metadata
Get all command metadata
Read an attribute value The fabric_index parameter is optional and used for fabric-scoped attributes like CurrentFabricIndex in OperationalCredentialsCluster
Restore cluster state from JSON. Override in subclasses that need to restore state. The json parameter is the string returned by 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.
Write an attribute value