Develop Product

Last Updated on : 2024-06-20 03:13:11download

To develop a product on the Tuya Developer Platform, you need to define product functions, select and customize device panels, develop embedded firmware, and perform a production test.

Step 1: Define product functions

You can set functions for a product, including standard functions, custom functions, and advanced functions.

A product function is the abstraction of a feature that is provided by a smart device. You can use product functions to describe the features and parameters of smart devices. Based on the product functions, the Tuya Developer Platform generates things data models in the cloud to connect to and control the smart devices. This makes product functions and data interactions easy to understand.

DP data type

Tuya Developer Platform allows you to define functions with six data types, including Boolean, value, enum, fault, string, and raw. For more information, see Data type.

Description of DPs

DP ID Data point (DP) Identifier Data transfer type Data type Property Remarks
1 Temperature temp_current Report only Value
  • Value range: -100 to 600
  • Pitch: 1
  • Scale: 1
  • Unit: °C
The default unit is °C and the value is rounded to one decimal place.
2 Humidity humidity_value Report only Value
  • Valid values: 0 to 1000.
  • Pitch: 1
  • Scale: 1
  • Unit: %
The default unit is % and the value is rounded to one decimal place.
4 Battery level battery_percentage Report only Value
  • Value range: 0 to 100
  • Pitch: 1
  • Scale: 0
  • Unit: %
To set low battery alerts, we recommend that you define the values from 0 to 19 as the low battery status and the values from 20 to 100 as the normal battery level.

DP ID 1 (required) temperature temp_current

  • This DP is used as a basic feature to display DP data on the app.
  • The DP data that is most recently collected is reported. It is not real-time data. The collection frequency depends on the firmware configurations. By default, DP data is collected every five minutes.
  • Valid values of temperature range from -200 to 850. Recommended values range from -100 to 600. Therefore, the actual temperature from -10.0 to 60.0°C can be reported.
  • The temperature value is rounded to one decimal place.

DP ID 2 (required) humidity humidity_value

  • This DP is used as a basic feature to display DP data on the app.
  • The DP data that is most recently collected is reported. It is not real-time data. The collection frequency depends on the firmware configurations. By default, DP data is collected every five minutes.
  • Valid values of humidity range from 0 to 1000. Recommended values range from 0 to 1000. Therefore, the actual humidity from RH0 to RH100.0% can be reported.
  • The humidity value is rounded to one decimal place.

DP ID 4 (optional) battery level battery_percentage

  • This DP is used as a basic feature to display DP data on the app.
  • This DP indicates the remaining battery capacity of the device when it is powered by batteries. A value of 0% indicates no power and 100% indicates full battery capacity.
  • By default, the DP data is collected and reported every four hours.
  • This DP is used to sample the battery level of the device. The battery type can be a primary battery or a rechargeable battery. The percentage value is a result of battery voltage mapping and is used for reference only. A significant deviation might exist between the reported data and the actual voltage. High-quality batteries or those with excellent linear performance are recommended.

Custom function

You can add custom functions that are not supported by standard functions. For more information, see Custom Functions.

Advanced function

Advanced functions support cloud timing and jumping page. For more information, see Advanced Function.

  • Cloud timing: allows you to implement the schedule feature without embedded development.
  • Jumping page: enables navigating to another web page, such as an online store and user guide.

Step 2: Configure a panel

After the function definition step, you can configure a favorite app control panel for the product. A panel is a GUI-based program that runs on top of a mobile app to control smart products. For more information about panel configurations and development tutorials, see Design App UI and Panel Development.

Step 3: Design hardware

Hardware development involves hardware design and embedded development. For certain sensor products, the no-code development solution is available. Therefore, you only need to set parameters in a configuration file before firmware can be generated without coding. In addition, you can implement custom development based on the MCU SDK or TuyaOS as needed.

Hardware design reference

Generic design

No. Design type
1 Radio frequency (RF) design

No-code development solution

No. Protocol type Feature Power supply type Collect and report data Supported module
1 Wi-Fi and Bluetooth combo Temperature, humidity, upper temperature limit, lower temperature limit, upper humidity limit, lower humidity limit, temperature alert, humidity alert, battery level, and tamper alarm Dry or rechargeable batteries
  • Collect data: The sensor collects real-time data at an interval of 1s. The module chip collects data regularly at an interval of one or more hours.
  • Report data: The temperature or humidity that exceeds the upper limit is reported immediately after it is collected. The module chip also regularly collects and reports data.
CBU module
2 Bluetooth Low Energy (LE) Temperature, humidity, battery level, temperature and humidity cyclic reporting, temperature sensitivity, and humidity sensitivity Dry or button batteries
  • Collect data: The module chip collects data regularly at an interval of one or more seconds.
  • Report data: The temperature or humidity is reported immediately after the difference between two values that are consecutively collected exceeds the sensitivity threshold. The data is also reported regularly at an interval of one or more minutes.
BTU module and BT5S module
3 Zigbee Temperature, humidity, battery level, and tamper alarm Dry or button batteries
  • Collect data: The module chip collects data regularly at an interval of one or more seconds.
  • Report data: The temperature or humidity is reported immediately after the difference between two values that are consecutively collected exceeds the sensitivity threshold. The data is also reported regularly at an interval of one or more minutes.
TYZS5 module, ZTU module, and ZT5 module
4 Bluetooth mesh Temperature, humidity, battery level, and tamper alarm Dry or button batteries
  • Collect data: The module chip collects data regularly at an interval of one or more seconds.
  • Report data: The temperature or humidity is reported immediately after the difference between two values that are consecutively collected exceeds the sensitivity threshold. The data is also reported regularly at an interval of one or more minutes.
