Wi-Fi Lock Pro Data Point Reference

Last Updated on : 2024-06-21 03:44:09download

This topic describes the features, formats, and usages of data points (DPs) that apply to Wi-Fi lock Pro and Wi-Fi camera lock.

Background

Terms

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

Term Explanation
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 1-byte unsigned integer assigned and managed by the server. The valid values range from 0x01 to 0x64. The rest are reserved.
Hardware ID The ID of the hardware specific to an unlocking method, which is a 1-byte unsigned integer assigned and managed by the local processor. The valid values range from 0x00 to 0xFE. 0xFF is reserved. For example, for fingerprint unlocking and password unlocking, the hardware ID is 0x01 and 0x02 respectively.
Validity period A specific unlocking method (such as fingerprint and password) is valid during the specified time period.
Auto
lock
The amount of time before the door is auto-locked. The time period can be configured.
Duress
alarm
If the user enables duress alarms for an unlocking method such as password and fingerprint, unlocking with that method will report a record to the cloud and send an alert to the contact via phone call or SMS.
Cloud-to-device messaging Data is sent from the mobile phone to the cloud and finally to the Wi-Fi device.
Device-to-cloud messaging Data is sent from the Wi-Fi device to the cloud and finally to the mobile phone.

DP format

The size of dp_data_len is two bytes for Wi-Fi locks. 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

Add unlocking methods remotely

The process of adding an unlocking method remotely

  • The user initiates adding an unlocking method from the mobile app. Generally, the user is asked to enter 6+# to wake up the Wi-Fi module.
  • After the Wi-Fi module gets online, the MCU sends DP 34 to the module to query the unlocking method to be added. Data flow: MCU > module > cloud.
  • The cloud responds to the request through DP 35. Data flow: cloud > module > MCU.
  • After the lock enrolls the specified unlocking method, it reports the result to the cloud through DP 62. Data flow: MCU > module > cloud.
  • After the cloud receives the message, it returns the response through DP 37. Data flow: cloud > module > MCU.

Associate an unlocking method with a capability

  • Associate an unlocking method with a feature. For example, capture images when someone unlocks the door with a fingerprint.
  • Enable the user to choose whether to associate an unlocking method with image or video capture. The association command is sent to the lock through DP 60.
  • After the lock processes the association, it returns the association result through DP 62 (Action: 0x01 for associating local lock capability).
Feature Data transmission dp_id
(1 byte)
dp_type
(1 byte)
dp_data_len
(2 bytes)
dp_data_value
Query added method Device-to-cloud 34 Boolean 0x01 Query status (1 byte)
0x00: Invalid
0x01: Valid
Added method Cloud-to-device 35 Enum 0x01 Unlocking methods (1 byte)
0x00: Fingerprint
0x01: Card
0x02: Password
0x03: Admin fingerprint
0x04: Admin card
0x05: Admin password
Added Cloud-to-device 37 Boolean 0x01 Result (1 byte)
0x00: Failure
0x01: Success
Cancel remote adding Bidirectional 42 Boolean 0x01 Status (1 byte)
0x00: Failure
0x01: Success
Added Device-to-cloud 62 Raw 0x05 Action
(1 byte)
Hardware ID
(2 bytes)
Enrollment result
(1 byte)
Association result
(1 byte)
Description Hardware ID Enrollment result Association result
Associate local lock capability Cloud-to-device 60 Raw 0x04 Association
(1 byte)
Unlocking method
(1 byte)
Hardware ID
(2 bytes)
Association 0x00: Password
0x01: Fingerprint
0x02: Card
0x03: Face
0x04: Finger vein
0x05: Palm print
0x06: Iris
0x0000 to 0x03E7
(0 to 999, in decimal)

Delete unlocking methods remotely

  • On the mobile app, the user opens the lock member list, swipes the target unlocking method to the left, and deletes it. Generally, they are asked to enter 5+# to wake up the Wi-Fi module.
  • After the Wi-Fi module gets online, the MCU sends DP 38 to the module to allow the deletion. Data flow: MCU > module > cloud.
  • The cloud sends the unlocking method and hardware ID to the lock. Data flow: cloud > module > MCU.
  • After the lock deletes the specified unlocking method, it reports the result to the cloud through DP 40. Data flow: MCU > module > cloud.
