English
English
简体中文
Contact Us
Register
Log In
layoutIndex

Smart Lock

Last Updated on : 2022-04-02 03:09:15download

Tuya door lock development solution provides a detailed introduction to development procedure and API list.

Tuya locks support the following connection solutions. Developers can choose one or more solutions to develop locks according to their business type:

  • Connect with communication protocols (Bluetooth, Wi-Fi, Zigbee, and NB-IoT)
  • Connect with Tuya IoT Development Platform
  • Connect with App SDK (supporting Wi-Fi and Bluetooth at present)
  • Connect with RN panel SDK
  • Connect with IoT WeChat Mini Program

Create a lock product

This section describes how to create a smart lock product. For details, see Configure in Platform – Create Products.

  1. Log in to Tuya IoT Console and click Create.

  2. Choose a product from the lock categories:

    • Residential lock: You can choose from Wi-Fi, Bluetooth Low Energy (LE), Zigbee, and NB-IoT communication modes.

    • Residential lock PRO: You can choose from Wi-Fi and Zigbee communication modes. You can create two categories, including Wi-Fi international and Zigbee new public version.

    • Business lock: You can create a public version of the business lock that uses Zigbee communication mode.

    • Hotel lock: You can create a public version Zigbee hotel lock with a wiring harness of the cloud lock cylinder.

    • Safe: You can create a public version safe that uses Bluetooth LE and Wi-Fi communication mode.

      Smart Lock

  3. In the Create new product prompt box, set the product name.

    For example, XXX (brand) + XXX (product) + XXX (module model).

  4. Product model (optional): You can fill in the product model to distinguish different products.

    For example, XXX (TY-WF-MS-001).

  5. Net pairing mode: You can choose a net pairing mode from Wi-Fi, Bluetooth LE, Zigbee, and NB-IoT according to your product requirements.

  6. Power type: Wi-Fi is a low power mode, Bluetooth LE and Zigbee are standard power mode, and NB-IoT has PSM mode and DRX mode. At present, all locks are low power products, and their power is supplied by batteries. In case of standard power mode (5V 1A USB power supply), contact business development (BD) personnel of platform lock.

  7. Click OK, and the product is created successfully.

    Now, you can enter the product development procedure. See product development procedure.

    Smart Lock

Connect with the communication protocol

Tuya locks support Wi-Fi, Bluetooth LE, Zigbee, and NB-IoT protocol connections.

Communication protocol Description Applicable category Reference
Wi-Fi Support MCU general connection, that is, Wi-Fi module connection. Developers must implement MCU logics. 1. Wi-Fi residential lock
2. Wi-Fi residential lock PRO (Wi-Fi international)
3. Wi-Fi safe
Wi-Fi connection protocol for door lock
Bluetooth Support MCU general connection and SDK chip connection:
1. For MCU general connection, developers must implement MCU logic.
2. For SDK integration, Tuya provides SDK based on BK or Nordic chip. It is required to integrate SDK with the chip and develop further.
Residential lock Bluetooth LE and safe Bluetooth LE SDK connection: User Guide of Bluetooth LE Lock SDK (Public Edition)
MCU connection: User Guide of Bluetooth LE Lock MCU
Zigbee Support MCU general connection, that is, Zigbee module connection. Developers must implement MCU logic. Residential lock Zigbee, business lock Zigbee, and hotel lock Zigbee Universal Docking Agreement
NB-IoT Support MCU general connection, that is, NB module connection. You must implement MCU logic. NB-IoT lock MCU connection protocol for door lock
Keep-alive Wi-Fi protocol connection Support keep-alive Wi-Fi protocol connection, which is not opened completely at present. Contact the BD or project manager to know more about the protocol. Keep-alive Wi-Fi lock Not available now

Connect with Tuya IoT Development Platform

Based on Cloud Development – Solutions Introduction, this section describes the cloud development connection procedure of the lock category.

Prerequisites

