Contact Us
Log In

Integrated SDK

Last Updated on : 2022-11-24 09:20:02download

This topic describes the integrated gateway SDK in terms of key concepts, SDK directory, and technology architecture.


Terms Description
Gateway Some devices cannot directly access the internet such as Bluetooth or Zigbee devices. They need a bridge to help them connect to the internet for access to cloud services. The gateway can act as a bridge to enable bidirectional communication between these devices and the cloud. Besides network communication, a versatile gateway can work as a light, a socket, or an alarm.
Software development kit (SDK) An SDK is a collection of software development tools in one package. Tuya provides SDKs for various systems and programming languages.
Product ID (PID) The PID is a unique identifier assigned to each product created on the Tuya IoT Development Platform. The PID is associated with all information related to a specific product, including the defined DPs, configured app panel, and delivery information.
Universally unique identifier (UUID) A UUID is a unique number generated by various algorithms to identify each device.
AuthKey An AuthKey is used to register a device with cloud services. One UUID corresponds to one AuthKey uniquely.
Over-the-air (OTA) An OTA update is the wireless delivery of new software, firmware, or other data to connected IoT devices.
Data point (DP) Each feature defined for a product on the Tuya IoT Development Platform is described as a DP.
Each DP has a read/write property and its data type such as Boolean, enum, and value. The read property means to get the current value of a DP. The write property means to change the current value of a DP.
For example, a 2-gang switch has two Boolean DPs, and the valid value of each DP can be either True or False.
DPID DPID represents the ID of a DP event under a communication protocol.
QR code pairing Pair a device with the mobile app by scanning a QR code.
Local linkage The cloud sends automation commands to the gateway. The gateway controls the command execution when the specified conditions are met.
Local area network (LAN) linkage When the router is disconnected from the internet, scene automation configured for devices that are connected to the same LAN can still be run.
Pegasus Tuya’s proprietary technology for fast device pairing.
Zigbee Zigbee is a wireless technology developed as an open global standard to address the unique needs of low-cost, low-power wireless IoT networks.
Zigbee coordinator Zigbee coordinator is a special router. It is responsible for forming the network and selecting the channel, PAN ID, security policy, and stack profile for a network.
Zigbee network co-processor (NCP) NCP is a Zigbee module in a gateway, acting as a Zigbee coordinator.
Zigbee host The code that runs on the microcontroller in a Zigbee gateway. The host communicates with an NCP over a serial interface. The host and the NCP together compose the complete Zigbee protocol processing program.
Bluetooth mesh Bluetooth mesh is a wireless mesh networking technology based on Bluetooth Low Energy (LE).
Bluetooth mesh protocol Bluetooth mesh protocol is a type of wireless network topology. It allows for many-to-many communication over Bluetooth radio. Devices built with Bluetooth mesh technology also support Bluetooth LE 4.0 and 5.0.


With a component-based plug-and-play architecture, the TuyaOS integrated SDK helps you build an IoT-enabled gateway in a quick and easy way. Each service is offered in an independent component library, allowing you to flexibly implement and adjust your service offerings as the market needs change over time.

The integrated SDK comes with device management capability, it supports connect sub-devices of any protocol type to Tuya IoT ecosystem, such as Zigbee, Bluetooth BLE & Mesh, RS-433, RS-485, Z-Wave, and other, all of them can interact with other Powered by Tuya (PBT) devices. If your product is built with PBT Zigbee or Bluetooth, you can also integrate with the PBT ecosystem through low-code development.

The SDK provides cloud connectivity as well as a bunch of features such as local automation, LAN-based linkage, engineering mode, fault replacement, home security and OTA.

What you can build with the integrated SDK:

  • With PBT Zigbee module, build gateways that can connect to PBT Zigbee devices. Third-party Zigbee devices can also be connected to the gateway so that they can interact with the Powered by Tuya ecosystem.
  • With PBT Bluetooth module, build gateways that can connect to PBT Bluetooth devices and pair devices over Bluetooth.
  • With your proprietary or third-party modules, such as Zigbee, Bluetooth BLE & Mesh, RS-433, RS-485, Z-Wave, and other, build gateways that enable interconnection to the PBT ecosystem.
  • Routers or repeaters.
  • And many more.


Integrated SDK

SDK directory

├── apps                # The sample applications, which can be modified as needed.
├── build_app.sh        # The compilation script
├── CHANGELOG.md        # The changelog
├── doc                 # API documentation
├── gen_demo.py         # (Optional) demo script
├── platforms           # The toolchain. The toolchain will be automatically saved to this folder when you compile code.
├── README.md           
├── sdk
│   ├── include         # Header file.
│   └── lib             # The SDK library.
└── template            # (Optional) The demo template, used in tandem with gen_demo.py.