Feature Data transmission dp_id
(1 byte)
dp_type
(1 byte)
dp_data_len
(2 bytes)
dp_data_value
Remote deletion allowed Device-to-cloud 38 Boolean 0x01 Whether to allow deletion (1 byte)
0x00: Deny
0x01: Allow
Remotely delete fingerprint Cloud-to-device 39 Value 0x04 Hardware ID (4 bytes)
0x00 to 0xFE
Remotely delete code Cloud-to-device 41 Value 0x04 Hardware ID (4 bytes)
0x00 to 0xFE
Remotely delete card Cloud-to-device 43 Value 0x04 Hardware ID (4 bytes)
0x00 to 0xFE
Remotely delete face Cloud-to-device 51 Value 0x04 Hardware ID (4 bytes)
0x00 to 0xFE
Remotely delete finger vein Cloud-to-device 52 Value 0x04 Hardware ID (4 bytes)
0x00 to 0xFE
Remotely delete palm print Cloud-to-device 53 Value 0x04 Hardware ID (4 bytes)
0x00 to 0xFE
Remotely delete iris Cloud-to-device 54 Value 0x04 Hardware ID (4 bytes)
0x00 to 0xFE
Remotely delete response Device-to-cloud 40 Boolean 0x01 Status (1 byte)
0x00: Deletion failed.
0x01: Deletion succeeded.

Report deletion permission

When the user attempts to delete a non-deletable admin unlocking method, the lock reports data consisting of the key type, admin type, action permission, and the key ID through this DP. The mobile app marks the key ID as non-deletable.

Data
transmission
dp_id
(1 byte)
dp_type
(1 byte)
dp_data_len
(2 bytes)
dp_data_value
Device-to-cloud 61 Raw len Unlocking method
(1 byte)
ID type
(1 byte)
Permission
(1 byte)
Hardware ID
(2 bytes)
0x00: Password
0x01: Fingerprint
0x02: Card
0x03: Face
0x04: Finger vein
0x05: Palm print
0x06: Iris
0x00: Default, with no action performed.
0x01: Super admin.
0x02: Normal admin.
0x00: Non-deletable.
0x01: Deletable.
0x0000 to 0x03E7
(0 to 999, in decimal)

Synchronize unlocking methods

Encoding

  • The data to synchronize takes the format of partition ID + local unlocking method bitmap. A partition has two bytes.
    • The partition ID ranges from 1 to 125.
    • A single partition can store eight unlocking methods, with the validity represented by a bit (1 for valid, 0 for invalid).
    • A total of up to 1,000 (125 × 8 = 1,000) local unlocking methods can be synchronized. Valid values range from 0 to 999.
    • To reduce the payload size, if a partition stores no unlocking method, there is no need to upload it.
    • Conversion operations
      • Partition ID = (local unlocking method ID ÷ 8) + 1
      • Bit = (local unlocking method ID % 8)
      • Bitmap |= (1 << bit)
  • When the lock deletes all the locally stored unlocking methods, the encoded data is represented by 00 00.
Partition#1 (2 bytes) Partition#2 (2 bytes) Partition#3 (2 bytes) Partition#n (2 bytes)
Partition ID 1 Bitmap 1 Partition ID 2 Bitmap 2 Partition ID 3 Bitmap 3 Partition ID n Bitmap n

Example

Suppose that the encoded data is 0x01 0x03 0x02 0x01 0x21 0x01. It is parsed as follows:

  • 01 03: 00000001 00000011 indicates partition 1 stores unlocking methods 0 and 1 and the actual unlocking method ID is 0 and 1 respectively.

  • 02 01: 00000010 00000001 indicates partition 2 stores unlocking method 0 and the actual unlocking method ID is 8 = (partition − 1) × 8.

  • 21 01: 00100001 00000001 indicates partition 33 stores unlocking method 0 and the actual unlocking method ID is 256 = (partition − 1) × 8.

