class Matter::Cluster::OccupancySensingCluster

Overview

Occupancy Sensing Cluster (0x0406)

Provides an interface to occupancy sensing functionality based on various sensing modalities (PIR, Ultrasonic, Physical Contact, etc.), including configuration and provision of notifications of occupancy status.

This implementation supports PIR (Passive Infrared) sensing.

Specification: Matter 1.4 § 2.7

Defined in:

matter/cluster/occupancy_sensing_cluster.cr

Constant Summary

ATTR_HOLD_TIME = 3_u32
ATTR_OCCUPANCY = 0_u32

Attributes

ATTR_OCCUPANCY_SENSOR_TYPE = 1_u32
ATTR_OCCUPANCY_SENSOR_TYPE_BITMAP = 2_u32
ATTR_PIR_OCCUPIED_TO_UNOCCUPIED_DELAY = 16_u32
ATTR_PIR_UNOCCUPIED_TO_OCCUPIED_DELAY = 17_u32
ATTR_PIR_UNOCCUPIED_TO_OCCUPIED_THRESH = 18_u32
CLUSTER_ID = 1030_u32
OCCUPANCY_OCCUPIED = 1_u8

Occupancy bitmap (bit 0 = occupied)

Constructors

Class Method Summary

Instance Method Summary

Instance methods inherited from class Matter::Cluster::Base

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)) : InteractionModel::Status | Bytes invoke_command, name : String name, read_attribute(attribute_id : UInt32) : InteractionModel::Status | Bytes read_attribute, 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

def self.new(endpoint_id : DataType::EndpointNumber, occupancy : UInt8 = 0_u8, occupancy_sensor_type : OccupancySensorType = OccupancySensorType::PIR, occupancy_sensor_type_bitmap : UInt8 = 1_u8, hold_time : UInt16 | Nil = nil, pir_occupied_to_unoccupied_delay : UInt16 | Nil = nil, pir_unoccupied_to_occupied_delay : UInt16 | Nil = nil, pir_unoccupied_to_occupied_threshold : UInt8 | Nil = nil) #

[View source]

Class Method Detail

def self.cluster_id #

Occupancy Sensing Cluster (0x0406)

Provides an interface to occupancy sensing functionality based on various sensing modalities (PIR, Ultrasonic, Physical Contact, etc.), including configuration and provision of notifications of occupancy status.

This implementation supports PIR (Passive Infrared) sensing.

Specification: Matter 1.4 § 2.7


[View source]

Instance Method Detail

def attributes : Array(AttributeMetadata) #
Description copied from class Matter::Cluster::Base

Get all attribute metadata


[View source]
def commands : Array(CommandMetadata) #
Description copied from class Matter::Cluster::Base

Get all command metadata


[View source]
def hold_time : UInt16 | Nil #

Hold time in seconds (optional, writable)


[View source]
def hold_time=(hold_time : UInt16 | Nil) #

Hold time in seconds (optional, writable)


[View source]
def name : String #
Description copied from class Matter::Cluster::Base

Get cluster name


[View source]
def occupancy : UInt8 #

Current occupancy state (bitmap, bit 0 = occupied)


[View source]
def occupancy=(occupancy : UInt8) #

Current occupancy state (bitmap, bit 0 = occupied)


[View source]
def occupancy_sensor_type : OccupancySensorType #

Sensor type (fixed)


[View source]
def occupancy_sensor_type=(occupancy_sensor_type : OccupancySensorType) #

Sensor type (fixed)


[View source]
def occupancy_sensor_type_bitmap : UInt8 #

Sensor type bitmap (bit 0 = PIR)


[View source]
def occupancy_sensor_type_bitmap=(occupancy_sensor_type_bitmap : UInt8) #

Sensor type bitmap (bit 0 = PIR)


[View source]
def occupied? : Bool #

Check if currently occupied


[View source]
def on_occupancy_changed(&block : UInt8, UInt8 -> Nil) #

[View source]
def pir_occupied_to_unoccupied_delay : UInt16 | Nil #

PIR-specific attributes (optional, writable)


[View source]
def pir_occupied_to_unoccupied_delay=(pir_occupied_to_unoccupied_delay : UInt16 | Nil) #

PIR-specific attributes (optional, writable)


[View source]
def pir_unoccupied_to_occupied_delay : UInt16 | Nil #

[View source]
def pir_unoccupied_to_occupied_delay=(pir_unoccupied_to_occupied_delay : UInt16 | Nil) #

[View source]
def pir_unoccupied_to_occupied_threshold : UInt8 | Nil #

[View source]
def pir_unoccupied_to_occupied_threshold=(pir_unoccupied_to_occupied_threshold : UInt8 | Nil) #

[View source]
def read_attribute(attribute_id : UInt32) : Bytes | InteractionModel::Status #
Description copied from class Matter::Cluster::Base

Read an attribute value


[View source]
def update_occupancy(occupied : Bool) #

Update the occupancy state


[View source]