Last Updated on : 2023-05-09 10:30:55download
This topic describes how to change the control instruction mode of a device on the Tuya IoT Development 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 control function instructions that can be sent to 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 devices in Tuya’s ecosystem. For more information about product categories that can be controlled with standard instruction sets, see the Standard Instruction Set documents. |
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. | When you cannot control a smart product through 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 IoT Development Platform.
Visit My Cloud Projects.
Click the target project.
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 product, and click the view button to view instruction details. Alternatively, you can click the edit button to Configure Control Instruction Mode.
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.
On the page of Configure Control Instruction Mode, you can 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. If your product is deployed in a data center other than China Data Center, click the Refresh Configuration button on the corresponding data center page to manually refresh the details .
During subsequent cloud development, you need to use the instruction mode you set to control the devices.
Take the lighting color colour_data
DP 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 mode shall be 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"} |
HSV value is 00DC 004B 004E
in hexadecimal format. After converting them to the decimal format, you will get 220°, 75%, 78%
.
Is this page helpful?
YesFeedbackIs this page helpful?
YesFeedback