Protocol

Feature Data transmission dp_id
(1 byte)
dp_type
(1 byte)
dp_data_len
(2 bytes)
dp_data_value
Synchronize
all fingerprints
Device-to-cloud 25 Raw len Data to sync (n bytes)
See Encoding description.
Synchronize
all codes
Device-to-cloud 26 Raw len Data to sync (n bytes)
See Encoding description.
Synchronize
all cards
Device-to-cloud 27 Raw len Data to sync (n bytes)
See Encoding description.
Synchronize
all faces
Device-to-cloud 28 Raw len Data to sync (n bytes)
See Encoding description.
Synchronize
all irises
Device-to-cloud 29 Raw len Data to sync (n bytes)
See Encoding description.
Synchronize
all palm prints
Device-to-cloud 30 Raw len Data to sync (n bytes)
See Encoding description.
Synchronize
all finger veins
Device-to-cloud 31 Raw len Data to sync (n bytes)
See Encoding description.

Manage remote unlocking

Key configuration

  • A key is required to use remote unlocking. After the lock is paired for the first time, the MCU can proactively report a failure of DP 49 to request the key from the cloud. If the cloud does not return the key, the MCU can repeat the request until receiving the key.

  • After receiving the data of DP 49, 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 50) 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.

    To enhance security, the key for remote unlocking is updated occasionally. The cloud determines the update rule. After the key expires or has been used a specified number of times, the cloud sends a new key to the lock through the DP of configuring keys. The MCU should update the key locally and report success to the cloud.

Data
transmission
dp_id
(1 byte)
dp_type
(1 byte)
dp_data_len
(2 bytes)
dp_data_value
Cloud-to-device 49 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
Device-to-cloud 49 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 with the control command directly from the cloud.

  • If the command is initiated by a mobile app over the cloud, this is called remote unlocking by app.
  • If the command is initiated by a smart speaker over the cloud, 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
Cloud-to-device 50 Raw len Feature (1 byte)
Member ID
(2 bytes)
Key
(8 bytes)
Unlocking methods
(2 bytes)
0x00: Lock.
0x01: Unlock.
0x00 to 0xFE ASCII code 0x0000: Remote unlocking by unknown methods.
0x0001: Remote unlocking by app.
0x0002: Remote unlocking by voice.
Device-to-cloud 50 Raw len Return value
(1 byte)
Member ID
(2 bytes)
0x00: Success.
0x01: Failure.
0x02: The key ID does not exist.
0x03: The key comparison failed.
0x00 to 0xFE

Remote unlocking request

When a visitor presses the doorbell, an unlocking request will be pushed to the mobile phone. The user can tap the notification to navigate to the mobile app and check the identity of the visitor with the captured image or video talk. The user can then accept or reject the remote unlocking request on the app.

  • The MCU reports data in descending order. It is recommended to set the reporting frequency to one second. The value 0 means to disable remote unlocking.
  • When the app panel receives a timer count of 0, it ends remote unlocking.
  • The MCU should report the timer count of 0 to finish a remote unlocking request, regardless of whether remote unlocking is accepted or rejected.
Data transmission dp_id
(1 byte)
dp_type
(1 byte)
dp_data_len
(2 bytes)
dp_data_value
Device-to-cloud 9 Value 0x04 Timer count (4 bytes)
0x5A to 0x00
in seconds

Alerting with snapshot

The lock sends an alert with a snapshot or a video talk request to the phone for loitering outside the door or unauthorized entry attempts. The user can also view the image or video logs of events from the app anytime.

Data transmission dp_id
(1 byte)
dp_type
(1 byte)
dp_data_len
(2 bytes)
dp_data_value
Device-to-cloud 45 Value 0x04 Timer count (4 bytes)
0x5A to 0x00
in seconds
Cloud-to-device 46 Boolean 0x01 Response for alerts (1 byte)
0x00: Invalid.
0x01: Close the pop-up window.

