Functions of smart residential locks

Last Updated on : 2024-06-21 03:32:30download

This topic describes how to configure the functions for an electronic smart lock with Zigbee technology, including network interconnection, power usage display, remote control, and so forth. However, the involved protocols and DPs (Data Point) are not mentioned, for more information, see General Docking Agreement for Zigbee.

Change log

Version Type Data Description
V1.0.0 New 2019.3.4 The first release.
V1.0.1 Revise 2020.3.2 Added how to restore factory settings.
Modified description about remote unlock.

Connect to network

To connect a smart lock to the network, a module can perform that independently without predefined DP.

Process

Before pairing a smart lock to the gateway, the gateway device must be connected by using app.

After the smart lock is connected, it transmits data, powers on the module, and waits for the module to return the network state. See the following picture for the connection process.

Functions of smart residential locks

Involved UART communication protocol:

  • 0x01: query the product information
  • 0x02: query the network status of module
  • 0x03: configure the Zigbee module

Battery percentage status

You can show the battery percentage of the devices.

DP setting

DP ID Name Description Range of DP value
10 Battery Show the current battery percentage of the device, unit: %.
The value is transmitted and updated in the following situations.
  • The device is connected for the first time or reconnected.
  • The device is restarted by replacing battery or other actions.
  • The battery power changes.
  • Periodically (for example, every 10 days) updated.
0~100

Involved UART communication protocol: 0x05, status reporting in the real time

Unlocking event record

The user can view the recorded unlocking history of the smart lock in the app.

However, you need to contact your account manager to use this function.

DP setting

DP ID Name Description Range of DP value
1 Fingerprint recognition The DP value can be used to distinguish the unlocker. 0~999
2 Password The DP value can be used to distinguish the unlocker. 0~999
3 Temporary password The DP value has no special meaning. 0~999
4 Dynamic password The DP value has no special meaning. 0~999
5 Key card The DP value can be used to distinguish the unlocker. 0~999
6 Facial recognition The DP value can be used to distinguish the unlocker. 0~999
7 Door key The DP value has no special meaning. 0~999
41 App unlocking The DP value has no special meaning. 0~999
44 Iris recognition The DP value can be used to distinguish the unlocker. 0~999
45 Palm print recognition The DP value can be used to distinguish the unlocker. 0~999
46 Finger vein recognition The DP value can be used to distinguish the unlocker. 0~999
  • Fingerprint recognition, password, key card, facial recognition, iris recognition, palm print recognition, finger vein recognition: the DP value is valid from 0 to 999 and used to distinguish the unlocker. When transmitted, the control panel of the app displays the information of the corresponding unlocker. For example, if the transmitted DP value of a password unlocking event is 1, and then 1 Password Unlocking is displayed on the control panel. You can associate the unlocking event with app member to extent the displayed information, for more information, see the following section Member management.

  • Temporary password, dynamic password, door key password, remote unlocking (app): the DP value is valid from 0 to 999 and has no special meaning. When transmitted, the control panel of the app only displays the information of the corresponding unlocking method. For example, if the transmitted DP value of a door key unlocking event is 25, and then Door Key Unlocking is displayed on the control panel.

Process

When the door is successfully unlocked, the function name of the unlocking method is transmitted. To guarantee the consistency of the log with the actual unlocking event, Tuya Smart recommends that you use record type to transmit data, for more information, see the format of 0x23 command in the Universal Docking Agreement.

The module of a disconnected device stores the data that are failed to be transmitted, and re-transmits them together the next time, the time information of recorded data is determined by the local time of the device.

Unlocking method Function name Range of DP value Sample of DP value
Fingerprint recognition Fingerprint Unlock Actual value 1
Password Password Actual value 2
Temporary password Temporary Password Any values are okay 3
Dynamic password Dynamic Password Any values are okay 4
Key card Card Actual value 5
Facial recognition Face Actual value 6
Door key Key Any values are okay 7
Remote unlocking (app) App Unlock Any values are okay 8
Iris recognition Iris Unlock Actual value 9
Palm print recognition Palm Unlock Actual value 0
Finger vein recognition Finger Vein Unlock Actual value 999

See the following picture for the process.

Functions of smart residential locks

Involved UART communication protocol: 0x23, data transmission in the record type

Member management

App members comprise family members and visitor members.

  • To become a family member, the user must have an app account and be invited by the device owner.
  • A visitor member can be added without an app account. Visitor member is used to record the door lock and opening operation, and he or she cannot use the method of dynamic password, temporary password, and remote unlocking.

