Device Group V2

Last Updated on : 2024-07-10 10:05:41download

A device group is a collection of devices with the same features, allowing users to manage and control a large number of devices as a whole. For example, turn devices on or off, and create scheduled tasks. Group management makes it easier for you to organize and dispatch devices in a more efficient and cost-effective way.

Scenario example

In commercial lighting scenarios, you need to implement modularized management and control of many lights.

You can number all the lights in a commercial building and group them based on the building structure and light type. For example, all lights of the same type and on the same floor can be divided into a light group, and each light group contains several lights. With just a single tap, users can:

  • Turn on or off all lights in the same group.
  • Adjust the brightness of a light group.
  • Control each light group separately.

How it works

The following diagram describes how it works.

Device Group V2

Terms

Term Field Description
Device device_id The identifier of the specified device in the cloud.
Group group_id The identifier of the specified device group in the cloud.
Product product_id A collection of devices with similar functionalities.
Space space_id A space defines the geographical location, area, and layout information of smart devices, and displays the topological relationship between various smart devices. For more information, see Space Management.

API list

API name API endpoint
Delete Group DELETE:/v2.0/cloud/thing/group/{group_id}
Remove Devices DELETE:/v2.0/cloud/thing/group/{group_id}/devices
Get Groups in Space GET:/v2.0/cloud/thing/group
Get Device Group GET:/v2.0/cloud/thing/group/device/{device_id}
Query Group GET:/v2.0/cloud/thing/group/{group_id}
Query Group Devices GET:/v2.0/cloud/thing/group/{group_id}/devices
Query Group Properties GET:/v2.0/cloud/thing/group/{group_id}/properties
Create Group POST:/v2.0/cloud/thing/group
Send Group Properties POST:/v2.0/cloud/thing/group/properties
Add Devices PUT:/v2.0/cloud/thing/group/{group_id}/devices
Rename Group PUT:/v2.0/cloud/thing/group/{group_id}/{name}

The APIs often apply to the following scenarios.

  • Create a group: Create a group of colored lights in a factory.
  • Add devices: Add newly installed colored lights to the same group.
  • Delete devices: Delete old colored lights from the group.
  • Send group properties: Send the group an instruction to turn off colored lights. Then, all devices in the group will receive the control instruction and go off accordingly.

Limitations

Item Limits
The maximum number of devices in one group 100
The maximum number of groups in one space 50

Additional notes

  • The Device Group 2.0 APIs are no longer recommended for historical reasons. New users are recommended to use the Device Group 2.1 APIs.
  • Device Group 2.1 APIs completely cover the capabilities offered by Device Group 2.0 APIs, so groups created by users in Device Group 2.0 APIs are still available in Device Group 2.1 APIs.