BTU module and BT5S module
5 Narrowband Internet of Things (NB-IoT) Temperature, humidity, temperature and humidity collection frequency, temperature and humidity reporting frequency, temperature sensitivity, humidity sensitivity, battery level, and tamper alarm Dry or rechargeable batteries
  • Collect data: The module chip collects data regularly at an interval of one or more seconds.
  • Report data: The temperature or humidity is reported immediately after the difference between two values that are consecutively collected exceeds the sensitivity threshold. The data is also reported regularly at an interval of one or more minutes.
NE1 module

Custom solution

No. Protocol type Feature Power supply type Collect and report data Module Hardware design reference Datasheet
1 Wi-Fi and Bluetooth combo Temperature, humidity, and battery level Dry or rechargeable batteries
  • Collect data: The module chip collects data regularly at an interval of one or more minutes.
  • Report data: The temperature or humidity is reported immediately after the difference between two values that are consecutively collected exceeds the sensitivity threshold. The data is also reported regularly at an interval of one or more minutes.
CBU module
2 Bluetooth LE Temperature, humidity, and battery level Dry or button batteries
  • Collect data: The module chip collects data regularly at an interval of one or more seconds.
  • Report data: The temperature or humidity is reported immediately after the difference between two values that are consecutively collected exceeds the sensitivity threshold. The data is also reported regularly at an interval of one or more minutes.
BTU module and BT5S module
3 Zigbee Temperature, humidity, battery level, and tamper alarm Dry or button batteries
  • Collect data: The module chip collects data regularly at an interval of one or more seconds.
  • Report data: The temperature or humidity is reported immediately after the difference between two values that are consecutively collected exceeds the sensitivity threshold. The data is also reported regularly at an interval of one or more minutes.
TYZS5 module, ZTU module, and ZT5 module
4 Bluetooth mesh Temperature, humidity, and battery level Dry or button batteries
  • Collect data: The module chip collects data regularly at an interval of one or more seconds.
  • Report data: The temperature or humidity is reported immediately after the difference between two values that are consecutively collected exceeds the sensitivity threshold. The data is also reported regularly at an interval of one or more minutes.
BTU module and BT5S module
5 NB-IoT Temperature, humidity, and battery level Dry or rechargeable batteries
  • Collect data: The module chip collects data regularly at an interval of one or more seconds.
  • Report data: The temperature or humidity is reported immediately after the difference between two values that are consecutively collected exceeds the sensitivity threshold. The data is also reported regularly at an interval of one or more minutes.
NE1 module

Step 4: Perform embedded programming

Embedded programming is classified into MCU low-code development and TuyaOS development. In this step, you must implement device integration and business programming.

No-code development solution

In this solution, you can set parameters in a configuration file to generate firmware without coding. For more information, see the instructions on the Tuya Developer Platform.

MCU SDK

MCU low-code development enables products with built-in microcontrollers to connect to the cloud and become connected. Tuya provides one-stop IoT development services including the three essentials for typical IoT products, namely network modules, mobile apps, and cloud services. With Tuya’s MCU SDK, all-in-one mobile apps, and control panels, you can focus on application development simply, connect your product to the Tuya Developer Platform easily, and benefit from the cloud services quickly.

For more information, see MCU Low-Code Development.

Smart temperature and humidity sensors can be developed based on multiple protocols, including Zigbee, Wi-Fi and Bluetooth combo, and Bluetooth mesh. For more information, see:

TuyaOS

Built on top of the RTOS, Linux, and Non-OS, TuyaOS is a distributed and platform-agnostic IoT operating system.

With a standard kernel at the core, TuyaOS is designed to tackle the heterogeneity of platforms, systems, and protocols in order to enable quick and reliable integration, interconnection, and interoperability.

The tiered and plug-and-play architecture design allows you to quickly tailor a solution based on your hardware resources hence reducing the cost of development with high cost performance. The efficient remote procedure call (RPC) mechanism and proprietary data point (DP) protocols make communication across protocols possible and easy.

Specifically, the following types of devices can be connected based on this solution:

Step 5: Configure product

In this step, the following settings are involved: firmware updates, voice capabilities, multilingual settings, device notifications, device pairing, smart scenes, quick toggle settings, product knowledge, and product manuals. Based on these settings, global cloud services are employed to promote the personalized user experience. You can update these settings and make them effective immediately without the need to deliver the devices again.

Particularly, multilingual settings, device pairing, voice capabilities, and smart scenes require precision and localized management based on the target user locations and the specific pairing methods and device features.

Develop Product

For more information, see:

Step 6: Flash firmware and authorize chip

Flash the device with the firmware and Tuya’s license to connect the device to the cloud. Tuya provides multiple firmware flashing and authorization methods for you to connect the following types of devices:

Step 7: Test product

Before your product can be released on the Tuya Developer Platform, you must submit a product test report. To test the product, you can download and run use cases, use Tuya’s Cloud Test app, or subscribe to Tuya Test Service.

Download and run use cases

For certain product categories, you can download use cases from the Tuya Test Service page, run the use cases, and then submit test reports.

Cloud Test app

Tuya’s Cloud Test app is provided with multiple test modes for you to accelerate troubleshooting based on functional modules. This enables all-in-one tests for the device status and interaction link.

For more information, see Cloud Test App.

Tuya Test Service

For more information, see Tuya Test Service.

Step 8: Release product

In this step, you can release your project.

Next steps

Pass product certifications

A product must pass certain certifications before it is permitted to be sold. By virtue of rich experience in smart product development, Tuya provides a set of product certification solutions. You can choose among these solutions to meet your product category and certification requirements. For more information, see Product Certificate.