Gateway devices can disable, enable, and delete sub-devices.

Disable a sub-device

The following topics are used when IoT Platform sends requests to a device and the device sends responses to IoT Platform:

  • Request topic: /sys/{productKey}/{deviceName}/thing/disable
  • Response topic: /sys/{productKey}/{deviceName}/thing/disable_reply

A gateway device can disable a sub-device by using the preceding topics. IoT Platform sends a message for disabling a sub-device to the request topic in an asynchronous way. The gateway device subscribes to the request topic and obtains the message from the request topic.

Sample request in the Alink JSON format:

{
  "id": "123",
  "version": "1.0",
  "params": {},
  "method": "thing.disable"
}

Sample response in the Alink JSON format:

{
  "id": "123",
  "code": 200,
  "data": {}
}

Parameters

Parameter Type Description
id String

The ID of the message. Valid values: 0 to 4294967295. Each message ID must be unique for the device.

version String The version of the protocol. Valid value: 1.0.
params Object The request parameters. You can leave the params parameter empty.
method String The request method. Valid value: thing.disable.
code Integer The status code in the response. For more information, see Common codes on devices.

Enable a sub-device

The following topics are used when IoT Platform sends requests to a device and the device sends responses to IoT Platform:

  • Request topic: /sys/{productKey}/{deviceName}/thing/enable
  • Response topic: /sys/{productKey}/{deviceName}/thing/enable_reply

A gateway device can enable a disabled sub-device by using the preceding topics. IoT Platform sends a message for enabling a sub-device to the request topic in an asynchronous way. The gateway device subscribes to the request topic and obtains the message from the request topic.

Sample request in the Alink JSON format:

{
  "id": "123",
  "version": "1.0",
  "params": {},
  "method": "thing.enable"
}

Sample response in the Alink JSON format:

{
  "id": "123",
  "code": 200,
  "data": {}
}

Parameters

Parameter Type Description
id String

The ID of the message. Valid values: 0 to 4294967295. Each message ID must be unique for the device.

version String The version of the protocol. Valid value: 1.0.
params Object The request parameters. You can leave the params parameter empty.
method String The request method. Valid value: thing.disable.
code Integer The status code in the response. For more information, see Common codes on devices.

Delete a sub-device

The following topics are used when IoT Platform sends requests to a device and the device sends responses to IoT Platform:

  • Request topic: /sys/{productKey}/{deviceName}/thing/delete
  • Response topic: /sys/{productKey}/{deviceName}/thing/delete_reply

A gateway device can delete a sub-device by using the preceding topics. IoT Platform sends a message for deleting a sub-device to the request topic in an asynchronous way. The gateway device subscribes to the request topic and obtains the message from the request topic.

Sample request in the Alink JSON format:

{
  "id": "123",
  "version": "1.0",
  "params": {},
  "method": "thing.delete"
}

Sample response in the Alink JSON format:

{
  "id": "123",
  "code": 200,
  "data": {}
}

Parameters

Parameter Type Description
id String

The ID of the message. Valid values: 0 to 4294967295. Each message ID must be unique for the device.

version String The version of the protocol. Valid value: 1.0.
params Object The request parameters. You can leave the params parameter empty.
method String The request method. Valid value: thing.disable.
code String The status code in the response. For more information, see Common codes on devices.