class Matter::Cluster::RelativeHumidityMeasurementCluster

Overview

Relative Humidity Measurement Cluster (0x0405)

Provides an interface to water content measurement functionality. The measurement is reportable and may be configured for reporting.

Humidity values are expressed in hundredths of percent (0.01%). For example, 5500 represents 55.00% relative humidity.

Specification: Matter 1.4 § 2.6

Defined in:

matter/cluster/relative_humidity_measurement_cluster.cr

Constant Summary

ATTR_MAX_MEASURED_VALUE = 2_u32
ATTR_MEASURED_VALUE = 0_u32

Attributes

ATTR_MIN_MEASURED_VALUE = 1_u32
ATTR_TOLERANCE = 3_u32
CLUSTER_ID = 1029_u32
MAX_HUMIDITY = 10000_u16
MIN_HUMIDITY = 0_u16

Humidity limits (in 0.01%)

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, measured_value : UInt16 | Nil = nil, min_measured_value : UInt16 = MIN_HUMIDITY, max_measured_value : UInt16 = MAX_HUMIDITY, tolerance : UInt16 | Nil = nil) #

[View source]

Class Method Detail

def self.cluster_id #

Relative Humidity Measurement Cluster (0x0405)

Provides an interface to water content measurement functionality. The measurement is reportable and may be configured for reporting.

Humidity values are expressed in hundredths of percent (0.01%). For example, 5500 represents 55.00% relative humidity.

Specification: Matter 1.4 § 2.6


[View source]
def self.from_percent(value : Float64) : UInt16 #

Convert from percent (Float) to 0.01% (UInt16)


[View source]
def self.to_percent(value : UInt16) : Float64 #

Convert from 0.01% to percent (Float)


[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 max_measured_value : UInt16 #

Maximum measurable humidity (in 0.01%)


[View source]
def max_measured_value=(max_measured_value : UInt16) #

Maximum measurable humidity (in 0.01%)


[View source]
def measured_value : UInt16 | Nil #

Current measured humidity (in 0.01%), or nil if unknown


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

Current measured humidity (in 0.01%), or nil if unknown


[View source]
def min_measured_value : UInt16 #

Minimum measurable humidity (in 0.01%)


[View source]
def min_measured_value=(min_measured_value : UInt16) #

Minimum measurable humidity (in 0.01%)


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

Get cluster name


[View source]
def on_humidity_changed(&block : UInt16 | Nil, UInt16 | Nil -> 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 tolerance : UInt16 | Nil #

Measurement tolerance (in 0.01%), optional


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

Measurement tolerance (in 0.01%), optional


[View source]
def update_humidity(value : UInt16 | Nil) #

Update the measured humidity value


[View source]