When adding members on the app, the user must assign them with unlocking methods. For example, the user adds the member Tester and assigns the Fingerprint 3 to Tester. When the device transmits the door unlocking information of Fingerprint 3, the app displays Tester, fingerprint recognized. If the Fingerprint 3 is not assigned to members, the app displays 3 Fingerprint Unlocking.

Process

Functions of smart residential locks

Message and alarm

When the door lock alarm is triggered, the app can notify the alarm in time and the user can view the alarm record.

However, to use this function, you need to contact your Tuya account manager.

DP setting

DP ID Name Description Range of DP value
9 Alarm An alarm can be declared when non-matching of fingerprints, passwords, key card, facial password, or door key happens, and when high temperature alarm, door opening timeout alarm, electronic latch not ejected, anti-pry alarm, the detection of door key, or low power alarm is triggered. wrong_finger, wrong_password, wrong_card, wrong_face, tongue_bad, too_hot, unclosed_time, tongue_not_out, pry, key_in, low_battery, power_off, shock
14 Doorbell It can be used when the door is equipped with the doorbell capacity. {0,1}
35 Hijack Alarm It can be used when the door is equipped with the hijack alarm capacity. A hijacking alarm is issued from the cloud rather than device. For example, if user sets the Fingerprint 3 as the hijacking alarm trigger, the alarm will be triggered when the server side received the unlocking event of Fingerprint 3. {0,1}

Process

When the alarm is triggered, the MCU transmits the corresponding alarm DP value.

Note: it is recommended to use the time of the local device when transmitting the data in the record type. If the device time lags behind the actual time, the alarm icon on the app does not flash when the alarm data is received, but the user can click and view the alarm record. However, if the timestamp of the alarm relies on the server time, the device will be connected to the Internet again after the network is disconnected, at this time, the app shows that the record time does not conform to the actual event.

See the following picture for the interaction process of an alarm.

Functions of smart residential locks

See the following picture for the interaction process of a hijacking alarm.

Functions of smart residential locks

Involved UART communication protocol: 0x23, data transmission in the record type

Remote control on App

The user can remotely unlock the door with password and without password by using an App.

DP setting

DP ID Name Description Range of DP value
21 App Unlock Within Password A password is required when the door is remotely unlocked on app. The DP value is received by the MCU from the module. The password that is configured by the user on the app
22 Answer App It is used in cooperation with the remote door opening instruction including the App Unlock Within Password, Set Key For Remote Unlock, and Remote Unlock With No Password (new). When the MCU receives remote control request from the app, the smart lock determines whether to open the door or not and transmits the DP value to the cloud. {0,1}
23 Forbidden App Unlock To disable the remote control function, the relevant feature must be pre-defined by the app. After disabling the remote control function, the user cannot unlock the door by using the app. {0,1}
41 App Unlock See the section Unlocking event record. 0~999
48 Set Key For Remote Unlock The user can disable or enable the secret key. If the user sets all accounts to be secret key free, the control panel calls HTTP interface to transmit Set Key For Remote Unlock of DP 48 to MCU. If the user chooses the Forbidden App Unlock or App Unlock Within Password, the control panel calls HTTP interface to transmit DP 48 to make the password free key invalid. The key is removed when the smart lock is restored to the factory settings. The secret key that is created by the Tuya cloud platform
49 Remote Unlock With No Password (new) The user does not need to enter password when unlocking the door on app. The DP value is received by the MCU from the module. The secret key that is created by the Tuya cloud platform

Process

The user sends a remote control from the app, and the smart lock verifies its validity after receiving the request, controls the locking status, and gives feedback to the control command.

Functions of smart residential locks

Dynamic password

The user generates a dynamic password on the app. Within the valid time (5 minutes), visitors can input the dynamic password on the smart lock to open the door.

Process

  1. The dynamic password is created on the app.
  2. The unlocker inputs a password on the smart lock.
  3. The module of smart lock verifies the dynamic password.
  4. The smart lock responds to the verification result by accepting or rejecting the unlocking request.

A dynamic password is a temporary password that is independent from the network. The authentication method of a dynamic password depends on the encrypted algorithm. When the smart lock receives a password suspected to be a dynamic password, the password, the current time, and the administrator password are transmitted to the Tuya module. The module performs the decryption of the received data in combination with the initial secret key saved by the module, and compares the password obtained after the decryption with the password entered by the user. If the two password is consistent, the module tells MCU to unlock the door. Otherwise, the unlocking operation is denied.