Live video request

Data
transmission
dp_id
(1 byte)
dp_type
(1 byte)
dp_data_len
(2 bytes)
dp_data_value
Device-to-cloud 63 Raw len Action
(1 byte)
Pop-up window type
(1 byte)
Media payload
(1 byte)
Video talk
(1 byte)
Video duration
(1 byte)
0x00: Open the pop-up window.
0x01: Close the pop-up window.
0x00: Remote unlocking.
0x01: Alerting.
0x00: No audio included.
0x01: Audio included.
0x02: Image capture included.
0x00: One-way talk.
0x01: Two-way talk.
0x00: One minute.
0x01: Three minutes.
Cloud-to-device 63 Raw len Response type
(1 byte)
Response content
(1 byte)
0x03: Video streaming starts.
0x01: The pop-up window is closed. (Powering off the lock is recommended.)
0x02: Video streaming is finished. (The pop-up window stays for further action.)
0x00: Default action.
0x01: Video streaming is finished as expected.
0x02: Video streaming is finished due to the free quota being exceeded.
0x03: Video streaming is finished due to an error.

Report real-time status

Feature Data transmission dp_id
(1 byte)
dp_type
(1 byte)
dp_data_len
(2 bytes)
dp_data_value
Battery level or remaining battery Device-to-cloud 11 Enum len Battery level (1 byte)
0x00: High.
0x01: Medium.
0x02: Low.
0x03: Completely drained or to be drained.
Battery level Device-to-cloud 12 Value len Battery level (4 bytes)
0x00 to 0x64
Double locking state Device-to-cloud 13 Boolean len Status (1 byte)
0x00: Not double locked
0x01: Double locked
Child lock Device-to-cloud 14 Boolean len Status (1 byte)
0x00: Child lock is off.
0x01: Child lock is on.
Lift-up double locking Device-to-cloud 21 Boolean len Status (1 byte)
0x00: Not double locked by lifting up the handle
0x01: Double locked by lifting up the handle
Door open/closed state Device-to-cloud 18 Enum len Status (1 byte)
0x00: Unknown
0x01: Door is open.
0x02: Door is closed.
Locking/unlocking state Device-to-cloud 55 Boolean len Status (1 byte)
0x00: Locked
0x01: Unlocked

Report records

Unlocking records

Feature Data transmission dp_id
(1 byte)
dp_type
(1 byte)
dp_data_len
(2 bytes)
dp_data_value
Unlock with fingerprint Device-to-cloud 1 Value len Hardware ID (4 bytes)
0x00 to 0xFE
Unlock with password Device-to-cloud 2 Value len Hardware ID (4 bytes)
0x00 to 0xFE
Unlock with temporary password Device-to-cloud 3 Value len Hardware ID (4 bytes)
0x00 to 0xFE
Unlock with card Device-to-cloud 5 Value len Hardware ID (4 bytes)
0x00 to 0xFE
Unlock with face Device-to-cloud 6 Value len Hardware ID (4 bytes)
0x00 to 0xFE
Unlock with mechanical key Device-to-cloud 7 Value len Hardware ID (4 bytes)
0x00 to 0xFE
Set it to 0 by default
Unlock with iris Device-to-cloud 22 Value len Hardware ID (4 bytes)
0x00 to 0xFE
Unlock with palm print Device-to-cloud 23 Value len Hardware ID (4 bytes)
0x00 to 0xFE
Unlock with finger vein Device-to-cloud 24 Value len Hardware ID (4 bytes)
0x00 to 0xFE
Unlock remotely via app Device-to-cloud 15 Value len Member ID (4 bytes)
0x00 to 0x64
Unlock from inside Device-to-cloud 17 Boolean len Fixed value (1 byte)
0x00
Doorbell call Device-to-cloud 19 Boolean len Status (1 byte)
0x00: No event.
0x01: Doorbell call.

Alert records

Data transmission dp_id
(1 byte)
dp_type
(1 byte)
dp_data_len
(2 bytes)
dp_data_value
Device-to-cloud 8 Enum 0x01 Alerts (1 byte)
Value range

