0
# Matter Clusters
1
2
Complete implementation of Matter clusters (170+ cluster types) providing standardized device interaction patterns for smart home devices including lighting, sensors, HVAC, security, and more.
3
4
## Capabilities
5
6
### Lighting Control Clusters
7
8
Control various aspects of lighting devices including on/off state, dimming levels, and color.
9
10
```python { .api }
11
class OnOff:
12
"""On/Off cluster for basic device power control."""
13
14
class Attributes:
15
OnOff: int # Current on/off state (0=off, 1=on)
16
GlobalSceneControl: bool # Global scene control flag
17
OnTime: int # On time in 1/10ths of a second
18
OffWaitTime: int # Off wait time in 1/10ths of a second
19
StartUpOnOff: int # Startup behavior
20
21
class Commands:
22
class Off:
23
"""Turn device off."""
24
def __init__(self): ...
25
26
class On:
27
"""Turn device on."""
28
def __init__(self): ...
29
30
class Toggle:
31
"""Toggle device state."""
32
def __init__(self): ...
33
34
class OffWithEffect:
35
"""Turn off with effect."""
36
def __init__(self, effectId: int, effectVariant: int): ...
37
38
class OnWithRecallGlobalScene:
39
"""Turn on and recall global scene."""
40
def __init__(self): ...
41
42
class OnWithTimedOff:
43
"""Turn on with timed off."""
44
def __init__(self, onOffControl: int, onTime: int, offWaitTime: int): ...
45
46
class LevelControl:
47
"""Level control cluster for dimming and level adjustment."""
48
49
class Attributes:
50
CurrentLevel: int # Current level (0-254, null if unknown)
51
RemainingTime: int # Remaining transition time
52
MinLevel: int # Minimum level value
53
MaxLevel: int # Maximum level value
54
CurrentFrequency: int # Current frequency
55
MinFrequency: int # Minimum frequency
56
MaxFrequency: int # Maximum frequency
57
OnOffTransitionTime: int # Transition time for on/off
58
OnLevel: int # Level for on command
59
OnTransitionTime: int # Transition time for on
60
OffTransitionTime: int # Transition time for off
61
DefaultMoveRate: int # Default move rate
62
Options: int # Level control options
63
StartUpCurrentLevel: int # Startup current level
64
65
class Commands:
66
class MoveToLevel:
67
"""Move to specific level."""
68
def __init__(self, level: int, transitionTime: int, optionsMask: int = 0, optionsOverride: int = 0): ...
69
70
class Move:
71
"""Move up or down."""
72
def __init__(self, moveMode: int, rate: int, optionsMask: int = 0, optionsOverride: int = 0): ...
73
74
class Step:
75
"""Step up or down."""
76
def __init__(self, stepMode: int, stepSize: int, transitionTime: int, optionsMask: int = 0, optionsOverride: int = 0): ...
77
78
class Stop:
79
"""Stop level change."""
80
def __init__(self, optionsMask: int = 0, optionsOverride: int = 0): ...
81
82
class MoveToLevelWithOnOff:
83
"""Move to level with on/off."""
84
def __init__(self, level: int, transitionTime: int, optionsMask: int = 0, optionsOverride: int = 0): ...
85
86
class ColorControl:
87
"""Color control cluster for color-capable lighting devices."""
88
89
class Attributes:
90
CurrentHue: int # Current hue value (0-254)
91
CurrentSaturation: int # Current saturation (0-254)
92
RemainingTime: int # Remaining transition time
93
CurrentX: int # Current CIE x coordinate
94
CurrentY: int # Current CIE y coordinate
95
DriftCompensation: int # Drift compensation
96
CompensationText: str # Compensation text
97
ColorTemperatureMireds: int # Color temperature in mireds
98
ColorMode: int # Current color mode
99
Options: int # Color control options
100
NumberOfPrimaries: int # Number of color primaries
101
Primary1X: int # Primary 1 x coordinate
102
Primary1Y: int # Primary 1 y coordinate
103
Primary1Intensity: int # Primary 1 intensity
104
ColorPointRed: tuple # Red color point (x, y)
105
ColorPointGreen: tuple # Green color point (x, y)
106
ColorPointBlue: tuple # Blue color point (x, y)
107
WhitePointX: int # White point x coordinate
108
WhitePointY: int # White point y coordinate
109
ColorTempPhysicalMinMireds: int # Physical minimum color temperature
110
ColorTempPhysicalMaxMireds: int # Physical maximum color temperature
111
CoupleColorTempToLevelMinMireds: int # Coupling minimum temperature
112
StartUpColorTemperatureMireds: int # Startup color temperature
113
114
class Commands:
115
class MoveToHue:
116
"""Move to specific hue."""
117
def __init__(self, hue: int, direction: int, transitionTime: int, optionsMask: int = 0, optionsOverride: int = 0): ...
118
119
class MoveHue:
120
"""Move hue continuously."""
121
def __init__(self, moveMode: int, rate: int, optionsMask: int = 0, optionsOverride: int = 0): ...
122
123
class StepHue:
124
"""Step hue by amount."""
125
def __init__(self, stepMode: int, stepSize: int, transitionTime: int, optionsMask: int = 0, optionsOverride: int = 0): ...
126
127
class MoveToSaturation:
128
"""Move to specific saturation."""
129
def __init__(self, saturation: int, transitionTime: int, optionsMask: int = 0, optionsOverride: int = 0): ...
130
131
class MoveSaturation:
132
"""Move saturation continuously."""
133
def __init__(self, moveMode: int, rate: int, optionsMask: int = 0, optionsOverride: int = 0): ...
134
135
class StepSaturation:
136
"""Step saturation by amount."""
137
def __init__(self, stepMode: int, stepSize: int, transitionTime: int, optionsMask: int = 0, optionsOverride: int = 0): ...
138
139
class MoveToHueAndSaturation:
140
"""Move to specific hue and saturation."""
141
def __init__(self, hue: int, saturation: int, transitionTime: int, optionsMask: int = 0, optionsOverride: int = 0): ...
142
143
class MoveToColor:
144
"""Move to specific color (x, y)."""
145
def __init__(self, colorX: int, colorY: int, transitionTime: int, optionsMask: int = 0, optionsOverride: int = 0): ...
146
147
class MoveToColorTemperature:
148
"""Move to specific color temperature."""
149
def __init__(self, colorTemperatureMireds: int, transitionTime: int, optionsMask: int = 0, optionsOverride: int = 0): ...
150
```
151
152
### Sensor Clusters
153
154
Read environmental and occupancy sensor data from Matter devices.
155
156
```python { .api }
157
class TemperatureMeasurement:
158
"""Temperature measurement cluster."""
159
160
class Attributes:
161
MeasuredValue: int # Measured temperature in 1/100ths of degrees Celsius (null if unknown)
162
MinMeasuredValue: int # Minimum measurable temperature
163
MaxMeasuredValue: int # Maximum measurable temperature
164
Tolerance: int # Measurement tolerance
165
166
class RelativeHumidityMeasurement:
167
"""Relative humidity measurement cluster."""
168
169
class Attributes:
170
MeasuredValue: int # Measured humidity in 1/100ths of percent (null if unknown)
171
MinMeasuredValue: int # Minimum measurable humidity
172
MaxMeasuredValue: int # Maximum measurable humidity
173
Tolerance: int # Measurement tolerance
174
175
class IlluminanceMeasurement:
176
"""Illuminance measurement cluster."""
177
178
class Attributes:
179
MeasuredValue: int # Measured illuminance in lux (null if unknown)
180
MinMeasuredValue: int # Minimum measurable illuminance
181
MaxMeasuredValue: int # Maximum measurable illuminance
182
Tolerance: int # Measurement tolerance
183
LightSensorType: int # Type of light sensor
184
185
class OccupancySensing:
186
"""Occupancy sensing cluster."""
187
188
class Attributes:
189
Occupancy: int # Occupancy bitmap (bit 0: occupied)
190
OccupancySensorType: int # Type of occupancy sensor
191
OccupancySensorTypeBitmap: int # Occupancy sensor type bitmap
192
PIROccupiedToUnoccupiedDelay: int # PIR occupied to unoccupied delay
193
PIRUnoccupiedToOccupiedDelay: int # PIR unoccupied to occupied delay
194
PIRUnoccupiedToOccupiedThreshold: int # PIR unoccupied to occupied threshold
195
UltrasonicOccupiedToUnoccupiedDelay: int # Ultrasonic delays
196
UltrasonicUnoccupiedToOccupiedDelay: int
197
UltrasonicUnoccupiedToOccupiedThreshold: int
198
PhysicalContactOccupiedToUnoccupiedDelay: int # Physical contact delays
199
PhysicalContactUnoccupiedToOccupiedDelay: int
200
PhysicalContactUnoccupiedToOccupiedThreshold: int
201
202
class PressureMeasurement:
203
"""Pressure measurement cluster."""
204
205
class Attributes:
206
MeasuredValue: int # Measured pressure in kPa (null if unknown)
207
MinMeasuredValue: int # Minimum measurable pressure
208
MaxMeasuredValue: int # Maximum measurable pressure
209
Tolerance: int # Measurement tolerance
210
ScaledValue: int # Scaled measured value
211
MinScaledValue: int # Minimum scaled value
212
MaxScaledValue: int # Maximum scaled value
213
ScaledTolerance: int # Scaled tolerance
214
Scale: int # Scale factor
215
```
216
217
### HVAC Control Clusters
218
219
Control heating, ventilation, and air conditioning systems.
220
221
```python { .api }
222
class Thermostat:
223
"""Thermostat cluster for temperature control."""
224
225
class Attributes:
226
LocalTemperature: int # Local temperature in 1/100ths degrees Celsius
227
OutdoorTemperature: int # Outdoor temperature
228
Occupancy: int # Occupancy status
229
AbsMinHeatSetpointLimit: int # Absolute minimum heat setpoint
230
AbsMaxHeatSetpointLimit: int # Absolute maximum heat setpoint
231
AbsMinCoolSetpointLimit: int # Absolute minimum cool setpoint
232
AbsMaxCoolSetpointLimit: int # Absolute maximum cool setpoint
233
PICoolingDemand: int # PI cooling demand
234
PIHeatingDemand: int # PI heating demand
235
HVACSystemTypeConfiguration: int # HVAC system type
236
LocalTemperatureCalibration: int # Local temperature calibration
237
OccupiedCoolingSetpoint: int # Occupied cooling setpoint
238
OccupiedHeatingSetpoint: int # Occupied heating setpoint
239
UnoccupiedCoolingSetpoint: int # Unoccupied cooling setpoint
240
UnoccupiedHeatingSetpoint: int # Unoccupied heating setpoint
241
MinHeatSetpointLimit: int # Minimum heat setpoint limit
242
MaxHeatSetpointLimit: int # Maximum heat setpoint limit
243
MinCoolSetpointLimit: int # Minimum cool setpoint limit
244
MaxCoolSetpointLimit: int # Maximum cool setpoint limit
245
MinSetpointDeadBand: int # Minimum setpoint dead band
246
RemoteSensing: int # Remote sensing bitmap
247
ControlSequenceOfOperation: int # Control sequence
248
SystemMode: int # System mode (off, auto, cool, heat, etc.)
249
ThermostatRunningState: int # Running state bitmap
250
SetpointChangeSource: int # Setpoint change source
251
SetpointChangeAmount: int # Setpoint change amount
252
SetpointChangeSourceTimestamp: int # Setpoint change timestamp
253
OccupiedSetback: int # Occupied setback
254
OccupiedSetbackMin: int # Occupied setback minimum
255
OccupiedSetbackMax: int # Occupied setback maximum
256
UnoccupiedSetback: int # Unoccupied setback
257
UnoccupiedSetbackMin: int # Unoccupied setback minimum
258
UnoccupiedSetbackMax: int # Unoccupied setback maximum
259
EmergencyHeatDelta: int # Emergency heat delta
260
ACType: int # AC type
261
ACCapacity: int # AC capacity
262
ACRefrigerantType: int # AC refrigerant type
263
ACCompressorType: int # AC compressor type
264
ACErrorCode: int # AC error code
265
ACLouverPosition: int # AC louver position
266
ACCoilTemperature: int # AC coil temperature
267
ACCapacityformat: int # AC capacity format
268
269
class Commands:
270
class SetpointRaiseLower:
271
"""Raise or lower setpoint."""
272
def __init__(self, mode: int, amount: int): ...
273
274
class SetWeeklySchedule:
275
"""Set weekly schedule."""
276
def __init__(self, numberOfTransitionsForSequence: int, dayOfWeekForSequence: int, modeForSequence: int, transitions: list): ...
277
278
class GetWeeklySchedule:
279
"""Get weekly schedule."""
280
def __init__(self, daysToReturn: int, modeToReturn: int): ...
281
282
class ClearWeeklySchedule:
283
"""Clear weekly schedule."""
284
def __init__(self): ...
285
286
class Fan:
287
"""Fan control cluster."""
288
289
class Attributes:
290
FanMode: int # Fan mode (off, low, medium, high, on, auto, smart)
291
FanModeSequence: int # Fan mode sequence
292
PercentSetting: int # Percent setting (0-100)
293
PercentCurrent: int # Current percent
294
SpeedMax: int # Maximum speed
295
SpeedSetting: int # Speed setting
296
SpeedCurrent: int # Current speed
297
RockSupport: int # Rock support bitmap
298
RockSetting: int # Rock setting
299
WindSupport: int # Wind support bitmap
300
WindSetting: int # Wind setting
301
302
class Commands:
303
class Step:
304
"""Step fan speed."""
305
def __init__(self, direction: int, wrap: bool, lowestOff: bool): ...
306
```
307
308
### Security and Access Control
309
310
Manage door locks, access control, and security systems.
311
312
```python { .api }
313
class DoorLock:
314
"""Door lock cluster for access control."""
315
316
class Attributes:
317
LockState: int # Current lock state (locked, unlocked, not fully locked, unknown)
318
LockType: int # Type of lock
319
ActuatorEnabled: bool # Whether actuator is enabled
320
DoorState: int # Door state (open, closed, error, forced open, unknown, ajar)
321
DoorOpenEvents: int # Number of door open events
322
DoorClosedEvents: int # Number of door closed events
323
OpenPeriod: int # Door open period
324
NumberOfLogRecordsSupported: int # Number of log records supported
325
NumberOfTotalUsersSupported: int # Total users supported
326
NumberOfPINUsersSupported: int # PIN users supported
327
NumberOfRFIDUsersSupported: int # RFID users supported
328
NumberOfWeekDaySchedulesSupportedPerUser: int # Week day schedules per user
329
NumberOfYearDaySchedulesSupportedPerUser: int # Year day schedules per user
330
NumberOfHolidaySchedulesSupported: int # Holiday schedules supported
331
MaxPINCodeLength: int # Maximum PIN code length
332
MinPINCodeLength: int # Minimum PIN code length
333
MaxRFIDCodeLength: int # Maximum RFID code length
334
MinRFIDCodeLength: int # Minimum RFID code length
335
CredentialRulesSupport: int # Credential rules support bitmap
336
NumberOfCredentialsSupportedPerUser: int # Credentials per user
337
Language: str # Language setting
338
LEDSettings: int # LED settings
339
AutoRelockTime: int # Auto relock time in seconds
340
SoundVolume: int # Sound volume
341
OperatingMode: int # Operating mode
342
SupportedOperatingModes: int # Supported operating modes bitmap
343
DefaultConfigurationRegister: int # Default configuration
344
EnableLocalProgramming: bool # Enable local programming
345
EnableOneTouchLocking: bool # Enable one touch locking
346
EnableInsideStatusLED: bool # Enable inside status LED
347
EnablePrivacyModeButton: bool # Enable privacy mode button
348
LocalProgrammingFeatures: int # Local programming features bitmap
349
WrongCodeEntryLimit: int # Wrong code entry limit
350
UserCodeTemporaryDisableTime: int # User code temporary disable time
351
SendPINOverTheAir: bool # Send PIN over the air
352
RequirePINforRemoteOperation: bool # Require PIN for remote operation
353
ExpiringUserTimeout: int # Expiring user timeout
354
355
class Commands:
356
class LockDoor:
357
"""Lock the door."""
358
def __init__(self, pinCode: bytes = None): ...
359
360
class UnlockDoor:
361
"""Unlock the door."""
362
def __init__(self, pinCode: bytes = None): ...
363
364
class UnlockWithTimeout:
365
"""Unlock with timeout."""
366
def __init__(self, timeout: int, pinCode: bytes = None): ...
367
368
class GetLogRecord:
369
"""Get log record."""
370
def __init__(self, logIndex: int): ...
371
372
class SetPINCode:
373
"""Set PIN code."""
374
def __init__(self, userId: int, userStatus: int, userType: int, pinCode: bytes): ...
375
376
class GetPINCode:
377
"""Get PIN code."""
378
def __init__(self, userId: int): ...
379
380
class ClearPINCode:
381
"""Clear PIN code."""
382
def __init__(self, userId: int): ...
383
384
class ClearAllPINCodes:
385
"""Clear all PIN codes."""
386
def __init__(self): ...
387
388
class SetUserStatus:
389
"""Set user status."""
390
def __init__(self, userId: int, userStatus: int): ...
391
392
class GetUserStatus:
393
"""Get user status."""
394
def __init__(self, userId: int): ...
395
396
class SetWeekDaySchedule:
397
"""Set week day schedule."""
398
def __init__(self, scheduleId: int, userId: int, daysMask: int, startHour: int, startMinute: int, endHour: int, endMinute: int): ...
399
400
class GetWeekDaySchedule:
401
"""Get week day schedule."""
402
def __init__(self, scheduleId: int, userId: int): ...
403
404
class ClearWeekDaySchedule:
405
"""Clear week day schedule."""
406
def __init__(self, scheduleId: int, userId: int): ...
407
408
class SetYearDaySchedule:
409
"""Set year day schedule."""
410
def __init__(self, scheduleId: int, userId: int, localStartTime: int, localEndTime: int): ...
411
412
class GetYearDaySchedule:
413
"""Get year day schedule."""
414
def __init__(self, scheduleId: int, userId: int): ...
415
416
class ClearYearDaySchedule:
417
"""Clear year day schedule."""
418
def __init__(self, scheduleId: int, userId: int): ...
419
420
class SetHolidaySchedule:
421
"""Set holiday schedule."""
422
def __init__(self, scheduleId: int, localStartTime: int, localEndTime: int, operatingMode: int): ...
423
424
class GetHolidaySchedule:
425
"""Get holiday schedule."""
426
def __init__(self, scheduleId: int): ...
427
428
class ClearHolidaySchedule:
429
"""Clear holiday schedule."""
430
def __init__(self, scheduleId: int): ...
431
432
class SetUser:
433
"""Set user."""
434
def __init__(self, operationType: int, userIndex: int, userName: str, userUniqueId: int, userStatus: int, userType: int, credentialRule: int): ...
435
436
class GetUser:
437
"""Get user."""
438
def __init__(self, userIndex: int): ...
439
440
class ClearUser:
441
"""Clear user."""
442
def __init__(self, userIndex: int): ...
443
444
class SetCredential:
445
"""Set credential."""
446
def __init__(self, operationType: int, credential: dict, credentialData: bytes, userIndex: int, userStatus: int, userType: int): ...
447
448
class GetCredentialStatus:
449
"""Get credential status."""
450
def __init__(self, credential: dict): ...
451
452
class ClearCredential:
453
"""Clear credential."""
454
def __init__(self, credential: dict): ...
455
```
456
457
### Window Covering Control
458
459
Control motorized window coverings, blinds, and shades.
460
461
```python { .api }
462
class WindowCovering:
463
"""Window covering control cluster."""
464
465
class Attributes:
466
Type: int # Window covering type
467
PhysicalClosedLimitLift: int # Physical closed limit lift
468
PhysicalClosedLimitTilt: int # Physical closed limit tilt
469
CurrentPositionLift: int # Current lift position (0-10000, null if unknown)
470
CurrentPositionTilt: int # Current tilt position (0-10000, null if unknown)
471
NumberOfActuationsLift: int # Number of lift actuations
472
NumberOfActuationsTilt: int # Number of tilt actuations
473
ConfigStatus: int # Configuration status bitmap
474
CurrentPositionLiftPercentage: int # Current lift position percentage (0-100, null if unknown)
475
CurrentPositionTiltPercentage: int # Current tilt position percentage (0-100, null if unknown)
476
OperationalStatus: int # Operational status bitmap
477
TargetPositionLiftPercent100ths: int # Target lift position in 1/100ths percent
478
TargetPositionTiltPercent100ths: int # Target tilt position in 1/100ths percent
479
EndProductType: int # End product type
480
Mode: int # Window covering mode bitmap
481
SafetyStatus: int # Safety status bitmap
482
483
class Commands:
484
class UpOrOpen:
485
"""Move covering up or open."""
486
def __init__(self): ...
487
488
class DownOrClose:
489
"""Move covering down or close."""
490
def __init__(self): ...
491
492
class StopMotion:
493
"""Stop covering motion."""
494
def __init__(self): ...
495
496
class GoToLiftValue:
497
"""Go to specific lift value."""
498
def __init__(self, liftValue: int): ...
499
500
class GoToLiftPercentage:
501
"""Go to specific lift percentage."""
502
def __init__(self, liftPercent100thsValue: int): ...
503
504
class GoToTiltValue:
505
"""Go to specific tilt value."""
506
def __init__(self, tiltValue: int): ...
507
508
class GoToTiltPercentage:
509
"""Go to specific tilt percentage."""
510
def __init__(self, tiltPercent100thsValue: int): ...
511
```
512
513
## Usage Examples
514
515
### Basic Lighting Control
516
517
```python
518
import chip.clusters as Clusters
519
from chip.ChipDeviceCtrl import ChipDeviceController
520
521
controller = ChipDeviceController(controllerNodeId=12345)
522
523
# Turn on a light
524
controller.SendCommand(
525
nodeid=1,
526
endpoint=1,
527
Clusters.OnOff.Commands.On()
528
)
529
530
# Dim to 50%
531
controller.SendCommand(
532
nodeid=1,
533
endpoint=1,
534
Clusters.LevelControl.Commands.MoveToLevel(
535
level=127, # 50% of 254
536
transitionTime=10 # 1 second transition
537
)
538
)
539
540
# Change color to red (hue=0, saturation=254)
541
controller.SendCommand(
542
nodeid=1,
543
endpoint=1,
544
Clusters.ColorControl.Commands.MoveToHueAndSaturation(
545
hue=0,
546
saturation=254,
547
transitionTime=20
548
)
549
)
550
```
551
552
### Sensor Reading
553
554
```python
555
# Read temperature sensor
556
temp_result = controller.ReadAttribute(
557
nodeid=2,
558
attributes=[(1, Clusters.TemperatureMeasurement.Attributes.MeasuredValue)]
559
)
560
561
if temp_result:
562
temp_raw = temp_result[(1, Clusters.TemperatureMeasurement.id, Clusters.TemperatureMeasurement.Attributes.MeasuredValue.attribute_id)]
563
if temp_raw is not None:
564
temperature_celsius = temp_raw / 100.0
565
print(f"Temperature: {temperature_celsius}°C")
566
567
# Check occupancy sensor
568
occupancy_result = controller.ReadAttribute(
569
nodeid=3,
570
attributes=[(1, Clusters.OccupancySensing.Attributes.Occupancy)]
571
)
572
573
if occupancy_result:
574
occupancy = occupancy_result[(1, Clusters.OccupancySensing.id, Clusters.OccupancySensing.Attributes.Occupancy.attribute_id)]
575
is_occupied = bool(occupancy & 0x01)
576
print(f"Occupancy: {'Occupied' if is_occupied else 'Unoccupied'}")
577
```
578
579
### Thermostat Control
580
581
```python
582
# Set thermostat to 72°F (2222 = 22.22°C)
583
controller.WriteAttribute(
584
nodeid=4,
585
attributes=[(1, Clusters.Thermostat.Attributes.OccupiedHeatingSetpoint, 2222)]
586
)
587
588
# Change to cooling mode
589
controller.WriteAttribute(
590
nodeid=4,
591
attributes=[(1, Clusters.Thermostat.Attributes.SystemMode, 3)] # 3 = Cool
592
)
593
594
# Raise setpoint by 1°C
595
controller.SendCommand(
596
nodeid=4,
597
endpoint=1,
598
Clusters.Thermostat.Commands.SetpointRaiseLower(
599
mode=0, # 0 = heat, 1 = cool, 2 = both
600
amount=100 # 1°C in 1/100ths
601
)
602
)
603
```
604
605
### Door Lock Control
606
607
```python
608
# Lock door with PIN
609
controller.SendCommand(
610
nodeid=5,
611
endpoint=1,
612
Clusters.DoorLock.Commands.LockDoor(
613
pinCode=b"1234"
614
)
615
)
616
617
# Unlock door temporarily for 30 seconds
618
controller.SendCommand(
619
nodeid=5,
620
endpoint=1,
621
Clusters.DoorLock.Commands.UnlockWithTimeout(
622
timeout=30,
623
pinCode=b"1234"
624
)
625
)
626
627
# Check lock state
628
lock_state = controller.ReadAttribute(
629
nodeid=5,
630
attributes=[(1, Clusters.DoorLock.Attributes.LockState)]
631
)
632
```