Control the group to execute commands or actions
HTTP Request URL: http(s)://api.thingboot.com/{AppID}/group/control/?sign={sign}&ts={ts}
About the sign and ts definition
Or
MQTT Publish Topic: api/{AppID}/group/control
The returned results are also received on the same topic.
Request parameters
When the parameters are lengthy, it is recommended to use the POST method.
| Name | Type | Description |
|---|---|---|
| group | int | Group ID, the ID returned when retrieving the group list |
| 命令或动作 | string | Only one of command or action can be specified at a time; choose one.
When specifying a command: the format is device attribute name=attribute value.
On the device details page, you can find the available commands and their corresponding values for the device.
For example, if power=1, the command to turn on the power of grouped devices will be issued.
You can also wrap the attribute value in order, such as: order:{power:1}
When specifying an action: the format is action=action ID.
For example, if action=1, the action with ID 1 will be executed for the corresponding group. |
Return example
Return results
| Name | Type | Description |
|---|---|---|
| code | int | 200 Correct
501 Group ID not specified; the Group ID is an integer. This ID is output in the group list interface and can also be viewed in the device list on this console.
502 The group does not exist or has no available devices. Please check if the Group ID is correct and whether devices and corresponding commands have been added to the group.
504 Multiple group IDs were specified at once
504 No recognizable command exists The function in the command does not exist. Please refer to the function list of the specified product in the product list to check the available functions.
50xx See "Global Error Codes" |
Return example