Last Updated on : 2024-11-20 02:14:52download
There are three approaches to developing a product by using Tuya’s Wi-Fi module or Wi-Fi and Bluetooth Low Energy (LE) combo module.
This topic describes the operations on the Tuya Developer Platform when you develop with the TuyaOS-based SDK and introduces six data types and three data transfer types used for defining DPs.
To develop with the TuyaOS-based SDK, you need to create a product on the Tuya Developer Platform and select the function, panel, and module to get the data point (DP) ID and product ID (PID). Log in to the Tuya Developer Platform. If you do not have an account, you need to register first.
The example in this topic uses the CBU module to show you how to create a cool white light product on the platform.
On the homepage of the platform, Click Create.
Under the Standard Category tab, choose Lighting > Light Source.
Choose TuyaOS > Custom Solution.
The no-code development allows you to generate the firmware by configuring it in a graphical interface without coding. For more information, see No-Code Development. To perform custom development on top of the SDK, choose Custom Solution.
Complete the required information and select a protocol. Click Create.
The example uses the CBU Wi-Fi and Bluetooth LE combo module, so Wi-Fi - Bluetooth is chosen as the protocol.
If you are not clear about what protocol your module uses, check out the datasheet.
Select the standard functions as needed and click OK.
If the standard functions cannot meet your needs, you can create custom functions. Note that the standard functions can be displayed and operated properly on the app panel but this might not work for the custom functions.
To ensure the stable operation of your product, we recommend the total number of standard functions and custom functions be limited to 40. Otherwise, make sure to test the stability of your product.
Select an app panel you prefer. The app panel is used to interact with your product.
Click the Hardware Development tab. Choose TuyaOS and then the module for use. We choose CBU Wi-Fi & Bluetooth Module.
After you build the firmware, you can click Add Custom Firmware to upload it.
You can download the SDK from the Download Documents section. In this example, the SDK is ty_iot_wf_bt_sdk_rtos_BK7231N.
Data point (DP): An abstract representation of a feature you want to apply to a physical device, which can be defined by various data types.
DP ID: The ID of a DP. The two-way communication between the device and the cloud is based on the DP ID. The first 100 DP IDs are reserved for Tuya use. The custom DP ID starts with 101.
DP data type: The platform supports six data types, including Boolean, value, enum, fault, string, and raw.
Apply to a binary variable that is either true or false. For example, define the on and off state for a switch.
Apply to a variable that can be linearly adjusted. For example, temperature ranges from 20°C to 40°C.
9999
to the app:
0
, 9999
is displayed on the app panel.1
, 999.9
is displayed on the app panel.2
, 99.99
is displayed on the app panel.3
, 9.999
is displayed on the app panel.Apply to a finite collection of custom values. For example, operation modes can be low, medium, and high.
An enum value can only contain letters, numbers, and underscores. After entering a value, press the ENTER button to confirm. The code of enum value starts from 0. An enum value is transmitted by its code. An enum value must not exceed 15 characters. Up to 10 enum values can be created.
Apply to fault reporting. Multiple faults can be reported in one event. For example, temperature sensor faults, motor faults, and high temperature problems.
Apply to DP data transmitted in string format. The length of a string must not exceed 255 bytes.
Apply to DP data transmitted in binary format. The length of raw data must not exceed 255 bytes.
The data transfer type of fault data is fixed to report only (read-only). For the other five data types, the data transfer type can be set as needed.
Data transfer type | Description |
---|---|
Send and report (read-write) | Two-way data transmission between the device and the cloud. |
Report only (read-only) | One-way data transmission. Data can only be reported from the device. |
Send only (write-only) | One-way data transmission. Data can only be sent from the cloud. |
You can choose an all-in-one panel or use the SDK to develop a custom panel. The panels for some products support drag-and-drop configuration.
For more information, see Panel Development.
Select the development method and module. Download the SDK and upload the custom firmware.
For more information, see Manage Custom Firmware.
Configure product-specific features including firmware update, multilingual support, push notification, pairing guides, quick toggle, smart scenes, and more.
For more information, see Product Configuration.
Is this page helpful?
YesFeedbackIs this page helpful?
YesFeedback