Device Group

Last Updated on : 2024-09-10 01:49:14

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.

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.

ApplicationCloudDeviceCreate a group1Verify and save the device and group relationship in the cloud2Created successfully3Query the group properties4Return the group properties5Send the group properties6Return results7Send properties8Sent successfully9ApplicationCloudDevice

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 IoT 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}
Delete Devices DELETE:/v2.0/cloud/thing/group/{group_id}/devices
Get Groups in a 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 Device 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: For example, create a group of colored lights manufactured by the same factory.
  • Add devices: For example, add newly installed colored lights to the same group.
  • Delete devices: For example, delete old colored lights from the group.
  • Send group properties: For example, send to the group an instruction to turn off colored lights. Then, all devices in the group will receive the control instruction and go off accordingly.

Limits

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