cybros labs

Create Device Groups

2 min

To simplify data readings from multiple devices, you can organize devices into groups.

Instead of listing individual devices when creating bulks to read data, you can use only the group ID.


Important

All requests in this documentation follow this endpoint structure:

/io.clbs.openhes.services.svcapi.ApiService/{endpoint}

Replace {endpoint} with the specific API action listed in each section.


Create Groups

To create a device group, send a request to the CreateDeviceGroup endpoint.

Example request:

{
  "spec": {
    "externalId": "external_id_of_group",   
  },
  "metadata": {
    "name": "meter group name"
  }
}

The response contains a unique device group ID.

Example response:

"0195a3c0-5662-7145-a79c-055fee257bec"

API OBJECT documentation (Create Device Groups)


Add Devices to Groups

To add devices to an existing group, send a request with the device IDs to the AddDevicesToGroup endpoint.

Example request:

{
  "groupId": "0195a3c0-5662-7145-a79c-055fee257bec",
  "deviceId": [
    "3db9bf08-42f7-4be5-9c0b-97fc34a0bfd1",
    "238e9bba-4ae5-4df0-b09a-e6995e14847e"
  ]
}

API OBJECT documentation (Create Device Groups)


Remove Devices from Groups

To remove devices from an existing group, send a request with the device IDs to the RemoveDevicesFromGroup endpoint.

Example request:

{
  "groupId": "0195a3c0-5662-7145-a79c-055fee257bec",
  "deviceId": [
    "3db9bf08-42f7-4be5-9c0b-97fc34a0bfd1",
    "238e9bba-4ae5-4df0-b09a-e6995e14847e"
  ]
}

API OBJECT documentation (Create Device Groups)


Back to articles