Last Updated on : 2024-06-18 06:04:06download
This topic describes how to change the control instruction mode of a device on the Tuya Developer Platform.
You can choose from the following two control instruction modes during cloud development.
Mode | Description | Scenario |
---|---|---|
Standard instruction set | A standard instruction set is a set of instructions that are sent to control devices. It provides a suite of standard descriptions of device functions. After you send standard instructions in JSON format, Tuya converts them into device data points (DPs) in the cloud for the purpose of device control. | During cloud development, devices are controlled in standard instruction mode by default. However, the standard instruction set cannot cover all the functions of Tuya-enabled devices. For more information about product categories that can be controlled with standard instruction sets, see Standard Instruction Set. |
DP instruction | Control devices with original DP instructions. You can access the original DP information of your products. This mode is suitable for some products that contain non-standard instruction sets. | If you cannot control a smart product by using the standard instruction set, you can change to the DP instruction mode and control the product using originally defined DPs. Some non-standard DPs are protocols customized by manufacturers. After DP transmission, Tuya only transmits data without parsing. In this case, you can consult the manufacturers for data parsing. |
If you modify the functional DP of a product, configurations of the DP instruction mode will be automatically updated in about four hours.
Log in to the Tuya Developer Platform.
Visit My Cloud Projects.
Select the target project and click Open Project in the Operation column.
In the top navigation bar, choose Devices > All Devices.
In the section of View Devices by Product, click the ellipsis (…) button to view a list of products.
The PIDs in the product list represent the products of all devices bound with the app or app account in the linked cloud project.
Hover over the target device card, and click the view (Instruction Details) button to view instruction details. Alternatively, you can click the edit (Change Control Instruction Mode) button to go to the page of Configure Control Instruction Mode.
The list of products on this page is not exhaustive. If you do not find the desired product, search by product name or product ID.
On the page of the control instruction mode, you can:
Query the details of standard instruction sets of the specified product. Also, you can click Change Instruction Mode at the bottom to configure the mode.
Change the control instruction mode to DP Instruction.
Click Save Configuration.
On the page of View Details, click Refresh Configuration to refresh and view the details.
Changes to the control instruction mode will take effect immediately in the China Data Center. The changes are automatically synced to other data centers in about four hours. If you want the changes to take effect immediately, you can click Refresh Configuration to refresh manually on the page of the specific data center.
During subsequent cloud development, you need to use the specified instruction mode to control the devices.
Take the lighting color DP colour_data
of smart lights as an example.
Standard instruction mode: Send instructions in JSON format.
{
"code": "colour_data",
"value":
{
"h": 37,
"s": 255,
"v": 188
}
}
DP instruction mode: Send instructions based on the DP protocol of the specified product category. After transparent transmission, the value
parameter in the standard instruction is sent in String format. You need to concatenate the parameters yourself.
Data type | Value range | Instruction example |
---|---|---|
String | 000011112222 , among which:
|
{"code": "colour_data", "value": "00DC004B004E"} |
The HSV value is 00DC 004B 004E
in hexadecimal format. After converting the value to the decimal format, you will get the HSV color 220°, 75%, and 78%.
Is this page helpful?
YesFeedbackIs this page helpful?
YesFeedback