Last Updated on : 2024-06-21 03:32:11
For first-time pairing or pairing again after a device is removed, you do not need to manually set the data points (DPs).
To add a sub-device, you need to pair the gateway with the mobile app, such as Tuya Smart app or Smart Life app. Then, the Zigbee locks can be added to the gateway as sub-devices to connect to the cloud. For more information, see How to add Zigbee devices to the mobile app.
After successful pairing, power on the module to transmit data and wait for the server connection result returned from the module.
The data transmission is as follows.
0x01
: Query product information.0x02
: Query network status.0x03
: Configure the Zigbee module.Battery level, door sensor, anti-lock state, and deadbolt state are the lock information. When lock information changes, the MCU must report it to the Zigbee module.
Residual electricity: Display remaining battery level percentage, ranging from 0 to 100.
Door sensor status report, anti lock state, deadbolt state, and language switch are enum data types.
Doorbell volume is enum data types, including mute, low, normal, and high.
The DP 32 get lock status is used to return all the lock information or individual state to the query sent from the mobile app.
The MCU reports the battery level in the following scenarios:
0x05
is used for the MCU to proactively report lock status.View the unlocking record on the app.
Unlock by temporary password, card, fingerprint, and identity card: The DP values are used to distinguish members. Valid values: 0
to 999
. The unlocking records are displayed on the app and show member information in each entry.
Unlock by dynamic password: The DP values do not have a special meaning. Valid values: 0
to 999
. The unlocking records are displayed on the app and do not show member information in each entry.
Unlock by admin password and sub-admin password: The admin role (ID 1) and sub-admin role (ID 2) can only be held by one user.
Unlocking event: The MCU must report an unlocking event as long as the door is opened.
Implementation logic
When the door is opened, the DP of the used unlocking method is reported. If the door is disconnected from the network, the time when an unlocking event occurs must be recorded. Therefore, we recommend that the records of actual status are reported. In this case, the module stores the records that failed to be reported and reports them along with other latest unlocking records after network recovery. The records use the local time of the device. The following table describes the DP values.
Implementation process
0x23
is used to report status records.
Note: The serial number of a specific unlocking method is generated by the MCU. Note that the MCU-generated serial number is independent of the ID of each temporary password.
If an alert is triggered, the app instantly shows the alert. Users can view the alerts on the app.
DP 23: Lock Alarm
Lock alerts: The alerts cover multiple scenarios, including fingerprint attempts, password attempts, card attempts, face recognition attempts, stuck bolts, high temperature, overtime unlocked reminders, electronic lock tongue not ejected, anti-pry design, key insertion, low battery, running out of battery, and vibration alerts.
Implementation logic
After an alert is triggered, the MCU reports the specified alert DP value.
Note: When status records are reported, the accurate local time of the device is included in the records. If the local time of the device lags behind the actual time, when the app receives an alert, the alert icon on the app does not blink. Users can tap the icon to view the alert. If the server time prevails, after the device is reconnected after network recovery, the record time does not reflect the actual event time.
Alert:
0x23
is used to report status records.
Manage the admin password and tenant password.
Manage the admin password: Change the admin password. Change, reset, disable, and enable the sub-admin password.
Create, delete, change, disable, and enable the temporary passwords used for tenants.
Delete all temporary passwords: If a lock is reset to factory settings by the mobile app, the cloud will send a command to delete all the locally saved temporary passwords. If a lock is physically reset to its factory settings, it needs to report the DP 7 to the cloud for sync. If reporting failed, the lock must report the DP 7 again after it is connected to the cloud.
Local password changed report: If the password assigned to the admin, sub-admin, or users is changed through hardware operation, the lock must report the DP 24 for sync.
Sync password information between the server and the lock.
Offline temporary passwords are used when the door lock is disconnected from the internet.
DP 8: Offline Password T0 Time
Offline Password T0 Time: The server sends the basic time to the lock, which is used for encrypting the offline password.
Users can choose whether to assign the password as one time.
If so, the effective time cannot be set. The expiration time is the effective time plus 6 hours, which cannot be changed.
If the user does not assign the password as one time, the effective and expiration time can be set. The usage times of the password are not limited within the effective time.
0x08
is used to report offline passwords.
The user sets a dynamic password on the app. A visitor can enter the dynamic password within the validity period of the password to unlock the door.
DP 16: Unlock by Dynamic Password
Implementation logic
Note: Get the dynamic password on the app. Currently, the all-in-one Wi-Fi panels do not support entering an administrator password, but it is supported on the embedded system and server.
Implementation process
This function is used along with the temporary password function. When the user creates a temporary password on the Tuya Smart app or OEM app, a text message is sent to a specified mobile number. The text message contains the device name, password, validity period, and expiry time.
SMS is only available for services deployed in mainland China. When creating an app account, the user can select the country or region code.
DP33: Message Notification
This DP is optional. This function is a paid offer.
After you select this DP, go to the Functional Expansion tab on the value-added services (VAS) platform and subscribe to the Door Lock SMS Notification function.
It is the app functionality and no communication protocols are involved.
The lock will be reset to its factory settings.
DP 25: Reset The Lock
Reset a lock to its default settings by using the mobile app.
This operation will remove the lock from the app and clear all the data from the cloud. The temporary passwords and offline passwords locally saved on the lock are still available.
After a lock is paired again, the server will send DP 25. After the module receives this DP, the MCU will clear all the authorization information, reset the admin and sub-admin passwords to default values, and notify the module to delete all temporary passwords.
Reset a lock to its default settings through hardware operation.
The MCU will clear all the authorization information and notify the module to delete all temporary passwords.
After the lock is paired again, it should report the DP 25 to clear all the data from the cloud.
Perform production tests on the network modules on the PCB to verify the RF performance and serial communication.
Tuya provides the beacon used in testing. Contact the account manager to request it.
Set the beacon channel to channel 11. Power on the module and place the device under test (DUT) near the beacon. Send the test command and wait for the module to return the result within about 3s. The acceptance rate is about 60%.
Note: The transmission power of the beacon has been attenuated, so the distance between the beacon and DUT must be within 1m. The DUT must not be paired.
To send push notifications to the app, configure Device Notification on the platform.
Is this page helpful?
YesFeedbackIs this page helpful?
YesFeedback