|  Developer
Updated on May 25, 2023

hub.item.groups.list

  • Version: 1.0
  • Classes: UI
  • Title: Scene manager categories
  • Description: Returns an array of item groups by id
Edit
Field Type Required Description
ids array of IDs Filter output with only these item groups
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
  • Array/filtered array of item groups or version of device groups list.
Edit
Code Message Data
-32602 Wrong params,
-32602 Wrong field of object
Edit
Edit

1. Get the full list

Edit
				
					{
    "id": "__ID__",
    "api": "1.0",
    "method": "hub.item.groups.list",
    "params": {
    }
}				
			
Edit
				
					{
  "api": "1.0",
  "error": null,
  "id": "633216245ab7be12415365c4",
  "result": {
    "itemGroups": [
      {
        "_id": "633216245ab7be12415365c4",
        "name": "switched",
        "itemNames": [ "switch" ],
        ... all oher fields ...
        "persistent": false
      }
    ],
    "version": "37095e6a9af5f92895099c7ddddd3c23caface71"
  }
}				
			
Edit

1. Optimised request: client has item groups list of specific version already and asks about the changed one:

Edit
				
					{
  "id": "__ID__",
  "api": "1.0",
  "method": "hub.item.groups.list",
  "params": {
    "version": "37095e6a9af5f92895099c7ddddd3c23caface71"
  }
}				
			
Edit
				
					{
"api": "1.0",
"error": null,
"id": "633216245ab7be12415365c4",
"result": {
"version": "37095e6a9af5f92895099c7ddddd3c23caface71"
}
}				
			

Note: By default, returns full list of item group objects. Note: The can be used to avoid passing data from a controller to a client, if the client already has the same version of data