Access Control DP Reference

Last Updated on : 2024-06-21 03:41:11download

This topic describes the features, formats, and usages of data points (DPs) that apply to Wi-Fi access control products.

Background

Terms

The following table lists the important terminologies that you may find helpful in understanding this topic. For more information, see Glossary.

Term Description
Data point (DP) A DP is an abstract representation of a feature you want to apply to a physical device, which can be defined by various data types.
Product ID (PID) A PID is an abstract representation of a collection of physical devices that have the same configurations and properties.
Each product created on the Tuya Developer Platform is assigned a unique PID that is associated with the product information, including DPs, app control panel, and purchase information.
UUID A 20-character universally unique identifier of a device, also known as a license.
AuthKey A 32-character authkey used to register a device with cloud services. One UUID corresponds to one AuthKey uniquely.
Firmware key The unique identity of firmware assigned by the Tuya Developer Platform.
Member Also known as user.
Member ID The ID of a member or a user, which is a 2-byte unsigned integer assigned and managed by the server. The valid values range from 0x0001 to 0xFFFE. The rest are reserved.
Hardware ID The unique ID of the hardware specific to an unlocking method, which is a 2-byte unsigned integer assigned and managed by the local processor.
The valid values range from 0x0000 to 0xFFFE. 0xFFFF is reserved. For example, for fingerprint unlocking and password unlocking, the hardware ID is 0x0001 and 0x0002 respectively.
Validity A specific unlocking method (such as fingerprint and password) is valid during the specified time period.
Send Data is sent from a mobile phone to a device.
Report Data is sent from a device to a mobile phone.

DP format

The size of dp_data_len is two bytes for Tuya-enabled Wi-Fi access control devices. The following table details the DP format.

Field Length (byte) Description
dp_id 1 The ID of a DP.
dp_type 1 The data type of a DP.
dp_data_len 2 The data length of a DP.
dp_data_value dp_data_len The payload of a DP.

Manage unlocking methods

The unlocking methods are associated with user information, such as fingerprints, passwords, dynamic passwords, and face IDs.

Add unlocking methods

Data transmission
dp_id
(1 byte)
dp_type
(1 byte)
dp_data_len
(2 bytes)
dp_data_value
Send 1 raw len Type
(1 byte)
Stage
(1 byte)
Admin flag
(1 byte)
Member ID
(2 bytes)
Hardware ID
(2 bytes)
Validity period
(17 bytes)
Number of times
(1 byte)
Password length
(1 byte)
Password content
(n bytes)
Message UUID
(2 bytes)
0x01: Password
0x02: Door card
0x03: Fingerprint
0x04: Face
0x07: Remote control
0x00: Start enrollment.
0xFE: Cancel enrollment
(initiated by app).
0x00: Ordinary member
0x01: Admin
0x0001 to 0xFFFE 0xFFFF: Default value See
Appendix 1
Value range
Description Description The unique ID of a message,
generated in the cloud,
is associated with
message reporting.
Report 1 raw len Type
(1 byte)
Stage
(1 byte)
Admin flag
(1 byte)
Member ID
(2 bytes)
Hardware ID
(2 bytes)
Number of times
(1 byte)
Return value
(1 byte)
Message UUID
(2 bytes)
0x01: Password
0x02: Door card
0x03: Fingerprint
0x04: Face
0x07: Remote control
0x00: Start enrollment. 0x00: Ordinary member
0x01: Admin
0x0001 to 0xFFFE 0xFFFF: Default value The number of times to finish enrollment.
For example, six times for
fingerprint enrollment.
One time for door card
or face enrollment.
0x00: Default value Same as above
0xFC: Enrollment in progress 0x00: Ordinary member
0x01: Admin
0x0001 to 0xFFFE 0xFFFF: Default value The sequence number for
enrollment times, starting from 1.
For example, fingerprint
enrollment is generally six times.
This field is populated
with the current times.
Reasons for failed enrollment:
0x00: Success.
0x01: Incomplete fingerprint.
0xFD: Enrollment failed 0x00: Ordinary member
0x01: Admin
0x0001 to 0xFFFE 0xFFFF: Default value Current enrollment stage:
0x00: Start enrollment.
0xFC: Enrollment in progress.
0xFF: Finish enrollment.
Reasons for failed enrollment
0xFE: Cancel enrollment
(initiated by app).
0x00: Ordinary member
0x01: Admin
0x0001 to 0xFFFE 0xFFFF: Default value 0x00: Default value 0x00: Default value
0xFF: Enrollment is finished. 0x00: Ordinary member
0x01: Admin
0x0001 to 0xFFFE 0x0000 to 0xFFFE 0x00: Default value 0x00: Default value

