Multi Binary Inputs Cluster

 

This cluster manages multi binary entries, it delivers the current state.

If a field of the payload starts with 0x, this means that it’s an hexadecimal representation, and if it starts with 0b, it is a binary representation.

Any multi-byte numerical value is serialized in “Big Endian” order.

Present value


The Present value information attribute set contains only the attribute representing the current state of the device.

Standard report

Report

FeaturesFctrl CmdIDClusterIDAttributeIDAttribute typeDataComment
Report attributes0x110x0A0x80 0x050x00 0x000x190xvvvv0xvvvv:binary values. Each bit corresponds to a specific physical inputs

Configuration

FeaturesFctrl CmdIDClusterIDPayloadComment
Configure reporting0x11 0x060x80 0x050x00 0x00 0x00 0x19 0xmmmm 0xMMMM 0xvvvv0x00 0x00: attributeID
0x19: attribute type
0xmmmm: minimum reporting interval
0xMMMM: maximum reporting interval
0xvvvv: reportable change
Configure reporting response0x11 0x070x80 0x050xss 0x00 0x00 0x000xss:status
Read reporting configuration0x11 0x080x80 0x050x00 0x00 0x000x00 0x00: attributeID
Read reporting configuration response0x110x090x80 0x050xss 0x00 0x00 0x00 0x19 0xmmmm 0xMMMM 0xvvvv0xss:status
0x00 0x00:attributeID
0x19: attribute type
0xmmmm: minimum reporting interval
0xMMMM: maximum reporting interval
0xvvvv: reportable change

Read/Write

FeaturesFctrl CmdIDClusterIDAttributeIDStatusAttribute typeDataComment
Read attribute request0x110x000x80 0x05 0x00 0x00Ask the binary input value of the sensor
Read attribute response0x110x010x80 0x05 0x00 0x000x000x190xvvvv0xvvvv: bitmap 16-bits type
Each bit of PresentValues corresponds to an input.

Batch report

The Present value sample type is "Unsigned 16 bits integer", the corresponding number to use in br_uncompress type is 6.

Configuration

Feature Fctrl CmdIDClusterIDPayloadComment
Configure reporting0x110x060x80 0x050x15 0x00 0x00 0x00 0xmmmm 0xMMMM 0xdddd 0xrrrr 0xtt0x15: Batch(size+flag); 0bsssssss is the size of configuration string after attributeID (obsssssss1 right shifted). The size here is 0x0A.
0x00 0x00: AttributeID
0x00: the index of required field( the presentvalue has got only one field 0)
0xmmmm: minimum recorting interval
0xMMMM: maximum recorting interval
0xdddd: the required delta value (the size depends on the attribute data type)
0xrrrr: the required resolution value (the size depends on the attribute data type)
0xtt:the tag value
Configure reporting response0x110x070x80 0x050xss 0x01 0x00 0x000xss : status
0x01 : batch
Read reporting configuration0x11 0x080x80 0x050x01 0x00 0x000x01: Batch
Read reporting configuration response0x11 0x090x80 0x050xss 0x11 0x00 0x00 0x00 0xmmmm 0xMMMM 0xdd 0xrr 0xtt0xss : status
0x11: Batch(size+flag); 0bsssssss is the size of configuration string after attributeID (obsssssss1 right shifted). The size here is 0x08.
0x00: the index of required field( the presentvalue has got only one field 0)
0xmmmm: minimum reporting interval
0xMMMM: maximum reporting interval
0xdd: the required delta value (the size depends on the attribute data type)
0xrr: the required resolution value (the size depends on the attribute data type)
0xtt: the tag value

Cluster Overview

The Multi-Binary Inputs cluster exposes several binary inputs in a single bitmap attribute.

Item Value Description
Cluster 0x8005 Multi-Binary Inputs cluster
Attribute 0x0000 present_value
Type 0x19 BITMAP16, 16-bit bitmap

Each bit represents one binary input:

b0 = input 1
b1 = input 2
b2 = input 3
b3 = input 4
...

For example:

present_value = 0x0005

0x0005 = 0000 0000 0000 0101b
=> b0 = 1
=> b2 = 1

Advanced Reporting Frame

An advanced reporting configuration on the present_value attribute uses the following structure:

<EP> 06 80 05 <RP> 00 00 19 <Min> <Max> <Slot...>

Example:

11 06 80 05 98 00 00 19 00 00 FF FF ...
Bytes Description
11 Endpoint
06 Configure reporting command
80 05 Multi-Binary Inputs cluster 0x8005
98 Report parameters field
00 00 Attribute present_value
19 Attribute type BITMAP16
00 00 Minimum reporting interval, in seconds
FF FF Maximum reporting interval disabled
Important: Min and Max control the reporting timing. They do not define the physical input sampling period. When inputs are interrupt-driven, the bitmap is checked when an input change updates the present_value.

Pattern Mode: Val and Gap

For a bitmap attribute, threshold reporting is used as a pattern matching service.

The fields Val and Gap are interpreted as follows:

Field Meaning for BITMAP16
Val Expected bit values
Gap Mask of the bits to check

The firmware checks the pattern with the following logic:

((~(Current ^ Val)) & Gap) == Gap

In plain words:

All bits set to 1 in Gap must match the value defined in Val.
All bits set to 0 in Gap are ignored.

Example: Check b0 and b2 at 1

Val = 0x0005
Gap = 0x0005

0x0005 = 0000 0000 0000 0101b
=> check b0 and b2
=> b0 must be 1
=> b2 must be 1

This condition is true when:

b2 = 1 AND b0 = 1

