Hub Broadcasts

Description

Broadcasts informs about events occurred on HUB.


hub.info.changed

Broadcast sent when hub info changed. Only fields that have values changed since previous broadcast will be sent. As for now only battery info changes are reported.

result:

Field Type Required Description
battery Object - If controller does not have battery support no battery section will be in result.
battery.status enum - initializing, missing, charging, full, discharging
battery.stateOfCharge int - Percent of available battery capacity
battery.remainingTime int - Estimated remaining time in minutes to empty if discharging, or to full if charging
battery.health int - Percent of current full capacity relative to original full capacity

Examples

Broadcast when battery starts charging

{
    "id": "ui_broadcast",
    "msg_subclass": "hub.info.changed",
    "result": {
        "battery": {
            "status": "charging",
            "remainingTime": 369
        }
    }
}

hub.gateway.added

Broadcast sent when a gateway got registered on the hub (after plugin which provides this gateway has been installed).

        {
          "id": "ui_broadcast",
          "msg_subclass": "hub.gateway.added",
          "result": {
            "_id": "588b7eb528b12d03be86f36f",
            "label": "ZWave",
            "name": "zwave",
            "pluginId": "zwave",
            "reason": "Start bus"
            "ready": true,
            "unreachableActions": [],
            "unreachableReasons": [],
            "operations":{
                "deviceAdding":"ZWAVE:/start_include.template",
                "deviceRemoving":"ZWAVE:/start_exclude.template"
                "deviceSettings":[
                    {
                        "label":"Parameters",
                        "template":"ZWAVE:/device/parameters_page.template"
                    },
                    {
                        "label":"Advanced",
                        "template":"ZWAVE:/device/advanced_page.template"
                    }
                ],
            },
            "settings": [
                {
                    "label":"General",
                    "template":"ZWAVE:/settings/general_page.template"
                },
                {
                    "label":"Advanced",
                    "template":"ZWAVE:/settings/advanced_page.template"
                },
            ],
            "setItemValueCommand": "HUB:zwave/scripts/set_item_value"
          }
        }
Field Type Required Description
_id string + an id of the gateway
label string + a public name of the gateway
name string + a name specified within a plugin's config which provides this gateway
pluginId string + an id (name, not a db's id) of a plugin this gateway is a part of
reason string + a public reason of not 'ready' status
ready bool + whether gateway is ready for work
unreachableActions object -
unreachableReasons object -
operations object + a gateway external API
settings object + a section with custom setting templates for the gateway
setItemValueCommand string + DO WE NEED TO EXPOSE SUCH INFO TO THE UI???

hub.gateway.updated

Broadcast sent when some changes happened to a gateway (broadcast contains only changes).

        {
          "id": "ui_broadcast",
          "msg_subclass": "hub.gateway.updated",
          "result": {
            "_id": "588b7eb528b12d03be86f36f",
            "__GATEWAY_CHANGEABLE_FIELD": value
          }
        }
Field Type Required Description
_id string + an id of the gateway
__GATEWAY_CHANGEABLE_FIELD any +

Gateway fields which may be updated (__GATEWAY_CHANGEABLE_FIELD):

Field Type Description
ready bool whether gateway is ready for work

hub.gateway.removed

Broadcast sent when a gateway got unregistered on the hub (after plugin which provides this gateway has been uninstalled).

        {
          "id": "ui_broadcast",
          "msg_subclass": "hub.gateway.removed",
          "result": {
            "_id": "588b7eb528b12d03be86f36f"
          }
        }
Field Type Required Description
_id string + an id of the gateway

hub.device.added

Broadcast sent when a device got registered for some gateway.

        {
          "id": "ui_broadcast",
          "msg_subclass": "hub.device.added",
          "result": {
            "_id": "588b7eb528b12d03be86f36f",
            "parentDeviceId": "588t7eb528b12d03be86f36f",
            "deviceTypeId": "16_4_1_351_8706_256",
            "gatewayId" : "588b76a44e8c6e50a2826d9f",
            "serviceNotification":false,
            "syncNotification":true,
            "category": "dimmable_light",
            "subcategory": "dimmable_bulb",
            "name" : "_DEVICE_NAME_",
            "type": "switch",
            "batteryPowered": false,
            "reachable": true,
            "armed": false,
            "roomId" : "_ROOM_ID_",
            "security" : "low",
            "info": "" { "key": "value", "keyN": "valueN" },
            "ready": true,
            "status": "idle"
          }
        }
Field Type Required Description
_id string + an id of the device
parentDeviceId string + an id of the parent device. Empty in case of main device
category string + a device category
subcategory string + a device subcategory
deviceTypeId string + a device type id, generated from manufacturer info
gatewayId string + an id of a gateway this device belongs to
name string + a device name
type string + a device type
batteryPowered bool + is device battery powered
reachable bool + is device reachable
armed bool + is device armed by house mode
roomId string + an id of a room this device is assigned to
persistent bool - is device persistent. Persistent device can't be removed by force removing. False by default.
info object - some additional information for this device
security string + Security level how the device is connected. Possible options: no, low, middle, high
ready bool + Ready status of device. true value means device is ready to any changes. false value means device is busy.
status string + a device status

hub.device.updated

Broadcast sent when some changes happened to a device (broadcast contains only changes).

        {
          "id": "ui_broadcast",
          "msg_subclass": "hub.device.updated",
          "result": {
            "_id": "588b7eb528b12d03be86f36f",
            "armed": true,
            "serviceNotification":false,
            "syncNotification":false,
            "__DEVICE_CHANGEABLE_FIELD": value
          }
        }
Field Type Required Description
_id string + An id of the device
armed bool + See device.armed
__DEVICE_CHANGEABLE_FIELD any +

Device fields which may be updated (__DEVICE_CHANGEABLE_FIELD):

Field Type Description
name string A device name
reachable bool Whether device is reachable
roomId string An id of a room this device is assigned to
ready bool Ready status of a device. true value means the device is ready to any changes. false value means the device is busy.

hub.device.removed

Broadcast sent when a device got unregistered from some gateway.

        {
          "id": "ui_broadcast",
          "msg_subclass": "hub.device.removed",
          "result": {
            "_id": "588b7eb528b12d03be86f36f",
            "serviceNotification":true,
            "syncNotification":true
          }
        }
Field Type Required Description
_id string + an id of the device

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).

        {
          "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
            }
        }
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
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 string
userCodeRestriction string - Regexp restriction for a field code in any value of userCode value type. E.g. it's used in item user_codes.
userCodeModes JsonArray - List of available pin code modes. It's used in user_codes 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 |


