hub.device.item.group.expand
- Version: 1.0
- Classes: UI
- Title: Scene manager categories
- Description: Returns a list of devices that match the device groups. If the itemGroupId parameter is present, show only devices, that has items, that match the item groups.
Edit
Field | Type | Required | Description |
---|---|---|---|
deviceGroupId | string, ID | + | Expand Device Group by ID |
showItems | bool | – | If there is no itemGroupId parameter: No actual filtering on items is done.If showItems is true, populates items collection with identifiers of all the items that belong to the device. If the is an itemGroupId parameter: The value of showItems considered true. |
itemGroupId | string, ID | – | Expand Item Group by ID |
version | string, SHA1 (hex checksum) | – | Version/hash of a request If a “version” parameter is passed, and the response matches this version sha1 , return empty response with version only. |
Edit
return result fields:
- Array of Device Records : a list of devices that match the group or version of devices record list.
Edit
Code | Message | Data |
---|---|---|
WRONG_PARAMS | Wrong params, | |
BAD_PARAMS | Bad request, _id field does not exist | |
DOES_NOT_EXIST | Device or item group doesn’t exist |
Edit
Edit
Get the full list
Edit
{
"id": "_ID_",
"api": "1.0",
"method": "hub.device.item.group.expand",
"params": {
"deviceGroupId": "642e5cf500000011965a8af5",
"showItems": true
}
}
Edit
{
"error": null,
"id": "_ID_",
"method": "hub.device.item.group.expand",
"result": {
"devices": [
{
"deviceId": "641828aa0000000d8434d07c",
"items": [
{
"itemId": "641829570000000d8434d07d",
"name": "switch1"
},
{
"itemId": "641829730000000d8434d07e",
"name": "switch2"
},
{
"itemId": "642ea4ba000000470f44e610",
"name": "switch3"
}
],
"name": "TestSwitch"
}
],
"version": "37095e6a9af5f92895099c7ddddd3c23caface71"
}
}
Edit
Optimised request: client has devices list of specific version already and asks about the changed one:
Note: By default, returns full list of devices in a device group. Note: The “version” can be used to avoid passing data from a controller to a client, if the client already has the same version of data.