To connect Tuya locks with the platform, the following prerequisites must be met:

  • Prerequisite 1: Use a lock that supports Tuya solutions. The lock has once connected with Tuya communication protocols, such as Bluetooth, Wi-Fi, Zigbee, and NB-IoT. And the lock can be connected with the platform through a self-built cloud development.
  • Prerequisite 2: Connect Tuya Smart Home function. Connect general cloud APIs such as network configuration, device management, and member management.
  • Prerequisite 3: Connect Tuya lock cloud API function. Tuya lock cloud APIs consist of cloud API of lock function and standard command set of lock function. Lock alarm records, unlock records, and setting commands are implemented through a standard command set.

Connection solution

At present, Wi-Fi and Zigbee lock use the same set of open cloud development APIs. The APIs of the Bluetooth cloud development are not available at present. Contact Tuya lock BD for details.

Solution Description Applicable category Reference
Wi-Fi residential lock Support cloud development connection of Wi-Fi locks. The manufacturers and developers can use Tuya lock cloud API to build apps, H5, and Web applications, and connect Tuya Wi-Fi lock functions. 1. Wi-Fi residential lock
2. Wi-Fi residential lock PRO (Wi-Fi international)
3. Wi-Fi safe
1. Cloud development connection API of Wi-Fi locks
2. Standard command set of residential lock
3. Standard status set of residential lock
Zigbee residential lock Support cloud development connection of Zigbee locks. The manufacturers and developers can use Tuya lock cloud API to build apps, H5, and Web applications, and connect Tuya Zigbee lock functions. Residential lock_Zigbee, residential lock PRO_Wi-Fi 1. Cloud development connection API of Zigbee locks
2. Standard command set of residential lock
3. Standard status set of residential lock
Bluetooth residential lock Coming soon. Contact Tuya BD for more details. Bluetooth lock Not available now

App SDK connection

Based on App Development – SDK Development – App SDK Instruction, this section describes app SDK development connection procedure of the lock category.

Prerequisites

To connect Tuya locks with app SDK, the following prerequisites must be met:

  • Prerequisite 1: Use a lock that supports Tuya solutions. The lock has once connected with Tuya communication protocols, such as Bluetooth, Wi-Fi, Zigbee, and NB-IoT. And the developer app can inherit the Tuya lock app SDK.
  • Prerequisite 2: Tuya lock app SDK is encapsulated on the basis of Home SDK. Some lock functions that are not integrated into the app can be connected with the platform.

Connection solution

At present, the Wi-Fi residential lock and Bluetooth LE residential lock can be connected with app SDK. The iOS platform and Android platform are supported. Zigbee App SDK is not available at present. Contact Tuya BD for details.

Tuya lock app SDK is the second encapsulation based on Tuya App Home SDK. It mainly encapsulates the lock business.

App SDK Description Applicable category Reference
App SDK of Wi-Fi residential lock Support app SDK connection of Wi-Fi locks. The SDK uses native codes of iOS and Android to encapsulate the business interface and cloud API of Wi-Fi locks. 1. Wi-Fi residential lock
2. Wi-Fi residential lock PRO (Wi-Fi international)
3. Wi-Fi safe
1. iOS Lock SDK
2. Android Lock SDK
App SDK of Bluetooth residential lock Support app SDK connection of Bluetooth locks. The SDK uses native codes of iOS and Android to encapsulate the business interface and cloud API of Bluetooth locks. Bluetooth lock 1. iOS Lock SDK
2. Android Lock SDK

Connect with panel SDK

Based on Panel Development – Panel SDK Development – Common SDK Development, this section describes the panel SDK development connection procedure of the lock category.

Panel SDK Description Applicable category Reference
Connect with panel SDK Panel SDK can use Tuya public version app. Users develop lock business based on panel SDK and upload the panel RN resource bundle to the server. Wi-Fi, Bluetooth, and Zigbee lock 1. Lock Panel SDK Development – Lock Interface
2. Lock Panel SDK Development – Lock App SDK