How it works

  • The following figure shows how the mobile app interacts with the lock during the enrollment of the password, door card, and face.

    AppLockStart enrollmentStart enrollmentEnd enrollmentAppLock
  • The following figure shows how the mobile app interacts with the lock during fingerprint enrollment.

    AppLockStart enrollmentStart enrollment (6 times)Enrollment in progress (Once)Enrollment in progress (2, 3, 4, 5, and 6 times)End enrollmentAppLock

Delete unlocking methods

Data transmission
dp_id
(1 byte)
dp_type
(1 byte)
dp_data_len
(2 bytes)
dp_data_value
Send 2 raw len Type
(1 byte)
Stage
(1 byte)
Admin flag
(1 byte)
Member ID
(2 bytes)
Hardware ID
(2 bytes)
Deletion method
(1 byte)
0x00: Delete a member. 0x00: Default 0x00: Ordinary member
0x01: Admin
0x0001 to 0xFFFE 0xFFFF: Default value 0x00: Delete all the unlock methods granted to a member.
0x01: Password
0x02: Door card
0x03: Fingerprint
0x04: Face
0x07: Remote control
0x00: Default 0x00: Ordinary member
0x01: Admin
0x0001 to 0xFFFE 0x0000 to 0xFFFE 0x01: Delete a specified unlocking method granted to a member.
Report 2 raw len Type
(1 byte)
Stage
(1 byte)
Admin flag
(1 byte)
Member ID
(2 bytes)
Hardware ID
(2 bytes)
Deletion method
(1 byte)
Return value
(1 byte)
0x00: Delete a member. 0x00: Default 0x00: Ordinary member
0x01: Admin
0x0001 to 0xFFFE 0xFFFF: Default value 0x00: Delete all the unlock methods
granted to a member.
0x00: Deletion failed.
0x01: Hardware ID does not exist.
0x02: Hardware ID cannot be deleted,
such as the hardware ID associated with the admin.
0xFF: Deletion succeeded.
0x01: Password
0x02: Door card
0x03: Fingerprint
0x04: Face
0x07: Remote control
0x00: Default 0x00: Ordinary member
0x01: Admin
0x0001 to 0xFFFE 0x0000 to 0xFFFE 0x01: Delete a specified unlocking method
granted to a member.
0x00: Deletion failed.
0x01: Hardware ID does not exist.
0x02: Hardware ID cannot be deleted,
such as the hardware ID associated with the admin.
0xFF: Deletion succeeded.

Modify unlocking methods

Data transmission
dp_id
(1 byte)
dp_type
(1 byte)
dp_data_len
(2 bytes)
dp_data_value
Send 3 raw len Type
(1 byte)
Stage
(1 byte)
Admin flag
(1 byte)
Member ID
(2 bytes)
Hardware ID
(2 bytes)
Validity period
(17 bytes)
Number of times
(1 byte)
Password length
(1 byte)
Password content
(n bytes)
0x00: Modify the validity period
for a specified member.
0x00: Default 0x00: Ordinary member
0x01: Admin
0x0001 to 0xFFFE 0xFFFF: Default value See
Appendix 1
0x00: Default value.
(Modification is not allowed)
Description Description
0xF1: Modify the role
of a member only.
0x00: Default 0x00: Ordinary member
0x01: Admin
0x0001 to 0xFFFE 0xFFFF: Default value This and the following fields are not applicable.
0x01: Password
0x02: Door card
0x03: Fingerprint
0x04: Face
0x07: Remote control
0x00: Default 0x00: Ordinary member
0x01: Admin
0x0001 to 0xFFFE 0x0000 to 0xFFFE See
Appendix 1
Value range Description Description
Report 3 raw len Type
(1 byte)
Stage
(1 byte)
Admin flag
(1 byte)
Member ID
(2 bytes)
Hardware ID
(2 bytes)
Number of times
(1 byte)
Return value
(1 byte)
0x00: Modify the validity period
for a specified member.
0x00: Default 0x00: Ordinary member
0x01: Admin
0x0001 to 0xFFFE 0xFFFF: Default value 0x00: Default 0x00: Failure
0xFF: Success
0xF1: Modify the role
of a member only.
0x00: Default 0x00: Ordinary member
0x01: Admin
0x0001 to 0xFFFE 0xFFFF: Default value 0x00: Default 0x00: Failure
0xFF: Success
0x01: Password
0x02: Door card
0x03: Fingerprint
0x04: Face
0x07: Remote control
0x00: Default 0x00: Ordinary member
0x01: Admin
0x0001 to 0xFFFE 0x0000 to 0xFFFE Value range 0x00: Failure
0xFF: Success

