Smart Lock

Last Updated on : 2024-06-21 03:47:03download

This chapter describes the development process and API reference for smart lock solutions.

The following integration solutions are available to develop a smart lock product. You can opt for one or more of those solutions that suit your business needs.

  • Communication protocol integration, including Bluetooth, Wi-Fi, Zigbee, and NB-IoT.
  • Cloud development integration
  • App SDK integration (Wi-Fi and Bluetooth)
  • Panel SDK integration
  • IoT WeChat mini program integration

Create smart lock product

This section describes the steps to create a smart lock product. For more information, see Create Products.

  1. Log in to the Tuya Developer Platform.

  2. Choose the Smart Locks category. The following types of smart locks are supported.

    • Residential lock pro: Supports Wi-Fi, Zigbee, or Bluetooth.
    • Residential lock: Supports NB-IoT or LTE Cat.1.
    • Apartment lock: Supports Zigbee.
    • Hotel lock: Supports Zigbee or Bluetooth lock cylinder.
    • Safe box: Supports Bluetooth or Wi-Fi.
    Smart Lock
  3. Product name: Specifies the name of your product.

    Example: xxx (brand) + xxx (product) + xxx (module model)

  4. (Optional) Product model: Specifies the product model to distinguish between products.

    Example: XXX (TY-WF-MS-001)

  5. Protocol: Specifies the protocol your product uses for connectivity. The available protocols vary depending on the product you create.

  6. Power type: Low power for Wi-Fi, standard power for Bluetooth and Zigbee, and PSM or DRX for NB-IoT. Currently, all Tuya-enabled smart locks are low-power devices powered by batteries. If your product requires standard power consumption (5V 1A USB power supply), contact your account manager.

  7. After you complete the required information, click Create.

    Now, you can proceed to develop the smart lock product. For more information, see Hardware Product Development.

Communication protocol integration

Integrate with Tuya’s smart lock protocol that is available in Wi-Fi, Bluetooth, Zigbee, and NB-IoT.

Communication protocol Description Applicable category Reference
Wi-Fi Support MCU integration solution that allows you to interface an MCU with a Wi-Fi module. You need to implement the logic on the MCU side.
  • Wi-Fi residential lock
  • Wi-Fi residential lock pro (international version)
  • Wi-Fi safe box
MCU Integration for Wi-Fi Lock
Bluetooth Support MCU integration and SDK integration.
  • For MCU integration, you need to implement the logic on the MCU side.
  • For SDK integration, Tuya provides SDKs based on Beken or Nordic chips. You need to integrate the SDK into the chip for custom development.
  • Bluetooth Low Energy residential lock
  • Bluetooth Low Energy safe box
SDK integration: Bluetooth Lock SDK Integration
MCU integration: Bluetooth Lock MCU Integration
Zigbee Support MCU integration solution that allows you to interface an MCU with a Zigbee module. You need to implement the logic on the MCU side.
  • Zigbee residential lock
  • Zigbee apartment lock
  • Zigbee hotel lock
MCU Integration for Zigbee Lock
NB-IoT Support MCU integration solution that allows you to interface an MCU with an NB-IoT module. You need to implement the logic on the MCU side. NB-IoT lock MCU Integration for NB-IoT Lock
Wi-Fi keep-alive The Wi-Fi keep-alive protocol is not generally available. If you are interested in this protocol, contact your account manager. Keep-alive Wi-Fi lock MCU Integration for Wi-Fi Keep-Alive Lock

Cloud development integration

This section describes the development process on top of cloud development integration.

Prerequisites

To implement cloud development integration, the following prerequisites must be met.

  • The smart lock must be Tuya-enabled, which has been integrated with Tuya smart lock protocol through Bluetooth, Wi-Fi, Zigbee, or NB-IoT. This enables you to integrate your proprietary platform with the Tuya Developer Platform.
  • Your project must be integrated with smart home cloud APIs such as device pairing, device management, and member management.
  • Your project must be integrated with cloud APIs for smart locks. The cloud APIs consist of two parts: smart lock capabilities and smart lock standard instruction sets that enable alert and unlocking records and lock settings.

Integration solutions

Currently, Wi-Fi and Zigbee lock services use the same set of cloud APIs. The cloud APIs for Bluetooth Low Energy lock services are not generally available. Contact your account manager for details.

Solution Description Applicable category Reference
Wi-Fi residential lock You can use the cloud APIs for smart locks to build a mobile app, WeChat mini program, H5 page, or web application to integrate with Tuya-enabled Wi-Fi locks.
  • Wi-Fi residential lock
  • Wi-Fi residential lock pro (international version)
  • Wi-Fi safe box
Standard Instruction Set
Standard Status Set
Zigbee residential lock You can use the cloud APIs for smart locks to build a mobile app, WeChat mini program, H5 page, or web application to integrate with Tuya-enabled Zigbee locks.
  • Zigbee residential lock
  • Wi-Fi residential lock pro
Standard Instruction Set
Standard Status Set
Bluetooth residential lock Not generally available. Contact your account manager for details. Bluetooth Low Energy lock Not generally available.

App SDK integration

This section describes the process of integrating with the smart lock SDK for mobile app.

Prerequisites

To integrate with the smart lock app SDK, the following prerequisites must be met.

  • The smart lock must be Tuya-enabled, which has been integrated with Tuya smart lock protocol through Bluetooth, Wi-Fi, Zigbee, or NB-IoT. This enables your mobile app to integrate with the smart lock app SDK.
  • The smart lock app SDK encapsulates the smart lock services on top of the Smart Life App SDK. The services that the smart lock app SDK cannot implement can be enabled through cloud APIs.

Integration solutions

The smart lock app SDK is available for iOS and Android and applies to the Wi-Fi and Bluetooth residential lock. The SDK for Zigbee locks is not generally available. Contact your account manager for details.

The smart lock app SDK encapsulates the smart lock services on top of the Smart Life App SDK.

App SDK Description Applicable category Reference
Wi-Fi Lock App SDK This SDK applies to Wi-Fi locks. It encapsulates Wi-Fi smart lock services and cloud APIs with native iOS and Android code.
  • Wi-Fi residential lock
  • Wi-Fi residential lock pro (international version)
  • Wi-Fi safe box
-
Bluetooth Lock App SDK This SDK applies to Bluetooth locks. It encapsulates Bluetooth smart lock services and cloud APIs with native iOS and Android code. Bluetooth Low Energy lock -

Panel SDK integration

This section describes the process of integrating with the Panel SDK for mobile app.

Panel SDK Description Applicable category Reference
Panel SDK integration The Panel SDK supports the Smart Life app. You develop the smart lock services using the Panel SDK and upload the panel’s React Native (RN) package to the server. Wi-Fi, Bluetooth, or Zigbee lock. -