hub.item.updated

Broadcast sent when some changes happened to an item (broadcast contains only changes).

        {
          "id": "ui_broadcast",
          "msg_subclass": "hub.item.updated",
          "result": {
            "_id": "588b7eb528b12d03be86f36f",
            "deviceId": "<DEVICE_ID>",
            "deviceName": "<DEVICE_NAME>",
            "deviceCategory" : "<DEVICE_CATEGORY>",
            "deviceSubcategory" : "<DEVICE_SUBCATEGORY>",
            "roomName" : "<DEVICE_ROOM_NAME>",
            "userNotification": false,
            "parentDeviceId": "<OPTIONAL_PARENT_DEVICE_ID>",
            "serviceNotification":false,
            "syncNotification":false,
            "notifications": [ "12314324", "978343" ],
            "deviceArmed": false,
            "name": "alarm_water",
            "elementsMaxNumber": 2,
            "userCodeRestriction": "\d{4}",
            "<ITEM_CHANGEABLE_FIELD>": "<FIELD_VALUE>"
          }
        }
Field Type Required Description
_id string + an id of the item
deviceId string + related device._id
deviceName string + related device.name
deviceCategory string + a device category
deviceSubcategory string + a device subcategory
parentDeviceId string - If related device have a parent, this field will have it's id
roomName string + a room name
userNotification bool + Special flag for Cloud for converting this broadcast to User Notification
notifications JsonArray + List of user ids for sending broadcast notification to users( null - all users / - no one )
name string + see item.name(type)
deviceArmed bool - related device.armed state
elementsMaxNumber int - Max allowed elements of a dictionary value
stringRestriction string - Regexp restriction for a value in item of value type string
userCodeRestriction string - Regexp restriction for a field code in any value of userCode value type. E.g. it's used in item user_codes.
userCodeModes JsonArray - List of available pin code modes. It's used in user_codes item.
protectService string - A Ezlo Protect service associated with the device. Will appear only if the Ezlo Protect service is on, the device is an armed panic button, and an item is a security_threat. One of: police, fire, medical.
__ITEM_CHANGEABLE_FIELD any +

Item fields which may be updated (__ITEM_CHANGEABLE_FIELD):

Field Type Description
show bool whether to show the item (on the UI) or not
valueFormatted string an item value formatted
value object an item value
minValue number lower limit of item's value field
maxValue number upper limit of item's value field
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

hub.item.dictionary.updated

Broadcast sent when some changes happened to an dictionary item. This broadcast is sent instead of hub.item.update broadcast.

Initiators:

Example:

{
    "id": "ui_broadcast",
    "msg_subclass": "hub.item.dictionary.updated",
    "result": {
        "_id": "588b7eb528b12d03be86f36f",
        "deviceId": "5df0b9e4dfdabe58a5a60020",
        "deviceName": "Touchscreen Deadbolt",
        "deviceCategory" : "door_lock",
        "deviceSubcategory" : "",
        "roomName" : "",
        "userNotification": false,
        "serviceNotification":false,
        "notifications": [ "12314324", "978343" ],
        "deviceArmed": false,
        "name": "user_codes",
        "operation":"added",
        "element": {
            "1": {
                "value": {
                    "code": "Alex",
                    "name": "1234"
                }
            }
        }
    }
}

Parameters:

Field Type Required Description
_id string + an id of the item
deviceId string + related device._id
deviceName string + related device.name
deviceCategory string + a device category
deviceSubcategory string + a device subcategory
roomName string + a room name
userNotification bool + Special flag for Cloud for converting this broadcast to User Notification
notifications JsonArray + List of user ids for sending broadcast notification to users( null - all users / - no one )
name string + see item.name(type)
deviceArmed bool - related device.armed state
elementsMaxNumber int + max allowed elements of a dictionary value
stringRestriction string - Regexp restriction for a value in item of value type string
userCodeRestriction string - Regexp restriction for a field code in any value of userCode value type. E.g. it's used in item user_codes.
userCodeModes JsonArray - List of available pin code modes. It's used in user_codes item.
operation string + The operation field defines the initiator of this broadcast:
hub.item.dictionary.value.add - added
hub.item.dictionary.value.set - updated
hub.item.dictionary.value.remove - removed
element JsonObject + The element what was updated. It contains element number and element value.
element.N.value any + The element value.

