Develop Product

Last Updated on : 2024-06-20 03:16:58download

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 2: Define product functions

You can set functions for a product, including standard functions, custom functions, and cloud 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.

Standard function

Standard functions indicate the common functions in a specified category to implement standard device interconnection.

DP ID DP name Identifier Data transfer type Data type DP property Remarks
1 Valve switch switch Send and report (read/write) bool / /
2 Regulating water volume percent_control Send and report (read/write) value
  • Valid values:
  • 0 to 100
  • Pitch: 5. Scale: 0
  • Unit: %
/
3 Flow state percent_state Report only (read-only) value
  • Valid values:
  • 0 to 100
  • Pitch: 1
  • Scale: 0
  • Unit: %
/
4 Failure to report fault Report only (read-only) fault Fault values: low_battery, fault, lack_water, sensor_fault, and motor_fault /
5 Water once water_once Report only (read-only) value
  • Valid values: 0 to 1000.
  • Pitch: 1
  • Scale: 1
  • Unit: liters
/
6 Total daily water consumption water_total Report only (read-only) value
  • Valid values: 0 to 9999.
  • Pitch: 1
  • Scale: 0
  • Unit: liters
/
7 Battery battery_percentage Report only (read-only) value
  • Valid values:
  • 0 to 100
  • Pitch: 1
  • Scale: 0
  • Unit: %
/
8 Battery state battery_state Report only (read-only) enum Enum values: low, middle, and high /
9 Accumulated usage time use_time Send and report (read/write) value
  • Valid values: 0 to 2592000.
  • Pitch: 1
  • Scale: 0
  • Unit: seconds
/
10 Weather delay weather_delay Send and report (read/write) enum Enum values: cancel, 24h, 48h, and 72h /
11 Irrigation time countdown Send and report (read/write) value
  • Valid values: 0 to 86400
  • Pitch: 1
  • Scale: 0
  • Unit: seconds
/
12 Work state work_state Report only (read-only) enum Enum values: auto, manual, and idle /
13 Smart weather smart_weather Send and report (read/write) enum Enum values: sunny, clear, cloud, cloudy, rainy, snow, and fog The weather data to be obtained by the device.
14 Smart weather switch weather_switch Send and report (read/write) bool / /
15 Single using time use_time_one Report only (read-only) value
  • Valid values: 0 to 86400
  • Pitch: 1
  • Scale: 0
  • Unit: seconds
/
16 Cycle irrigation cycle_time Send and report (read/write) string / Specify a period to cycle a device between ON and OFF, and set how long you want the ON and OFF state to last in a cycle. This provides a convenient way to automate light routines such as for cyclic irrigation, pet feeding, and control of lighting scenarios.
17 Normal timer normal_timer Send and report (read/write) string / Users can customize the recurring period, irrigation period, and multiple cyclic irrigation tasks. The task can be run weekly, on an even or odd days, or at a specified time every two days.
18 Humidity sensor_humidity Report only (read-only) value
  • Valid values:
  • 0 to 100
  • Pitch: 1
  • Scale: 0
  • Unit: %
/
19 Temperature and humidity sensor power temp_hum_battery_percentage Report only (read-only) value
  • Valid values:
  • 0 to 100
  • Pitch: 1
  • Scale: 0
  • Unit: %
/
20 Humidity upper limit setting maxhum_set Send and report (read/write) value
  • Valid values:
  • 0 to 100
  • Pitch: 1
  • Scale: 0
  • Unit: %
/
21 Lower humidity setting minihum_set Send and report (read/write) value
  • Valid values:
  • 0 to 100
  • Pitch: 1
  • Scale: 0
  • Unit: %
/
22 Temperature sensor_temperature Report only (read-only) value
  • Valid values:
  • 0 to 100
  • Pitch: 1
  • Scale: 0
  • Unit: °C
/
23 Temperature upper limit setting maxtemp_set Send and report (read/write) value
  • Valid values:
  • 0 to 100
  • Pitch: 1
  • Scale: 0
  • Unit: °C
/
24 Lower temperature setting minitemp_set Send and report (read/write) value
  • Valid values:
  • 0 to 100
  • Pitch: 1
  • Scale: 0
  • Unit: °C
/
25 Sensor setting switch_enabled Send and report (read/write) bool / /
26 Freeze temperature temp_current Send and report (read/write) value
  • Value range: -5
  • 0 to 100
  • Pitch: 1
  • Scale: 0
  • Unit: °C
/
27 Windspeed windspeed_avg Send and report (read/write) value
  • Valid values:
  • 0 to 100
  • Pitch: 1
  • Scale: 0
  • Unit: mph
/
28 No irrigation time no_irrigation_time Send and report (read/write) string / Irrigation duration is limited by water valve controllers. Users can set a period in which one-time tasks or cyclic tasks are disabled. After this period, irrigation tasks can be run as expected. This is intended to meet the water usage limits in certain areas.

Custom function

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

Cloud function

Cloud 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 or 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: Develop software

Hardware development involves hardware design and embedded development. For certain electrical 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 Power Design
2 Compliance Design for Electrical Product

No-code development

No. Protocol type Number of switch channels Control types Supported module
1 Zigbee One-outlet water valve controller One-way control ZTU

Custom solution

No. Protocol type Number of switch channels Control types Supported module
1 Wi-Fi and Bluetooth combo One-outlet water valve controller One-way control WB3S recommended
2 Bluetooth Low Energy (LE) One-outlet water valve controller One-way control BT3L recommended
3 Zigbee One-outlet water valve controller One-way control ZTU recommended

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

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 water valve controllers can be developed based on multiple protocols, including Zigbee, Wi-Fi and Bluetooth combo. 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

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.