Sync unlocking methods

  • Purpose: To ensure the unlocking methods in the local device and the server are in sync, each time users open the lock member list or pull down to refresh the list, all the added unlocking methods will be synced between them.
  • Hardware types: Used to notify the lock of what unlocking methods it should report. For the in-sync stage, the data length of each packet is defined by you. The total length of one packet should not exceed 200 bytes.
  • Sync locally-added unlocking methods: A lock syncs the locally-added unlocking methods with the cloud in the following cases:
    • Use the member ID 0xFFFD to report an unlocking method. After sync, the user can associate the unlocking method with an app member.
    • Use the member ID 0xFFFF to report an unlocking method. After sync, the user can associate the unlocking method with an app member.
    • Use the user ID 0xFFFD or 0xFFFF to sync the locally-added unlocking method. The cloud handles the received data as is, without identifying the permission to delete the unlocking method using the app.
Data
transmission
dp_id
(1 byte)
dp_type
(1 byte)
dp_data_len
(2 bytes)
dp_data_value
Send 4 raw len Hardware types
(len bytes)
0x01: Password
0x02: Door card
0x03: Fingerprint
0x04: Face
0x07: Remote control
0xF0: Temporary password
Report 4 raw len Stage
(1 byte)
Packet sequence number
(1 byte)
Data for sync
(n bytes)
0x00: In-sync 0x00 to 0xFF
The packet sequence number starts from 0,
incrementally in order.
Data 1, Data 2 … Data n
Data format definition
Report 4 raw len Stage
(1 byte)
Total packets
(1 byte)
0x01: Sync finished Total packets
For example, if a packet for the in-sync
stage is delivered twice, the packets are two in total.

Manage temporary passwords

The types of temporary passwords include one-time and recurring. The temporary password is different from the ordinary password in the following ways:

  • A temporary password is not associated with any members.

  • The validity period of a temporary password can be modified when the lock is connected.

  • As an unlocking method, the type of the temporary password is defined as 0xF0. 0x01 indicates password. 0x02 indicates door card. 0x03 indicates fingerprint.

Take care of the following possible issue with temporary passwords:

  • If the lock fails to sync the internal clock with the server time due to a power failure, this can cause the schedule for recurring access to not work properly.
  • Solution:
    • Add a backup battery to the lock to ensure it can still be connected to the cloud even after a power failure.
    • You can accept the problems that might arise.

Add temporary passwords

Data transmission
dp_id
(1 byte)
dp_type
(1 byte)
dp_data_len
(2 bytes)
dp_data_value
Send 5 raw len Type
(1 byte)
Validity period
(17 bytes)
Number of times
(1 byte)
Password length
(1 byte)
Password content
(n bytes)
Message UUID
(2 bytes)
0x00: Type 0
0x01: Type 1
See Appendix 1 Value range The bytes of a password
(used for unlocking with password only)
Description The unique ID of a message,
generated in the cloud,
is associated with message reporting.
Report 5 raw len Hardware ID
(2 bytes)
Return value
(1 byte)
Message UUID
(2 bytes)
0x0000 to 0xFFFE 0x00: Success.
0x01: Failure.
0x02: Hardware ID is assigned.
0x03: Repeated password.
0x0A: Weak password.
Same as above

Delete temporary passwords

