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.

Features:

Specification: Matter 1.4 § 2.7

Defined in:

matter/cluster/occupancy_sensing_cluster.cr

Constant Summary

ATTR_HOLD_TIME = 3_u32

Attributes - Optional (all features)

ATTR_OCCUPANCY = 0_u32

Attributes - Required

ATTR_OCCUPANCY_SENSOR_TYPE = 1_u32
ATTR_OCCUPANCY_SENSOR_TYPE_BITMAP = 2_u32
ATTR_PHYSICAL_CONTACT_OCCUPIED_TO_UNOCCUPIED_DELAY = 48_u32

Attributes - PhysicalContact feature

ATTR_PHYSICAL_CONTACT_UNOCCUPIED_TO_OCCUPIED_DELAY = 49_u32
ATTR_PHYSICAL_CONTACT_UNOCCUPIED_TO_OCCUPIED_THRESH = 50_u32
ATTR_PIR_OCCUPIED_TO_UNOCCUPIED_DELAY = 16_u32

Attributes - PIR feature

ATTR_PIR_UNOCCUPIED_TO_OCCUPIED_DELAY = 17_u32
ATTR_PIR_UNOCCUPIED_TO_OCCUPIED_THRESH = 18_u32
ATTR_ULTRASONIC_OCCUPIED_TO_UNOCCUPIED_DELAY = 32_u32

Attributes - Ultrasonic feature

ATTR_ULTRASONIC_UNOCCUPIED_TO_OCCUPIED_DELAY = 33_u32
ATTR_ULTRASONIC_UNOCCUPIED_TO_OCCUPIED_THRESH = 34_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), 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=, read_attribute(attribute_id : UInt32, fabric_index : UInt8 | Nil = nil) : 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, feature_map : Feature = Feature::PassiveInfrared, 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, ultrasonic_occupied_to_unoccupied_delay : UInt16 | Nil = nil, ultrasonic_unoccupied_to_occupied_delay : UInt16 | Nil = nil, ultrasonic_unoccupied_to_occupied_threshold : UInt8 | Nil = nil, physical_contact_occupied_to_unoccupied_delay : UInt16 | Nil = nil, physical_contact_unoccupied_to_occupied_delay : UInt16 | Nil = nil, physical_contact_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.

Features:

  • Other (OTHER): Other sensing modality
  • PassiveInfrared (PIR): PIR sensing
  • Ultrasonic (US): Ultrasonic sensing
  • PhysicalContact (PHY): Physical contact sensing
  • ActiveInfrared (AIR): Active IR sensing
  • Radar (RADAR): Radar/microwave sensing
  • RfSensing (RFSENS): RF signal analysis
  • Vision (VIS): Vision-based 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 feature_map : Feature #

Feature map


[View source]
def feature_map=(feature_map : Feature) #

Feature map


[View source]
def hold_time : UInt16 | Nil #

Optional attribute (all features)


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

Optional attribute (all features)


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

Get cluster name


[View source]
def occupancy : UInt8 #

Required attributes


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

Required attributes


[View source]
def occupancy_sensor_type : OccupancySensorType #

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

[View source]
def occupancy_sensor_type_bitmap : UInt8 #

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

[View source]
def occupied? : Bool #

Check if currently occupied


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

[View source]
def physical_contact_occupied_to_unoccupied_delay : UInt16 | Nil #

PhysicalContact-specific attributes (PhysicalContact feature)


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

PhysicalContact-specific attributes (PhysicalContact feature)


[View source]
def physical_contact_unoccupied_to_occupied_delay : UInt16 | Nil #

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

[View source]
def physical_contact_unoccupied_to_occupied_threshold : UInt8 | Nil #

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

[View source]
def pir_occupied_to_unoccupied_delay : UInt16 | Nil #

PIR-specific attributes (PassiveInfrared feature)


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

PIR-specific attributes (PassiveInfrared feature)


[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, fabric_index : UInt8 | Nil = nil) : Bytes | InteractionModel::Status #
Description copied from class Matter::Cluster::Base

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


[View source]
def ultrasonic_occupied_to_unoccupied_delay : UInt16 | Nil #

Ultrasonic-specific attributes (Ultrasonic feature)


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

Ultrasonic-specific attributes (Ultrasonic feature)


[View source]
def ultrasonic_unoccupied_to_occupied_delay : UInt16 | Nil #

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

[View source]
def ultrasonic_unoccupied_to_occupied_threshold : UInt8 | Nil #

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

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

Update the occupancy state


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

Write an attribute value


[View source]