hub.item.removed

Broadcast sent when an item got unregistered from some device (can be sent only as a part of a device.removed sequence).

        {
          "id": "ui_broadcast",
          "msg_subclass": "hub.item.removed",
          "result": {
            "_id": "588b7eb528b12d03be86f36f",
            "deviceId": "588b7eb528b12d03be86f36e",
            "syncNotification":true
          }
        }
Field Type Required Description
_id string + An id of the item
deviceId string + An id of a device the item have been deleted

hub.gateway.setting.added

Broadcast sent when a gateway setting was added for some gateway.

{
   "id":"ui_broadcast",
   "msg_subclass":"hub.gateway.setting.added",
   "result":{
      "_id":"zwave.reset",
      "gatewayId":"5cef9bf17f00007937ab8015",
      "status":"synced",
      "description":{
         "lang_tag":"zwave_reset_settings",
         "text":"This action allow you to reset your current Z-Wave network if something went wrong."
      },
      "valueType":"action",
      "value":{
         "lang_tag":"reset_zwave_button",
         "text":"Reset Z-Wave network"
      }
   }
}

hub.gateway.setting.updated

Broadcast sent when a gateway setting was updated.

{
    "id": "ui_broadcast",
    "msg_subclass": "hub.gateway.setting.updated",
    "result": {
        "_id": "zwave.pool_interval",
        "status": "pending"
    }
}

hub.gateway.setting.removed

Broadcast sent when a gateway setting was removed.

{
    "id": "ui_broadcast",
    "msg_subclass": "hub.gateway.setting.removed",
    "result": {
        "_id": "zwave.pool_interval"
    }
}

hub.device.setting.added

Broadcast sent when a setting got registered for some device (can be sent only as a part of a device.added sequence).

{
    "id": "ui_broadcast",
    "msg_subclass": "hub.device.setting.added",
    "result": {
        "_id": "5ef177ff7f0000258f9f8c33",
        "description": {
            "lang_tag": "zwave_config_descr_335_20548_13619_13",
            "text": "The rate at which the energy readings are reported"
        },
        "deviceId": "5ef177ff7f0000258f9f8c27",
        "info": {
            "zwave.parameter_number": 13,
            "zwave.parameter_size": 2
        },
        "label": {
            "lang_tag": "zwave_config_label_335_20548_13619_13",
            "text": "Energy monitoring"
        },
        "status": "synced",
        "value": 0,
        "valueDefault": 0,
        "valueMax": 255,
        "valueMin": 0,
        "valueType": "int"
    }
}
Fields Type Required Description
_id string + an id of the setting
deviceId string + an id of a device the setting is registered for
label text + name
description text + description
info object - implementation details
status string + synchronization status (synced, pending or failed)
valueType string + setting type
elementType string - type of a single element of dictionary/array setting types (e.g. zwave_configuration)
value int : action : bool : string : rgb : scalable : dictionary of zwave_configuration +
valueDefault -
valueMin int : scalable - minimal value for int and scalable setting types
valueMax int : scalable - maximal value for int and scalable setting types
enum dictionary.text -
elementsMaxNumber int - maximum list or dictionary

info field

Fields Type Required Description
zwave.parameter_number int + corresponding parameter number
zwave.parameter_size int + size of the corresponding parameter's value

hub.device.setting.updated

Broadcast sent when setting's value is changed.

{
    "id": "ui_broadcast",
    "msg_subclass": "hub.device.setting.updated",
    "result": {
        "_id": "5ef177ff7f0000258f9f8c33",
        "value": 5
    }
}

hub.device.setting.dictionary.updated

Broadcast sent when some changes happened to a dictionary setting. This broadcast is sent instead of hub.device.setting.updated broadcast.

Initiators:

{
    "id": "ui_broadcast",
    "msg_subclass": "hub.item.dictionary.updated",
    "result": {
        "_id": "5ef177ff7f0000258f9f8c34",
        "element": {
            "abcd": {
                "value": {
                    "description": "BBB",
                    "format": "dec",
                    "name": "AAA",
                    "number": 13,
                    "size": 2,
                    "value": 5
                }
            }
        },
        "operation": "removed"
    }
}
Fields Type Required Description
_id string + an id of the setting
element dictionary + difference after changes are applied
operation string + added, updated or removed

hub.device.setting.removed

Broadcast sent when a setting got unregistered from some device (can be sent only as a part of a device.removed sequence).

{
    "id": "ui_broadcast",
    "msg_subclass": "hub.device.setting.removed",
    "result": {
        "_id": "5ef177ff7f0000258f9f8c33"
    }
}

hub.device.checked

Informs about device check progress and result

initiators: * core.send_device_checked_broadcast that should be called as the result of hub.device.check

result:

Field Type Required Description
deviceId string + Id of target device. It should be only device of current gateway
status string + Status of checking process. Possible values: started, finished, failed.
completed int - Progress of operation
error object - Description of failed status
error.code int + Code of error
error.data string + String token of error
error.message string - Detailed description of error

Examples