Data transmission
dp_id
(1 byte)
dp_type
(1 byte)
dp_data_len
(2 bytes)
dp_data_value
Send 6 raw len Hardware ID
(2 bytes)
0x0000 to 0xFFFE
Report 6 raw len Hardware ID
(2 bytes)
Return value
(1 byte)
0x0000 to 0xFFFE 0x00: Success.
0x01: Failure.

Note: It is recommended to return 0x00
if a password does not exist locally.

Modify temporary passwords

Data transmission
dp_id
(1 byte)
dp_type
(1 byte)
dp_data_len
(2 bytes)
dp_data_value
Send 7 raw len Hardware ID
(2 bytes)
Type
(1 byte)
Validity period
(17 bytes)
Number of times
(1 byte)
Password length
(1 byte)
Password content
(n bytes)
0x0000 to 0xFFFE 0x00: Type 0
0x01: Type 1
See Appendix 1 Value range The bytes of a password
(used for unlocking with password only)
Description
Report 7 raw len Hardware ID
(2 bytes)
Return value
(1 byte)
0x0000 to 0xFFFE 0x00: Success.
0x01: Failure.

Manage remote unlocking

Key configuration

  • A key is required to use remote unlocking. Usually, after a successful initial pairing, the cloud will proactively send a key. Alternatively, when the MCU proactively reports DP 8 as a failure, the cloud will also issue a key. If the MCU does not receive a key after sending a request to the cloud, it can make multiple requests until the cloud issues a key.
  • After receiving the data of DP 8, the MCU processes and stores the received key and reports success to the cloud. When the lock receives a remote unlocking request, it uses the locally stored key for authentication, without requesting it from the cloud again.
  • The key for remote unlocking (DP 9) is configured through the command of setting keys for remote unlocking.
  • In this command, validity, key ID, start time, end time, and access times are reserved fields.
Data transmission
dp_id
(1 byte)
dp_type
(1 byte)
dp_data_len
(2 bytes)
dp_data_value
Send 8 raw len Validity
(1 byte)
Key ID
(2 bytes)
Start time
(4 bytes)
End time
(4 bytes)
Access times
(2 bytes)
Key
(8 bytes)
0x00: Invalid
0x01: Valid
Not enabled.
Only one key ID.
Current date and time
in Unix time
Expiration date and time
in Unix time
0x0000 to 0xFFFF
Defaults to 0, meaning the
key is valid permanently.
ASCII code
Report 8 raw len Return value
(1 byte)
Key ID
(2 bytes)
0x00: Success.
0x01: Failure.
Not enabled. Only one key ID.

Remote unlocking

Remote unlocking indicates the door is unlocked through a mobile app.

  • If the command is initiated by a mobile app, this is called remote unlocking by app.
  • If the command is initiated by a smart speaker, this is called remote unlocking by voice.
Data transmission
dp_id
(1 byte)
dp_type
(1 byte)
dp_data_len
(2 bytes)
dp_data_value
Send 9 raw len Feature
(1 byte)
Member ID
(2 bytes)
Key
(8 bytes)
Unlocking methods
(2 bytes)
Channel ID
(2 bytes)
0x00: Lock.
0x01: Unlock.
0x0001 to 0xFFFE ASCII code 0x0000: Remote unlocking by unknown methods.
0x0001: Remote unlocking by app.
0x0002: Remote unlocking by voice.
0x0003: Unlocking by a remote control.
0x0000 to 0xFFFF
Report 9 raw len Return value
(1 byte)
Member ID
(2 bytes)
Channel ID
(2 bytes)
0x00: Success.
0x01: Failure.
0x02: The key is invalid.
0x03: The access times run out.
0x04: The current time is not in the validity period.
0x05: Key comparison does not pass.
0x0001 to 0xFFFE Same as above.

Lock settings

General settings

Feature Data transmission dp_id
(1 byte)
dp_type
(1 byte)
dp_data_len
(2 bytes)
dp_data_value
Single/combined unlocking Send/Report 25 enum 0x01 Combined unlocking methods (1 byte)
0x00: Single unlocking method
0x01: Fingerprint + Password
0x02: Fingerprint + Door card
0x03: Fingerprint + Face
0x04: Password + Door card
0x05: Password + Face
0x06: Door card + Face
Alarm volume Send/Report 26 enum 0x01 Volume (1 byte)
0x00: Mute
0x01: Low
0x02: Medium
0x03: High
System language Send/Report 27 enum 0x01 Languages (1 byte)
0x00: Simplified Chinese
0x01: English
0x02: Japanese

