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 |
serviceNotification | bool | + | Special mark for forwarding all changes with this device and items to different Cloud services |
syncNotification | bool | + | Special mark to request data synchronization between Cloud and controller (always true) |
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 | + | Possible options: idle , broken . idle - device is in normal mode, broken - device has invalid data. |
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 |
serviceNotification | bool | + | Special mark for forwarding all changes with this device and items to different Cloud services. |
syncNotification | bool | + | Special mark to request data synchronization between Cloud and controller (true only if name of device was changed) |
__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 device. true value means device is ready to any changes. false value means 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 |
serviceNotification | bool | + | Special mark for forwarding all changes with this device and items to different Cloud services |
syncNotification | bool | + | Special mark to request data synchronization between Cloud and controller (always true) |
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. |
syncNotification | bool | + | Special mark to request data synchronization between Cloud and controller (always true) |
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,
"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 |
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 / |
name | string | + | see item.name(type) |
deviceArmed | bool | - | related device.armed state |
serviceNotification | bool | + | Special mark from related device |
syncNotification | bool | + | Special mark to request data synchronization between Cloud and controller (true only if name of item was changed) |
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. |
__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 |
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 / |
name | string | + | see item.name(type) |
deviceArmed | bool | - | related device.armed state |
serviceNotification | bool | + | Special mark from related device |
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",
"syncNotification":true
}
}
Field | Type | Required | Description |
---|---|---|---|
_id | string | + | an id of the item |
syncNotification | bool | + | Special mark to request data synchronization between Cloud and controller (always true) |
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 |
value | int : action : bool : string : rgb : scalable : dictionary.zwave_device_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.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/diable 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 | + | Id 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 new device ID |
{
"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 | + | Id 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 new device ID |
{
"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 removed device ID |
{
"id": "ui_broadcast",
"msg_subclass": "hub.modes.alarms_off.removed",
"result": {
"modeId": "<modeId>",
"alarmsOffDevice": "<deviceId>"
}
}
hub.modes.changed
Sends information about changed properties of particular house mode
initiators:
hub.modes.notifications.set
hub.modes.disarmed_default.set
hub.modes.disarmed_devices.add
hub.modes.disarmed_devices.remove
hub.modes.alarms_off.add
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.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:
- hub.network.wifi.try_connect
- hub.network.modem.try_connect
- any internal or external reasons causing network interfaces to go up/down or change its parameters
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.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 interpretator |
-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.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 / |
roomId | string | - | Identifier of room to what scene is related |
roomName | string | - | Name of room to what scene is related |