{
    "id": "ui_broadcast",
    "msg_subclass": "hub.device.checked",
    "result": {
        "completed": 0,
        "device_id": "asd89ujn234kjndfdsfkjn3",
        "status": "started"
    }
}
{
    "id": "ui_broadcast",
    "msg_subclass": "hub.device.checked",
    "result": {
        "device_id": "asd89ujn234kjndfdsfkjn3",
        "error": {
            "code": -42,
            "data": "error.data",
            "message": "error message"
        },
        "status": "failed"
    }
}

hub.favorite.added

Broadcast with info about added devices, items, rules to favorite. It's sent after callMethod hub.favorite.set has been triggered.

    {
        "id": "ui_broadcast",
        "msg_subclass": "hub.favorite.added",
        "initiator": {
            "api_name": "some api name here",
            "connection_type": "UI",
            "peer_unique_id": "23/3"
        },
        "result": {
            "devices": [
                "_DEVICE_ID_"
            ],
            "items": [
                "_ITEM_ID_"
            ],
            "rules": [
                "_RULE_ID_"
            ]
        }
    }
Field Description
result.devices (optional) Added devices array
result.items (optional) Added items array
result.rules (optional) Added rules array

hub.favorite.removed

Broadcast with info about removed devices, items, rules from favorite. It's sent after callMethod hub.favorite.set has been triggered.

    {
        "id": "ui_broadcast",
        "msg_subclass": "hub.favorite.removed",
        "initiator": {
            "api_name": "some api name here",
            "connection_type": "UI",
            "peer_unique_id": "23/3"
        },
        "result": {
            "devices": [
                "_DEVICE_ID_"
            ],
            "items": [
                "_ITEM_ID_"
            ],
            "rules": [
                "_RULE_ID_"
            ]
        }
    }
Field Description
result.devices (optional) Removed devices array
result.items (optional) Removed items array
result.rules (optional) Removed rules array

hub.modes.switched

Sends information about house mode switch process

result fields:

Field Type Required Description
form string + Id of the from mode
to string + Id of the to mode
status string + "done", "begin" or "cancel"
switchToDelay integer + Delay (sec) before switch to the mod
{
    "id": "ui_broadcast",
    "msg_subclass": "hub.modes.switched",
    "result": {
        "from": "<modeId>",
        "to": "<modeId>",
        "status": "done",
        "switchToDelay": 0
    }
}

hub.modes.notifications.notify_all

Sends information about house mode notification "send to all"

result fields:

Field Type Required Description
modeId string + Id of the mode
all bool + enable/disable send notifications to all
{
    "id": "ui_broadcast",
    "msg_subclass": "hub.modes.notifications.notify_all",
    "result": {
        "modeId": "<modeId>",
        "all": true
    }
}

hub.modes.notifications.added

Sends information about house mode notification list changes (after add)

result fields:

Field Type Required Description
modeId string + Id of the mode
notification string + Id new user ID
{
    "id": "ui_broadcast",
    "msg_subclass": "hub.modes.notifications.added",
    "result": {
        "modeId": "<modeId>",
        "notification": "<userId>"
    }
}

hub.modes.notifications.removed

Sends information about house mode notification list changes (after remove)

result fields:

Field Type Required Description
modeId string + Id of the mode
notification string + A removed user ID
{
    "id": "ui_broadcast",
    "msg_subclass": "hub.modes.notifications.removed",
    "result": {
        "modeId": "<modeId>",
        "notification": "<userId>"
    }
}

hub.modes.disarmed_devices.added

Sends information about house mode disarmed devices list changes (after add)

result fields:

Field Type Required Description
modeId string + Id of the mode
disarmedDevice string + Id of the device
{
    "id": "ui_broadcast",
    "msg_subclass": "hub.modes.disarmed_devices.added",
    "result": {
        "modeId": "<modeId>",
        "disarmedDevice": "<deviceId>"
    }
}

hub.modes.disarmed_devices.removed

Sends information about house mode disarmed devices list changes (after remove)

result fields:

Field Type Required Description
modeId string + Id of the mode
disarmedDevice string + A removed device ID
{
    "id": "ui_broadcast",
    "msg_subclass": "hub.modes.disarmed_devices.removed",
    "result": {
        "modeId": "<modeId>",
        "disarmedDevice": "<deviceId>"
    }
}

hub.modes.alarms_off.added

Sends information about house mode alarms_off list changes (after add)

result fields:

Field Type Required Description
modeId string + Id of the mode
alarmsOffDevice string + Id of the device
{
    "id": "ui_broadcast",
    "msg_subclass": "hub.modes.alarms_off.added",
    "result": {
        "modeId": "<modeId>",
        "alarmsOffDevice": "<deviceId>"
    }
}

hub.modes.alarms_off.removed

Sends information about house mode alarms_off list changes (after remove)

result fields:

Field Type Required Description
modeId string + Id of the mode
alarmsOffDevice string + Id of the device
{
    "id": "ui_broadcast",
    "msg_subclass": "hub.modes.alarms_off.removed",
    "result": {
        "modeId": "<modeId>",
        "alarmsOffDevice": "<deviceId>"
    }
}

hub.modes.cameras_off.added

Sends information about house mode cameras_off list changes (after addition).

result fields:

Field Type Required Description
modeId string + Id of the mode
camerasOffDevice string + Id of the device
{
    "id": "ui_broadcast",
    "msg_subclass": "hub.modes.cameras_off.added",
    "result": {
        "modeId": "<modeId>",
        "camerasOffDevice": "<deviceId>"
    }
}

hub.modes.cameras_off.removed