Locking records

Data transmission dp_id
(1 byte)
dp_type
(1 byte)
dp_data_len
(2 bytes)
dp_data_value
Device-to-cloud 57 Raw 0x05 Locking methods
(1 byte)
Member ID (4 bytes)
0x00: Locking by undefined methods
0x01: Remote locking by app
0x02: Remote locking by voice
0x03: Geofencing-based locking
0x04: Locking by app
0x05: Locking by using accessory
0x06: Auto-locking
0x07: Manual locking
0x01 to 0x64

Combined unlocking records

Data transmission dp_id
(1 byte)
dp_type
(1 byte)
dp_data_len
(2 bytes)
dp_data_value
Device-to-cloud 44 Raw 0x07 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)
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
0 to 999
(decimal)
0x01: Password
0x02: Card
0x03: Fingerprint
0x04: Face
0x05: Palm print
0x06: Finger vein
0xF0: Temporary password
0 to 999
(decimal)

Local operation records

  • GA 374 Electronic Lock Standard specifies that the networked electronic anti-theft lock should upload events of operations on the lock body to the server. These events include unlocking the door, adding or deleting a user, unsuccessful entry attempts, and tamper alarms.
  • To comply with the standard, you can use the protocol below to report the required data to the Tuya Developer Platform.
Data transmission dp_id
(1 byte)
dp_type
(1 byte)
dp_data_len
(2 bytes)
dp_data_value
Device-to-cloud 70 Raw len Proactive action
Member type
(1 type)
Proactive action
Member ID
(2 types)
Action classification
(1 byte)
Action type
(1 byte)
Data length
(1 byte)
Action details
(n byte)
Passive action
Member type
(1 byte)
Passive action
Member ID
(2 bytes)
0x00: Super admin.
0x01: Admin.
0x02: Special member.
Defaults to 0xFFFF
Valid values: 0x0000 to 0xFFFE
Unlocking methods:
0x00: Add an unlocking method.
0x01: Delete an unlocking method.
0x02: Modify an unlocking method.
Actions on users:
0x10: Add a user.
0x11: Delete a user.
Local settings:
0x20: Local setting.
Description n+3
Total length of
all subsequent data
Description Default value: 0xFF

0x00: Super admin.
0x01: Admin.
0x02: Special member.
0x03: Ordinary member.
Defaults to 0xFFFF

Valid values:
0x0000 to 0xFFFE

Lock settings

The app panel does not support some DPs of setting type. The actual capabilities provided by the generic panel prevail.

Feature Data transmission dp_id
(1 byte)
dp_type
(1 byte)
dp_data_len
(2 bytes)
dp_data_value
Arm away Cloud-to-device/device-to-cloud 10 Boolean len On/off (1 byte)
0x00: Turn off.
0x01: Turn on.
Capture again Cloud-to-device/device-to-cloud 47 Boolean len Status (1 byte)
0x01: Capture again
Forced double lock Cloud-to-device/device-to-cloud 48 Boolean len Status (1 byte)
0x01: Forced double locking
Set camera mode Cloud-to-device/device-to-cloud 56 Enum len Status (1 byte)
Description
Auto-locking Cloud-to-device/device-to-cloud 68 Boolean len On/off (1 byte)
0x00: Turn off.
0x01: Turn on.
Auto-locking timer Cloud-to-device/device-to-cloud 69 Value len Delay time (4 bytes)
1 to 1800
in seconds
Motor rotation Cloud-to-device/device-to-cloud 65 Enum len Rotation direction (1 byte)
0x00: Clockwise.
0x01: Counterclockwise.
Fill light Cloud-to-device/device-to-cloud 76 Boolean len On/off (1 byte)
0x00: Turn off.
0x01: Turn on.
Lock always on Cloud-to-device/device-to-cloud 58 Boolean len On/off (1 byte)
0x00: Turn off.
0x01: Turn on.
Set always on period Cloud-to-device/device-to-cloud 59 Raw len Validity period
(1 byte)
Weekly schedule
(1 byte)
Number of time periods
(1 byte)
Time periods
(n bytes)
0x00: Non-permanent.
0x01: Permanent (default)
Description Count Time period