Functions of smart residential locks

Involved UART communication protocol: 0x23, querying the dynamic password

Temporary password

The user sets a temporary password on the app, within the valid period, visitors can input the temporary password on the smart lock to open the door.

DP setting

DP ID Name Description
24 Create Temporary Password It is transmitted when the temporary password is created on app.
25 Delete Temporary Password It is transmitted when the temporary password is deleted on app.
26 Update Temporary Password It is transmitted when the password or validity period of the temporary password is modified on app.
27 Frozen Temporary Password It is transmitted when the temporary password is frozen on app. A frozen temporary password can be resumed.
28 Unfreeze Temporary Password It is transmitted when a frozen temporary password is resumed on app.
39 Reset Temporary Password It is used to restore the smart lock to factory setting and clear all temporary passwords. When the door lock is restored to the factory settings, the cloud makes a request to the smart lock to clear the local temporary password, after the restoration is completed, the cloud receives the temporary password status that are transmitted by the module. In case of network failure, the module transmits the result again when it is connected the next time.

Status of temporary password

  • Configuring: the temporary password is transmitted from the cloud to the device, but no feedback is given.

Note: the module queries the temporary passwords that are in configuring status every hour or when the Zigbee gateway is connected. Once detected, the device updates the temporary password. However, the user can use app to proactively query the password (by calling APIs) when click the drop-down list of password.

  • Ineffective: the temporary password does not reach the valid period.

  • Effective: the temporary password is in use and there are more than 7 days from expiration.

  • Expiring soon: the temporary password is in used and there are less than 7 days from expiration.

  • Frozen: the temporary password is frozen on the app. If the password exceeds the validity period, the app cannot resume the password.

  • Inactive: the password is expired.

  • Deleted: the password is deleted on the app.

See the following picture for the relationship of the preceding status.

Functions of smart residential locks

Process

A temporary password is only valid in a specific period. After the temporary password is created on the app, the cloud sends it to the smart lock, the password and the period of validity is stored in the smart lock. The temporary password is used within the valid period before the smart lock deletes or modifies it. The creation, deletion, and modification of the smart lock is dependent on the network availability.

The following picture illustrates how to create a temporary password.

Functions of smart residential locks

Factory setting restoration

Both the app and the smart lock can be restored to the factory default setting. This section takes the clearance and creation of temporary password as an example to describe the interaction process during the factory setting restoration.

Restore the app to factory setting

The following procedure describes the interaction process of the Tuya Smart App after restored to the factory default setting.

  1. The user resets the app.
  2. The cloud clears all the temporary password, recorded unlocking history, and other information.
  3. The cloud sends the temporary password clearance command of DP 39 to smart lock.
    • If the the DP 39 command is received, the smart lock clears the temporary password and returns an ACK to notify the cloud about the reception of DP 39.
    • If the DP 39 command is not received due to network disconnection, the cloud proactively sends the command again when the network connection between the smart lock and the cloud resumes. And the smart lock clears the temporary password and returns an ACK to notify the cloud about the reception of DP 39.

Taking the creation of temporary password as an example, the following procedure describes the interaction process of the Tuya Smart App after the device is reset to the factory setting.

  1. The smart lock is connected again after the restoration.
  2. The user creates a temporary password on app.
  3. The cloud checks the ACK confirmation from the device to determine if the devices has cleared the previous temporary password.
    • If the device has cleared the temporary password and returned an ACK, the cloud allows the app to create temporary password.
    • If the device does not clear the temporary password and return an ACK, the cloud transmits the DP 39 command to the device first, and waits for the ACK.

The following picture illustrates the process of the preceding description.

Functions of smart residential locks

Restore the smart lock to factory setting

A smart lock must transmit the DP 39 to the cloud after factory setting restoration and temporary password clearance.

  • If the cloud cannot receive the DP 39 because of network connection exception, the temporary password and unlocking history keep stored in the cloud, and the device must transmit the DP 39 again after the network connection is resumed.

  • If the cloud receives the DP 39 successfully, the smart lock will be unbound with the app, the temporary password and unlocking history will be erased in the cloud. When the device is connected next time, the the temporary password and unlocking history in the app will be erased.

The following picture illustrates the process of the preceding description.

Functions of smart residential locks