hub.item.added
- Broadcast sent when an item got registered for some device (can be sent only as a part of a device.added sequence).
Edit
Field | Type | Required | Description |
---|---|---|---|
_id | string | + | an id of the item |
deviceId | string | + | an id of a device this item belongs to |
enum | array | – | finite array of possible token values |
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 |
hasGetter | bool | + | whether the item provides an ability to get a value |
hasSetter | bool | + | whether the item provides an ability to set a value |
info | object | – | some additional information about an item |
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, numeric part |
valueMax | number | – | upper limit of item’s value field, numeric part |
elementsMaxNumber | int | – | max allowed elements of a dictionary 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. |
syncNotification | bool | + | Special mark to request data synchronization between Cloud and controller (always true) |
fwTimestampMs | int64 | + | A hub system timestamp in milliseconds when the event has happened. |
valueIndent | JsonObject | – | Defining minimal value indent between different items |
valueIndent.item | string | – | Item id of another item |
Item id of another item | float | – | Item id of another item |
parentRoom | bool | – | Defines the behavior of a child device when the parent device is moved to another room. |
Edit
{
"id": "ui_broadcast",
"msg_subclass": "hub.item.added",
"result": {
"_id": "<item_id>",
"deviceId": "<device_id>",
"enum": [],
"deviceName": "_DEVICE_NAME_",
"deviceArmed": false,
"hasGetter": true,
"hasSetter": false,
"name": "alarm_water",
"show": true,
"scale": "",
"valueType": "int",
"valueFormatted": ""
"value": 0,
"minValue": 0,
"maxValue": 0,
"elementsMaxNumber": 2,
"userCodeRestriction": "\d{4}",
"syncNotification":true,
"fwTimestampMs": 16300011122244
}
}