Custom functions

Three DPs are available to be customized to your needs.

Feature Data transmission dp_id
(1 byte)
dp_type
(1 byte)
dp_data_len
(2 bytes)
dp_data_value
User guide Cloud-to-device 64 Raw len Feature (1 byte)
0x00: Feature 0
0x01: Feature 1
Device-to-cloud 64 Raw len Feature (1 byte) Return value (1 byte)
0x00: Feature 0
0x01: Feature 1
0x00: Success.
0x01: Failure.

Special on/off control Cloud-to-device/device-to-cloud 66 Boolean len On/off (1 byte)
0x00: Turn off.
0x01: Turn on.
Special control duration Cloud-to-device/device-to-cloud 67 Value len Duration (s) (4 bytes)
0x00000001 to 0xFFFFFFFF

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 passwords and verify passwords. When the user enters the generated password, the lock unlocks the door if the password is verified successfully.

Dynamic password

The local lock and the cloud have an identical set of algorithms stored to generate dynamic passwords, with the only difference in the Unix timestamp. If the Unix timestamp offset between the local clock and the cloud is less than 300 seconds (± 5 minutes), it is considered that the dynamic password generated by the lock and the cloud is identical, and the lock executes the unlocking command.

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.

Related protocols

Feature Data transmission dp_id
(1 byte)
dp_type
(1 byte)
dp_data_len
(2 bytes)
dp_data_value
Offline password
unlocking records
Device-to-cloud 32 Raw len Result from module (16 bytes)
See the description.
Offline password
Clearing records
Device-to-cloud 33 Raw len Result from module (16 bytes)
See the description.

Cloud-based DPs

Feature Data transmission dp_id
(1 byte)
dp_type
(1 byte)
dp_data_len
(2 bytes)
dp_data_value
SMS motification None 20 Boolean len None
Duress alarm None 16 Boolean len None

Appendix

Validity period

Byte(s) Meaning Description Example
1 Start time Unsigned integer Data is four bytes long,
stored in big-endian format.
Example:
123-456-789 (Unix timestamp) = 0x‭075BCD15 (hex)‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬
If the validity is permanent, the start time is 0x386CD300.
07
2 5B
3 CD
4 15
5 End time Unsigned integer Data is four bytes long,
stored in big-endian format.
Example:
999-999-999 (Unix timestamp) = 0x‭3B9AC9FF (hex)‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬
If the validity is permanent, the end time is 0x72BC9B7F.
3B
6 9A
7 C9
8 FF
9 The recurring patterns: 0x00: One-time 0x01: Daily schedule 0x02: Weekly schedule 0x03: Monthly schedule
10 Recurring flag 1 For a one-time schedule,
10 to 17 bytes are 0.
This field defaults
to 0x00.
This field defaults
to 0x00.
Bit 7: Default to 0
Bit 6: The 31st of a month

Bit 0: The 25th of a month
11 Recurring flag 2 This field defaults
to 0x00.
This field defaults
to 0x00.
Bit 7: The 24th of a month

Bit 0: The 17th of a month
12 Recurring flag 3 This field defaults
to 0x00.
This field defaults
to 0x00.
Bit 7: The 16th of a month

Bit 0: The 9th of a month
13 Recurring flag 4 This field defaults
to 0x00.
Bit 7: Default to 0
Bit 6: Saturday

Bit 1: Monday
Bit 0: Sunday
Bit 7: The 8th of a month

Bit 0: The 1st of a month
14 The start time 1 (hour) in a day Start time: 08:30 08 (decimal)
15 The start time 2 (minute) in a 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)

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 weekly schedule.
  • Recurring flag 1 = Recurring flag 2 = Recurring flag 3 = 0x00
  • Recurring flag 4 = 0x3E (from 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.

Weekly schedule

Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0
Reserved Saturday Friday Thursday Wednesday Tuesday Monday Sunday