Sends information about house mode cameras_off list changes (after removing).

result fields:

Field Type Required Description
modeId string + Id of the mode
camerasOffDevice string + Id of the device
{
    "id": "ui_broadcast",
    "msg_subclass": "hub.modes.cameras_off.removed",
    "result": {
        "modeId": "<modeId>",
        "camerasOffDevice": "<deviceId>"
    }
}

hub.modes.changed

Sends information about changed properties of particular house mode

initiators:

result fields:

Field Type Required Description
modeId string + Mode ID
disarmedDefault bool - Disarmed default state
{
    "id": "ui_broadcast",
    "msg_subclass": "hub.modes.changed",
    "result": {
        "modeId": "<modeId>",
        "disarmedDefault": true
    }
}

hub.modes.protect.buttons.added

Sends information about an object added to a house modes protectButtons collection.

initiators:

result fields:

Field Type Required Description
deviceId string + Id of the device
service enum + A name of a Ezlo Protect service: police, fire, medical

example:

{
    "id": "ui_broadcast",
    "msg_id": "602bce272231406433998dae",
    "msg_subclass": "hub.modes.protect.buttons.added",
    "result": { 
        "deviceId": "601d27d8223140327f691c99", 
        "service": "fire"
    }
}

hub.modes.protect.buttons.updated

Sends information about an object in a house modes protectButtons collection have been updated.

initiators:

result fields:

Field Type Required Description
deviceId string + Id of the device
service enum + A name of a Ezlo Protect service: police, fire, medical

example:

{
    "id": "ui_broadcast",
    "msg_id": "602bce272231406433998dae",
    "msg_subclass": "hub.modes.protect.buttons.updated",
    "result": { 
        "deviceId": "601d27d8223140327f691c99", 
        "service": "fire"
    }
}

hub.modes.protect.buttons.removed

Sends information about an object added have been removed from a house modes protectButtons collection.

initiators:

result fields:

Field Type Required Description
deviceId string + Id of the device

example:

{
    "id": "ui_broadcast",
    "msg_id": "602bce272231406433998dae",
    "msg_subclass": "hub.modes.protect.buttons.removed",
    "result": { 
        "deviceId": "601d27d8223140327f691c99"
    }
}

hub.modes.protect.devices.added

Sends information about device objects added to the protectDevices collection.

initiators:

result fields:

Field Type Required Description
deviceIds array of strings + Identifiers of devices added to a collection

example:

{
    "id": "ui_broadcast",
    "msg_id": "602bce272231406433998dae",
    "msg_subclass": "hub.modes.protect.buttons.added",
    "result": { 
        "deviceIds": ["601d27d8223140327f691c99", "601d27d8223140327f691cff"]
    }
}

hub.modes.protect.devices.removed

Sends information about an object added have been removed from a house modes protectButtons collection.

initiators:

result fields:

Field Type Required Description
deviceIds array of strings + Identifiers of devices removed from a collection

example:

{
    "id": "ui_broadcast",
    "msg_id": "602bce272231406433998dae",
    "msg_subclass": "hub.modes.protect.buttons.removed",
    "result": { 
        "deviceIds": ["601d27d8223140327f691c99", "601d27d8223140327f691cff"]
    }
}

hub.network.wifi.scan.progress

Sends information about wifi scan process

initiators:

result fields:

Field Type Required Description
interfaceId string + Id of the network interface (type: wifi)
status enum + "started", "process", "finished" or "failed"
error object - For status "failed" contains error description
networks JsonArray - For status "process" contains Wifi networks list
networks.ssid string + SSID of AP
networks.bssid string - MAC address of AP
networks.security string + Security (open, wep, wpa-psk, wpa2-psk, ...)
networks.rssi integer - Signal strength of AP

errors:

Code Message Data Reason (optional)
-32500 Wifi scan command failed network.wifi.scan.failed Scan error message

example:

{
    "id": "ui_broadcast",
    "msg_subclass": "hub.network.wifi.scan.progress",
    "result": {
        "interfaceId": "wlan0",
        "status": "process",
        "networks": [
            {
                "ssid": "TestWIFI",
                "bssid" : "",
                "security": "open",
                "rssi": 0
            },
            {
                "ssid": "eZLO_House",
                "bssid" : "",
                "security": "wpa2-psk",
                "rssi": 0
            }
        ]
    }
}
{
    "id": "ui_broadcast",
    "msg_subclass": "hub.network.wifi.scan.progress",
    "result": {
        "error": {
            "code": -32500,
            "data": "network.wifi.scan.failed",
            "message": "Wifi scan failed",
            "reason": "command failed: No such device (-19)"
        },
        "interfaceId": "ra0000000",
        "status": "failed"
    }
}

hub.network.changed

Sends changes to network interfaces.

initiators:

result:

Fields and their meaning are same as in hub.network.get result. If some information disappeared corresponding field will have null value

Additional fields

Field Type Required Description
syncNotification bool + Special mark to request data synchronization between Cloud and controller (true only if status of interface was changed)

error:

Errors are same as in hub.network.get result.

Examples

Ethernet cable unplugged

{
    "id": "ui_broadcast",
    "msg_subclass": "hub.network.changed",
    "result": {
        "syncNotification":true,
        "interfaces": [
            {
                "_id": "eth0",
                "internetAvailable": false,
                "ipv4": {
                    "dns": null,
                    "gateway": null,
                    "ip": null,
                    "mask": null
                },
                "status": "down"
            }
        ]
    }
}

