|  Developer
Updated on November 12, 2021

hub.data.list

  • Version: 1.0
  • Classes: UI
  • Title: Hub data list
  • The command allows to request data from multiple collections from a hub in one request, allows data filtering by id and field names.
Edit
  • devices, items, rooms, scenes
  • All of them are optional, but at least on is required.
Name Required Description
devices If this field is present: a response with the devices will be sent anyway. If it has null value than all devices will be sent.
devices.ids Array of IDs of requested devices. Only requested devices will be in the answer. If the controller doesn’t have requested device then null will be send instead of device data.
devices.fields Description of fields filtering. If this field is missed than all fields will be present in answer.
devices.fields.include Name of fields which should be in answer. Possible values: parentDeviceId, category, subcategory, deviceTypeId, gatewayId, name, type, batteryPowered, reachable, armed, roomId, persistent, info, serviceNotification, security, ready, status
items If this field is present: a response with the items will be sent anyway. If it has null value than all items will be sent.
items.ids Array of IDs of requested items. Only requested items will be in the answer. If the controller doesn’t have requested item then null will be send instead of item data.
items.fields Description of fields filtering. If this field is missed than all fields will be present in answer.
items.fields.include Name of fields which should be in answer. Possible values: deviceId, enum, hasGetter, hasSetter, name, show, scale, valueType, valueFormatted, value, minValue, maxValue, elementsMaxNumber, userCodeRestriction, elementsMaxNumberPerArray, oneWeekDayCost, oneShiftedWeekDayCost
rooms If this field is present: a response with the rooms will be sent anyway. If it has null value than all rooms will be sent.
rooms.ids Array of IDs of requested rooms. Only requested rooms will be in the answer. If the controller doesn’t have requested room then null will be send instead of room data.
rooms.fields Description of fields filtering. If this field is missed than all fields will be present in answer.
rooms.fields.include Name of fields which should be in answer. Possible values: enabled, group_id, is_group, name, parent_id, then, when
scenes If this field is present: a response with the scenes will be sent anyway. If it has null value than all scenes will be sent.
scenes.ids Array of IDs of requested scenes. Only requested scenes will be in the answer. If the controller doesn’t have requested scene then null will be send instead of scene data.
scenes.fields Description of fields filtering. If this field is missed than all fields will be present in answer.
scenes.fields.include Name of fields which should be in answer. Possible values: enabled, group_id, is_group, name, parent_id, then, when
features If this field is present: a response with the features will be sent anyway. If it has null value than all features will be sent.
features.names Array of features names. Only requested features will be in the answer. If the controller doesn’t have requested feature then null will be send instead of feature data.
features.fields Description of fields filtering. If this field is missed than all fields will be present in answer.
features.fields.include Name of fields which should be in answer. Possible values: status, version
settings If this field is present: a response with the settings will be sent anyway. If it has null value than all settings will be sent.
settings.names Array of settings names. Only requested settings will be in the answer. If the controller doesn’t have requested setting then null will be send instead of setting data.
settings.fields Description of fields filtering. If this field is missed than all fields will be present in answer.
settings.fields.include Name of fields which should be in answer. Possible values: name, valueType, value, enum
Edit
Edit
				
					{
    "api": "1.0",
    "method": "hub.data.list",
    "id": "<REQUEST_ID>",
    "params": {
        "devices":null,
        "items":null,
        "rooms": null,
        "scenes":null
    }
}				
			
Edit
				
					{
    "api": "1.0",
    "method": "hub.data.list",
    "id": "<REQUEST_ID>",
    "params": {
        "devices":{ 
            "ids":[], "fields": { "include":[] }
         },
        "items":{ 
            "ids":[], "fields": { "include":[] }
         },
        "rooms":{ 
            "ids":[], "fields": { "include":[] }
         },
        "scenes":{ 
            "ids":[], "fields": { "include":[] }
         },
        "features":{
            "names":[], "fields": { "include":[] }
         },
        "settings":{
            "names":[], "fields": { "include":[] }
         }
    }
}				
			
Edit
Type of error Error code Reason Data Field
Invalid parameters -32602 Empty params rpc.params.invalid
Wrong format of request fields -32602 Wrong params rpc.params.invalid.[NAME]
Edit
Answers: Request will send a few answers with same request and sender info in each answer. Each type of controller sends in a separate answer.
				
					{
    "api": "1.0",
    "error": null,
    "method": "hub.data.list",
    "id": "<REQUEST_ID>",
    "result": {
        "devices": {
            "5e6b361746abd40dfb1494c1":{
                "name": "Smart Plug",
                "reachable": true,
                "armed": false,
                "serviceNotification": false,
                "roomId": "",
                "status": "idle"
            }
        }
    }
}
{
    "api": "1.0",
    "error": null,
    "method": "hub.data.list",
    "id": "<REQUEST_ID>",
    "result": {
        "items": {
            "5e6b361746abd40dfb1494c2":{
                "value": "idle"
            },
            "5e6b361746abd40dfb1494c3":null
        }
    }
}
{
    "api": "1.0",
    "error": null,
    "method": "hub.data.list",
    "id": "<REQUEST_ID>",
    "result": {
        "rooms": {
            "8e6b361746abd40dfb1494c4":{
                "name": "Living Room"
            },
            "8e6b361746abd40dfb149417":{
                "name": "Hall"
            }
        }
    }
}
{
    "api": "1.0",
    "error": null,
    "method": "hub.data.list",
    "id": "<REQUEST_ID>",
    "result": {
        "scenes": {
            "5c7ff48b7f00002a07a408e3":{
                "name": "Scene1"
            },
            "5c6ec961cc01eb07f86f9dd9":{
                "name": "Test Scene"
            }
        }
    }
}				
			
				
					The order of requests to be sent is always the same: devices, items, rooms, scenes.