DISCLAIMER
Please note that all content presented on this page is provided by Tuya (HK) Limited. Alibaba Cloud makes no representations and warranties, explicit or implied, as to the authenticity or accuracy of any such content, nor makes any guarantee to the condition, quality, durability, performance, reliability, merchantability or fitness for a particular purpose, or non-infringement of any products and/or services made available by Tuya (HK) Limited.
Sub-equipment can be uploaded and uploaded one by one or in batches. Before the sub-device goes online, you need to register the identity of the sub-device on IoT Platform and establish the topological relationship between the sub-device and the gateway. When a sub-device goes online, IoT Platform verifies the identity of the sub-device based on the topology to determine whether the sub-device is capable of using the Gateway channel.
Description ●For sub-device offline and batch offline messages, only QoS = 0 is supported, but QoS = 1 is not supported. ●Under a gateway, the number of sub-devices online at the same time cannot exceed 1000. After the number of online sub-devices reaches 1000, the new sub-device online request will be rejected. ●When sending a batch of sub-device online/offline requests, the number of sub-devices in a single batch cannot exceed 50. ●The result of the batch offline request for the device is all successful or all failed, and data the response parameters contain specific device information.
subdevice offline
Data Uplink:
Request Topic: /ext/session/${productKey}/${deviceName}/combine/logout
Response Topic: /ext/session/${productKey}/${deviceName}/combine/logout_reply
Description Because sub-devices communicate with IoT platform through gateway channels, the preceding topics are the topics of the gateway devices. Variables in Topic ${productKey} and ${deviceName} replace with the corresponding information of the gateway device.
Request data format:
{
"id": "123",
"params": {
"productKey": "al12345****",
"deviceName": "device1234"
}
}
Description In the message body, the parameter productKey and deviceName is the corresponding information of the sub-device.
Parameter Description:
Parameters | Type | Description |
ID | String | Message ID number. A number of the String type. The value range is from 0 to 4294967295, and each message ID is unique in the current device. |
Params | Object | Request input parameter, which contains the information about the sub-device to be offline. |
Params parameter description:
Parameters | Type | Description |
DeviceName | String | The device name of the sub-device. |
ProductKey | String | The ProductKey of the product to which the sub-device belongs. |
Alink response data format:
{
"id": "123",
"code": 200,
"message": "success",
"data": {
"deviceName": "device1234",
"productKey": "al12345****"
}
}
Parameters | Type | Description |
ID | String | The message ID. A number of the String type. The value range is from 0 to 4294967295. Each message ID is unique in the current device. |
Code | Integer | The result is returned, 200 representing success. |
Message | String | Returns the result information. |
Data | Object | The information about the offline sub-device returned when the request succeeds or fails. For specific parameters, see the following table data. |
Data parameter description:
Parameters | Type | Description |
DeviceName | String | The device name of the sub-device. |
ProductKey | String | The ProductKey of the product to which the sub-device belongs. |
Error message:
Error Code | Error Message | Description |
460 | Request parameter error | The request parameter is incorrect. |
520 | Device no session | Sub device session does not exist. |
Batch offline of sub-equipment
Important A maximum of 50 sub-devices can be requested to go online at a time.
Data Uplink:
●Request Topic: /ext/session/${productKey}/${deviceName}/combine/batch_logout ●Response Topic: /ext/session/${productKey}/${deviceName}/combine/batch_logout_reply
Description Because sub-devices communicate with IoT platform through gateway channels, the preceding topics are the topics of the gateway devices. Variables in Topic ${productKey} and ${deviceName} replace with the corresponding information of the gateway device.
Request data format:
{
"id": "123",
"params":[{
"productKey": "al12345****",
"deviceName": "device1234"
},{
"productKey": "al12345****",
"deviceName": "device4321"
}]
}
Description In the message body, the parameter productKey and deviceName is the corresponding information of the sub-device.
Parameters | Type | Description |
ID | String | Message ID number. A number of the String type. The value range is from 0 to 4294967295, and each message ID is unique in the current device. |
Params | Object | Request input parameter, which contains the information about the sub-device to be offline. |
Params parameter description:
Parameters | Type | Description |
DeviceName | String | The device name of the sub-device. |
ProductKey | String | The ProductKey of the product to which the sub-device belongs. |
Response data format:
{
"id":"123",
"code":"200",
“message":"success",
"data":[{
"productKey": "al12345****"
"deviceName": "device1234"
},{
"deviceName": "device4321",
"productKey": "al12345****"
}]
}
Parameter description:
Parameters | Type | Description |
ID | String | The message ID. A number of the String type. The value range is from 0 to 4294967295. Each message ID is unique in the current device. |
Code | Integer | The result is returned, 200 representing success. |
Message | String | Returns the result information. |
Data | Object | The information about the offline sub-device returned when the request succeeds or fails. For specific parameters, see the following table data. |
Data parameter description:
Parameters | Type | Description |
DeviceName | String | The device name of the sub-device. |
ProductKey | String | The ProductKey of the product to which the sub-device belongs. |
Error message:
error Code | Error Message | Description |
460 | Request parameter error | The request parameter is incorrect. |
520 | Device no session | Sub device session does not exist. |