Ethernet cable plugged

{
    "id": "ui_broadcast",
    "msg_subclass": "hub.network.changed",
    "result": {
        "syncNotification":true,
        "interfaces": [
            {
                "_id": "eth0",
                "internetAvailable": true,
                "ipv4": {
                    "dns": [
                        "192.168.0.1"
                    ],
                    "gateway": "192.168.0.1",
                    "ip": "192.168.0.228",
                    "mask": "255.255.255.0"
                },
                "status": "up"
            }
        ]
    }
}

Ethernet connection losses internet

{
    "id": "ui_broadcast",
    "msg_subclass": "hub.network.changed",
    "result": {
        "syncNotification":false,
        "interfaces": [
            {
                "_id": "eth0",
                "internetAvailable": false
            }
        ]
    }
}

Successful connect to wifi network

{
    "id": "ui_broadcast",
    "msg_subclass": "hub.network.changed",
    "result": {
        "syncNotification":true,
        "interfaces": [
            {
                "_id": "wlan0",
                "hwaddr": "a9:b8:c7:d6:e5:f4",
                "internetAvailable": true,
                "ipv4": {
                    "dns": [
                        "192.168.10.10",
                        "1.1.1.1",
                        "8.8.8.8"
                    ],
                    "gateway": "192.168.10.1",
                    "ip": "192.168.11.142",
                    "mask": "255.255.254.0"
                },
                "status": "up",
                "wifi": {
                    "network": {
                        "bssid": "ab:cd:ef:01:23:45",
                        "encryption": "psk2",
                        "key": "super_wifi_network",
                        "mode": "sta",
                        "ssid": "super_wifi_password"
                    },
                    "region": "00"
                }
            }
        ]
    }
}

Failed attempt to connect to wifi network

{
    "id": "ui_broadcast",
    "msg_subclass": "hub.network.changed",
    "result": {
        "syncNotification":false,
        "interfaces": [
            {
                "_id": "wlan0",
                "error": {
                    "code": -32500,
                    "data": "network.connection.failed",
                    "message": "Could not connect to the network"
                },
                "hwaddr": "a9:b8:c7:d6:e5:f4",
                "wifi": {
                    "network": {
                        "bssid": "ab:cd:ef:01:23:45",
                        "encryption": "psk2",
                        "key": "super_wifi_network",
                        "mode": "sta",
                        "ssid": "awful_wifi_password"
                    },
                    "region": "00"
                }
            }
        ]
    }
}
{
    "id": "ui_broadcast",
    "msg_subclass": "hub.network.changed",
    "result": {
        "interfaces": [
            {
                "_id": "wlan0",
                "error": null,
                "hwaddr": null,
                "wifi": {
                    "network": null,
                    "region": null
                }
            }
        ]
    }
}

hub.network.modem.pin_code.enter.failed

Describe a reason of a failed attempt to enter a SIM PIN code.

initiators:


hub.network.modem.pin_code.set.failed

Describe a reason of a failed attempt to change a SIM PIN code.

initiators:


hub.network.modem.pin_code.reset.failed

Describe a reason of a failed attempt to reset a SIM PIN code.

initiators:


hub.network.modem.sim_lock.set.failed

Describe a reason of a failed attempt to change a status of sim lock.

initiators:


hub.network.modem.clear_fplmn.failed

Describe a reason of a failed attempt to clear an FPLMN list.

initiators:


hub.network.modem.reregistration.failed

Describe a reason of a failed attempt to perform mobile network reregistration.

initiators:


hub.extensions.plugin.ui_broadcast

Broadcast with custom data from Lua scripts.

initiators:

result:

custom format

Examples

Zwave gateway inclusion operation started

{
    "id": "ui_broadcast",
    "initiator": {
        "api_name": "",
        "connection_type": "HUB",
        "peer_unique_id": "17/103088"
    },
    "msg_subclass": "hub.extensions.plugin.ui_broadcast",
    "result": {
        "event": "include_started",
        "plugin": "zwave"
    }
}

hub.extensions.plugin.run.progress

Sends information about progress and result of running plugin script

initiators:

result:

Field Type Required Description
completed int + Progress of operation
error object - Error information if happened
operationId string + ID of message
status enum + finished

errors:

Code Message Data Reason (optional)
-32603 Script error ezlo.lua.script.error Status of lua interpreter
-32603 Script open error ezlo.lua.script.open -

Examples

Successful execution of plugin script

{
    "id": "ui_broadcast",
    "msg_subclass": "hub.extensions.plugin.run.progress",
    "result": {
        "operationId": "_ID_",
        "completed": 100,
        "error": null,
        "status": "finished"
    }
}

Failed execution of plugin script

{
    "id": "ui_broadcast",
    "msg_subclass": "hub.extensions.plugin.run.progress",
    "result": {
        "operationId": "_ID_",
        "completed": 0,
        "error": {
            "code": -32603,
            "data": "ezlo.lua.script.error",
            "message": "Script error",
            "reason": "basic_string::_M_construct null not valid"
        },
        "status": "failed"
    }
}

hub.software.update.progress

Information on the progress of software update operation

result:

Field Type Required Description
completed int + Progress of operation
error object - Error information if happened
operationId string + ID of corresponding hub.software.update.execute request (not supported at the moment)
serial string + Controller's serial
status enum + started, process, finished, aborted