0x09: Traditional Chinese
0x0A: Korean
Auto-locking delay Send/Report 31 value 0x04 Delay time (4 bytes)
Unit: Seconds
Auto-locking Send/Report 30 bool 0x01 Status (1 byte)
0x00: Turn off.
0x01: Turn on.
Unlocking speed Send/Report 32 enum 0x01 Unlocking speed
0x00: Low
0x01: Medium
0x02: High
Opening percentage Send/Report 33 value 0x04 Percentage (4 bytes)
Increment with a step of 5%.
Duration of alarm sound Send/Report 34 value 0x04 Duration (4 bytes)
The value ranges from 0 to 30 minutes,
defaulting to 3 minutes.

Always-on settings

Feature Data transmission dp_id
(1 byte)
dp_type
(1 byte)
dp_data_len
(2 bytes)
dp_data_value
Always-on toggle Send/Report 28 bool 0x01 Status (1 byte)
0x00: Turn off.
0x01: Turn on.
Always-on period Send/Report 29 raw len Validity (1 byte) Weekly schedule (1 byte) Number of time periods (1 byte) Time periods (n bytes)
0x00: Time-limited.
0x01: Permanent.
For more information,
see Appendix 1.
Number of time periods For more information,
see Appendix 3.

Call, image capture, and alert settings

  • Capture again: Tapping the retake button on the app panel will send the respective DP command to the device.
  • Voice prompts: Configure the multi-language support by yourself. When the user declines a remote unlocking request, the app panel sends the reason for declining to the device through the respective DP. The device plays the voice prompt based on the received DP value.
  • Alert dialog: When the device detects an alert, the user will be prompted to process it on the app panel. The user’s chosen action is then sent to the device via DP 39.
Feature Data transmission dp_id
(1 byte)
dp_type
(1 byte)
dp_data_len
(2 bytes)
dp_data_value
Remote unlocking request Send/Report 24 raw len Multi-channel call
See Appendix 2: Channel protocol.

Value sent from device to cloud:
0x00: Unlocking request

Value sent from cloud to device:
0x00: Unlock the door
0x01: Decline unlocking
Capture again Send/Report 36 bool 0x01 Specify whether to capture an image again (1 byte)
0x01: Yes
0x00: No
Voice prompts Send/Report 37 enum 0x01 The audio to play (1 byte)
0x00: The first audio clip.
0x01: The second audio clip.
0x02: The third audio clip.
0x03: The fourth audio clip.
0x04: The fifth audio clip.
0x05: The sixth audio clip.
Alert dialog Report 38 raw len Multi-channel alert
See Appendix 2: Channel protocol.

Valid values:
0x00: The alert is canceled locally.
0x01: An alert is triggered.
Cancel alert Send 39 raw len Multi-channel alert
See Appendix 2: Channel protocol.

Valid values:
0x00: Leave the alert as is.
0x01: Cancel the alert.
Report 39 raw len See Appendix 2: Channel protocol.

Valid values:
0x00: Failure.
0x01: Success.
0x02: Unknown. This might be because an invalid command is sent.
For example, when no alert has been triggered,
the app sends a command to cancel an alert.

Report real-time status

Feature Data transmission dp_id
(1 byte)
dp_type
(1 byte)
dp_data_len
(2 bytes)
dp_data_value
Door open/closed state Report 35 raw len Multi-channel state (n bytes)
See Appendix 2: Channel protocol.
Door state:
0x01: Door is open.
0x02: Door is closed.

Report records

Unlocking records

