|  Developer
Updated on November 20, 2021

hub.items.list

Connection type:
Permissions:

  • Provides a list of registered items on the hub.
  • Note: this request doesn’t take a device id, so it returns items for ALL devices.
Edit
				
					{
    "method": "hub.items.list",
    "id": "_ID_",
    "params": {}
}				
			
request with filter by deviceId:
				
					{
    "method": "hub.items.list",
    "id": "_ID_",
    "params": {
        "deviceIds": [
            "deviceId0",
            "deviceId1"
        ]
    }
}
				
			
Field Type Required Description
deviceIds (optional) string[] Device ID array to filter device items list with.
Edit
Field Type Required Description
_id string + An id of the item
deviceId string + An id of a device this item belongs to
deviceName string see device.name !!!MUST BE DROPPED!!! temporary add for house mode events
deviceArmed bool see device.armed !!!MUST BE DROPPED!!! temporary add for house mode events
enum array Finite array of possible token values
hasGetter bool + Whether the item provides an ability to get a value
hasSetter bool + whether the item provides an ability to set a value
name string + A name(type) of the item
show bool + Whether to show the item (on the UI) or not
scale string A name of measurement units
valueType string + A type of an item’s value
valueFormatted string + An item formatted value
value object + An item value
minValue number Lower limit of item’s value field, (for scalable values – only numeric part)
maxValue number Upper limit of item’s value field, (for scalable values – only numeric part)
elementsMaxNumber int max allowed elements of a dictionary or an array value
stringRestriction string Regexp restriction for a value in item of value type
userCodeRestriction string Regexp restriction for a field in any value of value type. E.g. it’s used in item .
userCodeModes JsonArray List of available pin code modes. It’s used in item.
elementsMaxNumberPerArray int max allowed elements of each array ( if array is subtype of dictionary or another array )
oneWeekDayCost int cost of one week day in item .
oneShiftedWeekDayCost int cost of one shifted (startTime > stopTime) week day in item
valueIndent JsonObject Defining minimal value indent between different items
valueIndent.item string Item id of another item
valueIndent.minIndent float Minimal indent between current item and another item
Note, each array in item can contain different amount of “weekly_interval”. Calculate weekly_interval cost by following pseudo code:
				
					oneWeekDayCost ?
    ( ( startTime > stopTime and oneShiftedWeekDayCost ) ? oneShiftedWeekDayCost : oneWeekDayCost ) *
        weekly_interval.days.length :
    1				
			

Items list filtering

request.params.deviceIds Result Behavior Description
undefined No filtering will be performed Default result will contain the whole items list
[] No filtering will be performed Custom result will contain the whole items list
[ deviceId ], [ deviceId0, deviceId1, … ] filtered result Custom resulting items list will contain only specific devices’ items. If deviceId specified doesn’t match any items, items array in response will be empty.
Edit
Edit
Get information about registered items on the hub.
Edit
				
					{
    "method": "hub.items.list",
    "id": "_ID_",
    "params": {}
}				
			
Edit
				
					{
    "api": "1.0",
    "error": null,
    "id": "_ID_",
    "result": {
        "items": [
            {
                "_id": "5cef9bf17f00007937ab8015",
                "deviceId": "5cef9bf17f00007937ab8013",
                "deviceName": "_DEVICE_NAME_",
                "deviceArmed": false,
                "enum": [
                    "idle",
                    "heating",
                    "cooling",
                    "fan_only",
                    "vent_economizer",
                    "aux_heating",
                    "2nd_stage_heating",
                    "2nd_stage_cooling"
                ],
                "hasGetter": true,
                "hasSetter": false,
                "name": "thermostat_operating_state",
                "show": true,
                "type": "token",
                "value": "idle",
                "valueFormatted": "idle",
                "elementsMaxNumber": 2,
                "userCodeRestriction": "\d{4}"
            }
        ]
    }
}				
			
Edit
Get information about registered items on the hub, filtered by specific device Id.
Edit
				
					{
    "method": "hub.items.list",
    "id": "_ID_",
    "params": {
        "deviceIds": [
            "5e4e6e3f7f00007ff33c7591",
            "5e4e6e3f7f00007ff33cffff"
        ]
    }
}				
			
Edit
				
					{
    "api": "1.0",
    "error": null,
    "id": "_ID_",
    "result": {
        "items": [
            {
                "_id": "5e4e6e3f7f00007ff33c7599",
                "deviceId": "5e4e6e3f7f00007ff33c7591",
                "hasGetter": true,
                "hasSetter": false,
                "name": "electric_meter_watt",
                "show": true,
                "value": 0,
                "valueFormatted": "0",
                "valueType": "float"
            },
            ...
            {
                "_id": "5e4e6e3f7f00007ff33c7aaa",
                "deviceId": "5e4e6e3f7f00007ff33cffff",
                "hasGetter": true,
                "hasSetter": false,
                "name": "electric_meter_watt",
                "show": true,
                "value": 0,
                "valueFormatted": "0",
                "valueType": "float"
            },
            ...
        ]
    }
}