errors:

Code Message Data
-32500 Update operations error ezlo.update.internal.operation
-32600 Bad params rpc.params.notfound
-32500 Failed to download firmware! Network problems! ezlo.update.unavailable.firmware

Examples

Successful addon update process broadcasts

{
    "id": "ui_broadcast",
    "msg_subclass": "hub.software.update.progress",
    "result": {
        "completed": 0,
        "error": null,
        "operationId": "_ID_",
        "serial": "92000123",
        "status": "started"
    }
}
{
    "id": "ui_broadcast",
    "msg_subclass": "hub.software.update.progress",
    "result": {
        "completed": 20,
        "error": null,
        "operationId": "_ID_",
        "serial": "92000123",
        "status": "process"
    }
}
...
{
    "id": "ui_broadcast",
    "msg_subclass": "hub.software.update.progress",
    "result": {
        "completed": 100,
        "error": null,
        "operationId": "_ID_",
        "serial": "92000123",
        "status": "finished"
    }
}

Error during firmware update process broadcasts

{
    "id": "ui_broadcast",
    "msg_subclass": "hub.software.update.progress",
    "result": {
        "completed": 0,
        "error": null,
        "operationId": "_ID_",
        "serial": "92000123",
        "status": "started"
    }
}
...
{
    "id": "ui_broadcast",
    "msg_subclass": "hub.software.update.progress",
    "result": {
        "completed": 100,
        "error": {
            "code": -32500,
            "data": "ezlo.update.internal.operation",
            "message" "Update operations error"
        },
        "operationId": "_ID_",
        "serial": "92000123",
        "status": "aborted"
    }
}

hub.room.created

Broadcast with id of created room on method hub.room.create

{
    "id": "ui_broadcast",
    "msg_subclass": "hub.room.created",
    "initiator": {
        "api_name": "some api name here",
        "connection_type": "UI",
        "peer_unique_id": "23/3"
    },
    "result": {
        "_id": "_OBJECT_ID_",
        "name": "Guest room"
    }
}
Field Description
_id Room's id
name Room's name

hub.room.deleted

Broadcast with room id of deleted room on method hub.room.delete

{
    "id": "ui_broadcast",
    "msg_subclass": "hub.room.deleted",
    "initiator": {
        "api_name": "some api name here",
        "connection_type": "UI",
        "peer_unique_id": "23/3"
    },
    "result": {
        "_id": "_OBJECT_ID_"
    }
}

hub.room.reordered

Broadcast with room ids of reordered rooms on method hub.room.order.set

{
    "id": "ui_broadcast",
    "initiator": {
        "api_name": "",
        "connection_type": "HUB",
        "peer_unique_id": "40/30780"
    },
    "msg_subclass": "hub.room.reordered",
    "result": {
        "roomsId": [
            "5ca707a8000000082b3d8d77",
            "5ca7079d000000082b3d8d76"
        ]
    }
}
Field Description
roomsId Room's ids

hub.room.edited

Broadcast with id of edited room on methods hub.room.name.set, hub.room.order.set

{
    "id": "ui_broadcast",
    "msg_subclass": "hub.room.edited",
    "initiator": {
        "api_name": "some api name here",
        "connection_type": "UI",
        "peer_unique_id": "23/3"
    },
    "result": {
        "_id": "_OBJECT_ID_",
        "name" : "Guest room"
    }
}
Field Description
_id MognoID of created room
name Room's name

hub.scene.added

Broadcast about the scene is successfully created. Related to hub.scenes.create function.

example:

{
    "id": "ui_broadcast",
    "msg_subclass": "hub.scene.added",
    "result": {
        "_id": "5c7ff48b7f00002a07a408e3",
        "enabled": true,
        "group_id": null,
        "is_group": false,
        "name": "testRule",
        "parent_id": "5c6ec961cc01eb07f86f9dd9",
        "syncNotification":true,
        "then": [
            {
                "blockOptions": {
                    "method": {
                        "args": {
                            "item": "item",
                            "value": "value"
                        },
                        "name": "setItemValue"
                    }
                },
                "blockType": "then",
                "fields": [
                    {
                        "name": "item",
                        "type": "item",
                        "value": "5c7fea737f00000ab55f2e5d"
                    },
                    {
                        "name": "value",
                        "type": "bool",
                        "value": false
                    }
                ]
            }
        ],
        "when": [
            {
               "blockOptions":{
                  "method":{
                     "args":{  
                        "sunstate":"sunrise",
                        "time":"time"
                     },
                     "name":"isSunState"
                  }
               },
               "blockType":"when",
               "fields":[
                  {
                     "name":"sunrise",
                     "type":"string",
                     "value":"before"
                  },
                  {
                     "name":"time",
                     "type":"hms_interval",
                     "value":"10:30"
                  }
               ]
            }
        ]
    }
}

Parameters:

See parameters here


hub.scene.deleted

Broadcast about the scene deleting. Related to hub.scenes.delete function.

Example:

{
    "id": "ui_broadcast",
    "msg_subclass": "hub.scene.deleted",
    "result": {
        "_id": "5c7ff48b7f00002a07a408e3",
        "syncNotification":true
    }
}

Parameters:

Field Type Required Description
_id string + Scene identifier
syncNotification bool + Special mark to request data synchronization between Cloud and controller (always true)

hub.scene.changed

