|  Developer
Updated on November 26, 2021

item_added

  • sent when an item got registered for some device (can be sent only as a part of a device.added sequence).
				
					{
    event = "item_added"
    _id = "588b7eb528b12d03be86f36f"
    deviceId = "588t7eb528b12d03be86f36f"
    enum = {}
    deviceName = "Switcher"
    deviceArmed = false
    hasGetter = true
    hasSetter = false
    name = "alarm_water"
    show = true
    scale = ""
    valueType = int
    valueFormatted = ""
    value = 0
    valueMin = 0
    valueMax = 0
    elementsMaxNumber = 2
    userCodeRestriction = "\d{4}"
}				
			
Field Type Required Description
event string + type of an event
_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
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
valueMin object – lower limit of item’s value field
valueMax object – upper limit of item’s value field
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 array of strings – List of available pin code modes. It’s used in item.