Example: Check b2 at 1 and b1 at 0

Val = 0x0004
Gap = 0x0006

Gap = 0x0006 => check b1 and b2
Val = 0x0004 => b2 must be 1, b1 must be 0

This condition is true when:

b2 = 1 AND b1 = 0

How to Create an OR Condition

A single pattern slot naturally creates an AND condition between all bits selected by Gap.

To create an OR condition, use several slots.

Wanted condition:
b2 = 1 AND (b0 = 1 OR b1 = 1)

Slot 1:
Val = 0x0005
Gap = 0x0005
=> b2 = 1 AND b0 = 1

Slot 2:
Val = 0x0006
Gap = 0x0006
=> b2 = 1 AND b1 = 1

Occurrences

Occurrences define how many consecutive checks must validate a condition before the slot is triggered, and how many opposite checks are required before the slot is rearmed.

Field Description
OccHigh Number of times the pattern must be true before triggering on exceed / pattern found
OccLow Number of times the pattern must be false before rearming or triggering on fall

Short Occurrence Format

In the short format, one byte is used for both values:

<Occ>

It is equivalent to:

OccHigh = Occ
OccLow  = Occ

Extended Occurrence Format

In the extended format, OccHigh and OccLow are configured separately:

80 <OccHigh:16> <OccLow:16>

Example:

80 00 01 00 00

OccHigh = 1
OccLow  = 0
Important: OccLow = 0 means that the high condition is immediately ready to trigger again. If the pattern remains true and another check occurs, the slot may trigger again.

Use OccLow = 0 when repeated reports are expected while the condition remains true.

pattern true  => trigger
pattern true  => can trigger again
pattern true  => can trigger again

Use OccLow != 0 when the slot must wait for the condition to become false before it can trigger again.

OccHigh = 1
OccLow  = 1

pattern false => armed
pattern true  => trigger
pattern true  => no new trigger
pattern false => rearmed
pattern true  => trigger again

Delta / Variation Mode

Delta mode triggers a report when the bitmap value changes compared with the last reported value.

For the Multi-Binary Inputs cluster, the firmware keeps two values:

current_present_value
last_present_value

In the historical Multi-Binary Input implementation, the test is based on the numeric difference:

abs(current_present_value - last_present_value) >= delta

After the report is sent, the last reported value is updated:

last_present_value = current_present_value
Important: Delta is not a precise bit mask for the Multi-Binary Inputs cluster. It should not be used to select only specific bits such as b0 and b1 while ignoring b2.

Delta in Generic Criteria Slots

When using the generic criteria-slot engine in delta mode with a bitmap, the Val field is treated as an enable flag, not as a precise bit mask.

For backward compatibility, the firmware does the following:

Mask = (Val != 0 ? 0xFFFFFFFF : 0)

Therefore:

Delta Val Behavior
0x0000 No bitmap delta trigger
Any non-zero value Trigger if any bit changes

Use delta mode when the required service is:

Send a report when any input bit changes.

Do not use delta mode when the required service is:

Send a report only when b0 = 1.
Send a report only when b2 = 1 AND b1 = 1.
Ignore some bits and check only selected bits.

For those cases, use pattern mode with Val and Gap.

Delta Slot Example

11 06 80 05 90 00 00 19 00 00 FF FF 09 00 01
Bytes Description
11 06 80 05 Configure reporting on Multi-Binary Inputs cluster
90 New report format
00 00 19 present_value, type BITMAP16
00 00 FF FF No minimum delay, no periodic maximum report
09 Slot descriptor: slot 1, delta mode, trigger on exceed
00 01 Non-zero delta value: trigger if any bit changes

Actions

When a slot is configured in threshold-with-actions mode, it can execute an action list.

The action section starts with:

<ActionDesc> <Actions...>

The ActionDesc byte is decoded as follows:

Bits Description
0..6 Action payload size, in bytes
7 Action without report flag

Examples:

0E = 14 bytes of actions, with slot report
8E = 14 bytes of actions, without slot report

If bit 7 is 0, the slot generates its own report when it triggers.

If bit 7 is 1, the slot executes the action list but does not generate the slot report directly.

This is useful when the action list itself reconfigures reporting. It avoids generating one report from the slot and additional reports caused by the reconfiguration.

Examples

Alarm Condition with a Time Window

Inputs:

b0 = PIR sensor
b1 = door contact
b2 = active time window

Required condition:

b2 = 1 AND (b0 = 1 OR b1 = 1)

Use two pattern slots:

Slot 1:
Val = 0x0005
Gap = 0x0005
=> b2 = 1 AND b0 = 1

Slot 2:
Val = 0x0006
Gap = 0x0006
=> b2 = 1 AND b1 = 1

Recommended occurrences to avoid retriggering while the pattern remains true:

80 00 01 00 01

OccHigh = 1
OccLow  = 1

Recommended action descriptor when the slot must execute actions without generating its own immediate report:

8E

Pattern Slot Example

11 06 80 05 98 00 00 19 00 00 FF FF D9 00 05 00 05 80 00 01 00 01 ...
Bytes Description
D9 Slot 1, threshold-with-actions, trigger on pattern found, alarm report
00 05 Val: b0 and b2 expected at 1
00 05 Gap: check b0 and b2
80 00 01 00 01 Extended occurrences: OccHigh = 1, OccLow = 1

Rule of Thumb

Need Recommended Mode
Report when any input changes Delta / variation
Report when a specific combination of bits is true Pattern with Val and Gap
Trigger an action from a specific bit pattern Pattern with actions
Avoid repeated triggers while the condition remains true Use OccLow != 0