Record Type dp_id
(1 byte)
dp_type
(1 byte)
dp_data_len
(2 bytes)
dp_data_value
Unlock with fingerprint 10 raw 0x06 Hardware ID (4 bytes) Channel ID (2 bytes)
0x0000 to 0xFFFE 0x0000 to 0xFFFE
Default value: 0xFFFF
Unlock with password 11 raw 0x06 Hardware ID (4 bytes) Channel ID (2 bytes)
0x0000 to 0xFFFE Same as above.
Unlock with card 12 raw 0x06 Hardware ID (4 bytes) Channel ID (2 bytes)
0x0000 to 0xFFFE Same as above.
Unlock with a remote 14 raw 0x06 Hardware ID (4 bytes) Channel ID (2 bytes)
0x0000 to 0xFFFE
Default value: 0xFF
Same as above.
Unlock with face recognition 13 raw 0x06 Hardware ID (4 bytes) Channel ID (2 bytes)
0x0000 to 0xFFFE Same as above.
Unlock with offline password 17 raw 0x12 Offline password records Channel ID (2 bytes)
See the description of offline password records. Same as above.
Empty all offline passwords 19 raw 0x12 Offline password records Channel ID (2 bytes)
See the description of offline password records. Same as above.
Delete an offline password 21 raw 0x12 Offline password records Channel ID (2 bytes)
See the description of offline password records. Same as above.
Unlock with temporary password 16 raw 0x06 Hardware ID (4 bytes) Channel ID (2 bytes)
0x0000 to 0xFFFE Same as above.
Unlock remotely via app 22 raw 0x06 Member ID (4 bytes) Channel ID (2 bytes)
0x0000 to 0xFFFE Same as above.

Alert records

Data transmission
dp_id
(1 byte)
dp_type
(1 byte)
dp_data_len
(2 bytes)
dp_data_value
Report 23 raw 0x03 Alert enum (1 byte) Channel ID (2 bytes)
Value range 0x0000 to 0xFFFE
Default value: 0xFFFF

Combined unlocking records

Data transmission
dp_id
(1 byte)
dp_type
(1 byte)
dp_data_len
(2 bytes)
dp_data_value
Report 15 raw 0x09 Combined unlocking methods
(1 byte)
Unlocking method 1
(1 byte)
Hardware ID 1
(2 bytes)
Unlocking method 2
(1 byte)
Hardware ID 2
(2 bytes)
Channel ID (2 bytes)
0x00: Single locking method.
0x01: Combined unlocking method.
0x01: Password
0x02: Card
0x03: Fingerprint
0x04: Face
0x05: Palm print
0x06: Finger vein
0xF0: Temporary password
0x0000 to 0xFFFE
0x01: Password
0x02: Card
0x03: Fingerprint
0x04: Face
0x05: Palm print
0x06: Finger vein
0xF0: Temporary password
0x0000 to 0xFFFE
0x0000 to 0xFFFE

Algorithm-generated passwords

This section describes the offline passwords and dynamic passwords that are generated based on algorithms. How it works: The cloud and the lock run the same algorithm to generate and verify passwords. When the user enters the generated password, the lock unlocks the door if the password is verified successfully.

Offline password

  • Scenarios:

    The door lock user gets an offline password from the app and notifies the visitor of this password. The offline password can be the following types:

    • One-time password: It is valid for six hours and can be used only once. If the password is used within the validity period, an unlocking record is created.
    • Timed password: It must be used once within 24 hours for activation. Otherwise, it will expire. It can be used unlimited times within the specified validity period. Every unlocking operation is recorded.
    • The code to clear a single password: It has the same validity period as the corresponding password and takes effect only on the first-time usage. A record of clearing a single password is created after the code is used.
    • The code to clear all passwords: It is a one-time clear code and valid for 24 hours. A record of clearing all passwords is created after the code is used.
  • Limitations on clearing a single password or all passwords:

    • Only the activated and valid password can be cleared.
    • The one-time password cannot be cleared because it is invalid after use.
  • Usage: For more information, see Serial Communication Protocol. If you develop with the SDK, see the corresponding API reference.

Appendix

Appendix 1: Validity period

Byte Meaning Description Example
1 Start date
and time
4-byte unsigned integer

in big endian
Example:

123-456-789 (Unix timestamp) = 0x‭075BCD15 (hex)‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬
If the validity is permanent, the start date and time is 0x00000000.
7
2 5B
3 CD
4 15
5 End date
and time
4-byte unsigned integer

in big endian
Example:

999-999-999 (Unix timestamp) = 0x‭3B9AC9FF (hex)‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬
If the validity is permanent, the end date and time is 0x7FFFFFFF.
3B
6 9A
7 C9
8 FF
9 Recurring patterns 0x00: One-time 0x01: Daily schedule 0x02: Weekly schedule 0x03: Monthly schedule
10 Recurring bit 1 For a one-time schedule, 10 to 17 bytes are 0. Default to 0x00 Default to 0x00 Bit 7: Default to 0
Bit 6: The 31st of a month

Bit 0: The 25th of a month
11 Recurring bit 2 Default to 0x00 Default to 0x00 Bit 7: The 24th of a month

Bit 0: The 17th of a month
12 Recurring bit 3 Default to 0x00 Default to 0x00 Bit 7: The 16th of a month

Bit 0: The 9th of a month
13 Recurring bit 4 Default to 0x00 Bit 7: Default to 0
Bit 6: Saturday

Bit 1: Monday
Bit 0: Sunday

See the example of weekly schedules.
Bit 7: The 8th of a month

Bit 0: The 1st of a month
14 The start time 1 (hour) of the day Start time: 08:30 08 (decimal)
15 The start time 2 (minute) of the day 30 (decimal)
16 The end time 1 (hour) in a day End time: 20:30 20 (decimal)
17 The end time 2 (minute) in a day 30 (decimal)

Example of weekly schedules:

Bit 7: Reserved Bit 6: Saturday Bit 5: Friday Bit 4: Thursday Bit 3: Wednesday Bit 2: Tuesday Bit 1: Monday Bit 0: Sunday Value
0 0 1 0 1 0 1 0 0x2A
0 0 1 1 0 1 0 1 0x35
0 1 1 1 0 0 1 0 0x72
0 1 1 1 1 1 1 1 0x7F

When the user adds or modifies unlocking methods, the recurring validity period and the access times are both applied. There are two use cases:

  • When the access times are 0x00, this indicates permanent access. You only need to process the recurring pattern of the validity.
  • When the recurring pattern is 0x00, this indicates one-time access. You only need to process the access times.

For example, schedule a password to be valid every Monday to Friday from 08:00 to 08:30 from 2018-01-26 08:00:00 to 2018-08-08 09:56:32. The validity is 0x ‭5A6A6F80 5B6A4DD0 02 0000003E 0800 081E‬‬‬‬‬‬.

  • 2018-01-26 08:00:00 = 1516924800 (Unix timestamp) = 0x‭5A6A6F80‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬ (hex)
  • 2018-08-08 09:56:32 = 1533693392 (Unix timestamp) = 0x5B6A4DD0‬ (hex)
  • The recurring pattern: 0x02 indicates a weekly schedule.
  • Recurring bit 1 = Recurring bit 2 = Recurring bit 3 = 0x00
  • Recurring bit 4 = 0x3E (Monday to Friday)
  • The start time 1 is 0x08. The start time 2 is 0x00.
  • The end time 1 is 0x08. The end time 2 is 0x1E.

Appendix 2: Channel protocol

The multi-channel data format is defined as:

Total number of channels (1 byte) Channel 1 information (1+n bytes) Channel n information (1+n bytes)
0x00 to 0xFE Channel ID + channel value Channel ID + channel value

Field description:

  • Total number of channels (1 byte): Indicates the number of channels in the packet.
  • Current channel ID (1 byte): Starts from 0. For example, channel 1 and channel 2 correspond to the values of 0 and 1 respectively.
  • The value of the current channel: See the definition of the respective DP.

Example: A scene with 4 channels, with the value of a DP being one byte.

Scenes Value of channel 1 (1 byte) Value of channel 2 (1 byte) Value of channel 3 (1 byte) Value of channel 4 (1 byte) Data to report/send
Send the values of three channels to the device 0x21 No command to send 0x5B 0x0B Data sent to the device:
0x03 0x00 0x21 0x02 0x5B 0x03 0x0B

Appendix 3: Always-on time periods

Each time period is four bytes in size.

  • The first byte represents the hours of the start time.

  • The second byte represents the minutes of the start time.

  • The third byte represents the hours of the end time.

  • The fourth byte represents the minutes of the end time.

    For example, if the start time is 08:30 and the end time is 20:30, the always-on time period is 0x08 0x1E 0x14 0x1E.