Broadcast about updating of the scene. Related to hub.scenes.edit, hub.scenes.enabled.set, hub.scenes.notification.add, hub.scenes.notification.remove and hub.scenes.room.set functions.

Example:

{
    "id": "ui_broadcast",
    "msg_subclass": "hub.scene.changed",
    "changed_by": "hub.scenes.edit",
    "result": {
        "_id": "5c7ff48b7f00002a07a408e3",
        "enabled": true,
        "group_id": null,
        "is_group": false,
        "name": "testRule",
        "syncNotification":false,
        "parent_id": "5c6ec961cc01eb07f86f9dd9",
        "then": [
            {
                "blockOptions": {
                    "method": {
                        "args": {
                            "item": "item",
                            "value": "value"
                        },
                        "name": "setItemValue"
                    }
                },
                "blockType": "then",
                "fields": [
                    {
                        "name": "item",
                        "type": "item",
                        "value": "5c7fea737f00000ab55f2e5d"
                    },
                    {
                        "name": "value",
                        "type": "bool",
                        "value": false
                    }
                ]
            }
        ],
        "when": [
            {
               "blockOptions":{
                  "method":{
                     "args":{  
                        "sunstate":"sunrise",
                        "time":"time"
                     },
                     "name":"isSunState"
                  }
               },
               "blockType":"when",
               "fields":[
                  {
                     "name":"sunrise",
                     "type":"string",
                     "value":"before"
                  },
                  {
                     "name":"time",
                     "type":"hms_interval",
                     "value":"10:30"
                  }
               ]
            }
        ]
    }
}

Parameters:

Field Type Required Description
_id string + Scene identifier
enabled bool + Scene is enabled or disable
group_id string + Group identifier
is_group bool + Does this rules related to some group or not
name string + Scene name
parent_id string + Identifier of the room which this scene is linked to
when Objects Array + List of when blocks
then Objects Array + List of then blocks
changed_by string + Method made changes in scene
syncNotification bool + Special mark to request data synchronization between Cloud and controller (true only if name of scene was changed)

hub.scene.run.progress

Notification about the scene status. It's fired when status of scene is changed.

{
    "id": "ui_broadcast",
    "msg_subclass": "hub.scene.run.progress",
    "result": {
        "scene_id": "5c7ff48b7f00002a07a408e3",
        "scene_name": "Scene Name",
        "status": "started",
        "userNotification": false,
        "notifications": [
            "23342342342",
            "87976434688"
        ],
        "room_id": "34524dsfsd",
        "room_name": "Living Room"
    }
}
Field Type Required Description
scene_id string + Scene identifier
scene_name string + Scene name
status string + Status of scene execution progress. Possible statuses are started, finished, partially_finished and failed
userNotification bool + This flag is false if status is started. Otherwise it's true. It is needed for cloud
notifications JsonArray + List of user ids for sending broadcast notification to users( null - all users / - no one )
roomId string - Identifier of room to what scene is related
roomName string - Name of room to what scene is related

hub.log

Logs from hub

result fields:

Field Description
message Log message
severity Severity: [ERROR, WARNING, INFO, DEBUG, TRACE]
{
    "id": "ui_broadcast",
    "msg_subclass": "hub.log",
    "result": {
        "message": "<Timestamp:Log message>",
        "severity": "ERROR"
    }
}

hub.user.notification

The notification of user about specific types of alerts.

Example:

{
    "id": "ui_broadcast",
    "msg_subclass": "hub.user.notification",
    "result": {
        "type": "pin_code_is_used",
        "params": {
              "user": "User Name",
              "deviceName": "Device Name",
              "roomName": "Room Name"
        }
    }
}

Parameters:

Field Type Required Description
type string + Broadcast type
params string + Broadcast parameters

Type pin_code_is_used:

Field Type Required Description
params.user string + Related with pin code user name
params.deviceName string + Related device name
params.roomName string + Related room name

hub.device.firmware.update.progress

The notification about firmware update to device status

Example:

{
    "id": "ui_broadcast",
    "msg_subclass": "hub.device.firmware.update.progress",
    "result": {
        "device_id": "<deviceId>",
        "firmware_id": "634.346.0",
        "image": "image.bin",
        "status": "in_progress",
        "progress": 10,         
        "error": null    
    }
}

Parameters:

Field Type Required Description
device_id string + Device id
firmware_id string + Firmware id
image string + Link to firmware binary. Don't pass full image link here
status string + Status of firmware updating: started, failed, in_progress, finished
progress string - Progress of firmware updating in percents

hub.device.firmware.download.progress

The notification about firmware download from remote link status

Example:

{
    "id": "ui_broadcast",
    "msg_subclass": "hub.device.firmware.download.progress",
    "result": {
        "image": "image.bin",
        "checksum": "checksum.bin",
        "status": "in_progress",
        "progress": 10    
    }
}

Parameters:

Field Type Required Description
checksum string + Link to firmware checksum. Don't pass full image link here
image string + Link to firmware binary. Don't pass full image link here
status string + Status of firmware updating: started, failed, in_progress, finished
progress string - Progress of firmware updating in percents

hub.setting.updated

Notification about controller settings value changes

initiators:

result:

Field Type Required Description
name string + Setting name
value depends on setting valueType + Updated setting value

Example

{
    "id": "ui_broadcast",
    "msg_subclass": "hub.setting.updated",
    "result": {
        "name": "first_start",
        "value": false
    }
}