House Modes commands
hub.modes.get
Version: 1.0
Classes: UI
Title: House modes
Description: Getting whole list of supported modes with configuration
parameters:
No parameters required.
return result fields:
Field | Type | Required | Description |
---|---|---|---|
current | string | + | Id of the current mode |
switchTo | string | + | Id of the next mode (after switch to) or empty |
switchToDelay | integer | + | Delay (sec) before switch to the mod |
modes | JsonArray | + | Array of the houseModes entries |
modes._id | string | + | Id of the mode |
modes.name | string | + | Name of the mode |
modes.description | string | + | Brief desciption of the mode |
modes.switchToDelay | integer | + | deprecated Delay (sec) before switch to the mod |
modes.alarmDelay | integer | + | deprecated Delay (sec) before sending alert |
modes.notifications | JsonArray | + | Array of user IDs or null if need notify all user IDs |
modes.disarmedDefault | bool | + | Use default (not editable) disarmed list or custom |
modes.disarmedDevices | JsonArray | + | Array of disarmed device id (current) |
modes.alarmsOffDevices | JsonArray | + | Array of alarmsOff device id (current) |
devices | JsonArray | + | Array of device id with security sensors |
alarms | JsonArray | + | Array of device id which make alarms after trips |
Version: 2.0
Classes: UI
Title: House modes
Description: Getting whole list of supported modes with configuration
parameters:
No parameters required.
return result fields:
Field | Type | Required | Description |
---|---|---|---|
timeIsLeftToSwitch | integer | + | Time left (sec) after start to switch to the mode |
switchToDelay | integer | + | Delay (sec) before switch to the all modes |
alarmDelay | integer | + | Delay (sec) before sending alert to the all modes |
modes.switchToDelay | integer | - | Removed |
modes.alarmDelay | integer | - | Removed |
Here is it an example of usage:
call:
{
"method": "hub.modes.get",
"id": "_ID_",
"params": {}
}
reply:
{
"error": null,
"id": "_ID_",
"result": {
"current": "<modeId>",
"switchTo": "",
"timeIsLeftToSwitch": 0,
"switchToDelay": 0,
"alarmDelay": 0,
"modes": [
{
"_id": "<modeId>",
"name": "Home",
"description": "",
"notifications": [
],
"disarmedDefault": true,
"disarmedDevices": [
],
"alarmsOffDevices": [
]
},
{
"_id": "<modeId>",
"name": "Away",
"description": "",
"notifications": [
],
"disarmedDefault": true,
"disarmedDevices": [
],
"alarmsOffDevices": [
]
},
{
"_id": "<modeId>",
"name": "Night",
"description": "",
"notifications": [
],
"disarmedDefault": true,
"disarmedDevices": [
],
"alarmsOffDevices": [
]
},
{
"_id": "<modeId>",
"name": "Vacation",
"description": "",
"notifications": [
],
"disarmedDefault": true,
"disarmedDevices": [
],
"alarmsOffDevices": [
]
}
],
"devices": [
],
"alarms": [
]
}
}
hub.modes.current.get
Version: 1.0
Classes: UI
Title: House modes
Description: Get current house mode on the hub. Currently there is no default one
parameters:
No parameters required.
return result fields:
Field | Type | Required | Description |
---|---|---|---|
modeId | string | + | Id of the current mode |
Here is it an example of usage:
call:
{
"method": "hub.modes.current.get",
"id": "_ID_",
"params": {}
}
reply:
{
"error": null,
"id": "_ID_",
"result": {
"modeId": "<modeId>"
}
}
hub.modes.switch
Version: 1.0
Classes: UI
Title: House modes
Description: Switch to mode
parameters:
Field | Type | Required | Description |
---|---|---|---|
modeId | string | - | Id of the new mode |
name | string | - | Name the new mode |
name and modeId are optional but one of them is required.
return result fields:
Field | Type | Required | Description |
---|---|---|---|
switchToDelay | integer | + | Delay (sec) before switch to the mod |
Here is it an example of usage:
call by id:
{
"method": "hub.modes.switch",
"id": "_ID_",
"params": {
"modeId": "<modeId>"
}
}
call by name:
{
"method": "hub.modes.switch",
"id": "_ID_",
"params": {
"name": "<existingModeName>"
}
}
reply:
{
"error": null,
"id": "_ID_",
"result": {
"switchToDelay": 0,
"alarmDelay": 0
}
}
Errors:
Code | Message | Data | Description |
---|---|---|---|
-32602 | Wrong params | rpc.params.invalid | Trying to switch to already selected house mode by id |
-32602 | Wrong params | rpc.params.invalid | Trying to switch to already selected house mode by name |
-32602 | The house mode with this id does not exist | ezlo.house_mode.not.exist | - |
-32602 | The house mode with this name does not exist | ezlo.house_mode.name.not.exist | - |
hub.modes.cancel_switch
Version: 1.0
Classes: UI
Title: House modes
Description: Cancel switch to mode
parameters:
No parameters required.
return result fields:
Field | Type | Required | Description |
---|---|---|---|
modeId | string | + | Id of the previous mode |
Here is it an example of usage:
call:
{
"method": "hub.modes.cancel_switch",
"id": "_ID_",
"params": {}
}
reply:
{
"error": null,
"id": "_ID_",
"result": {
"modeId": "<modeId>"
}
}
hub.modes.switch_to_delay.set
Version: 1.0
Classes: UI
Title: House modes
Description: Change "switch delay"
parameters:
Field | Type | Required | Description |
---|---|---|---|
modeId | string | + | deprecated Id of the mode |
switchToDelay | integer | + | Delay (sec) before switch to the mod |
return result fields:
Return empty result or error
Version: 2.0
Classes: UI
Title: House modes
Description: Change "switch delay"
parameters:
Field | Type | Required | Description |
---|---|---|---|
modeId | string | - | Removed |
return result fields:
Return empty result or error
Here is it an example of usage:
call:
{
"method": "hub.modes.switch_to_delay.set",
"id": "_ID_",
"params": {
"switchToDelay": 0
}
}
reply:
{
"error": null,
"id": "_ID_",
"result": {}
}
hub.modes.alarm_delay.set
Version: 1.0
Classes: UI
Title: House modes
Description: Set delay to sending break-in alert or another activity, trigerred by perimeter control sensors.
parameters:
Field | Type | Required | Description |
---|---|---|---|
modeId | string | + | deprecated Id of the mode |
alarmDelay | integer | + | Delay (sec) before sending alert if armed sensors (door/window or motion sensor) tripped. |
return result fields:
Return empty result or error
Version: 2.0
Classes: UI
Title: House modes
Description: Set delay to sending break-in alert or another activity, trigerred by perimeter control sensors.
parameters:
Field | Type | Required | Description |
---|---|---|---|
modeId | string | - | Removed |
return result fields:
Return empty result or error
Here is it an example of usage:
call:
{
"method": "hub.modes.alarm_delay.set",
"id": "_ID_",
"params": {
"alarmDelay": 0
}
}
reply:
{
"error": null,
"id": "_ID_",
"result": {}
}
hub.modes.notifications.set
Version: 2.0
Classes: UI
Title: House modes
Description: Set user IDs that will receive notifications
parameters:
Field | Type | Required | Description |
---|---|---|---|
modeId | string | + | Id of the mode |
all | bool | + | enable/disable send notifications to all |
userIds | Array of string | + | List of user Ids that will receive notification |
If all field is true
userIds field is ignored
return result
Empty result or error
broadcasts:
Broadcast | Description |
---|---|
hub.modes.changed |
disarmedDefault state will change to **false** |
Here is it an example of usage:
call:
{
"method": "hub.modes.notifications.set",
"id": "_ID_",
"params": {
"modeId": "<modeId>",
"all": false,
"userIds": ["<userIdA>", "<userIdB>"]
}
}
reply:
{
"error": null,
"id": "_ID_",
"result": {}
}
hub.modes.notifications.notify_all.set deprecated
Version: 1.0
Classes: UI
Title: House modes
Description: Enable/disable send notifications to all user IDs
parameters:
Field | Type | Required | Description |
---|---|---|---|
modeId | string | + | Id of the mode |
all | bool | + | enable/diable send notifications to all |
return result fields:
Empty result or error
Here is it an example of usage:
call:
{
"method": "hub.modes.notifications.notify_all.set",
"id": "_ID_",
"params": {
"modeId": "<modeId>",
"all": true
}
}
reply:
{
"error": null,
"id": "_ID_",
"result": {}
}
hub.modes.notifications.add deprecated
Version: 1.0
Classes: UI
Title: House modes
Description: Add notification to the mode
parameters:
Field | Type | Required | Description |
---|---|---|---|
modeId | string | + | Id of the mode |
userId | string | + | Id of the user |
return result fields:
Empty result or error
Here is it an example of usage:
call:
{
"method": "hub.modes.notifications.add",
"id": "_ID_",
"params": {
"modeId": "<modeId>",
"userId": "<userId>"
}
}
reply:
{
"error": null,
"id": "_ID_",
"result": {}
}
hub.modes.notifications.remove deprecated
Version: 1.0
Classes: UI
Title: House modes
Description: Remove notification from the mode
parameters:
Field | Type | Required | Description |
---|---|---|---|
modeId | string | + | Id of the mode |
userId | string | + | Id of the user |
return result fields:
Empty result or error
broadcasts:
Broadcast | Description |
---|---|
hub.modes.changed |
disarmedDefault state will change to **false** |
Here is it an example of usage:
call:
{
"method": "hub.modes.notifications.remove",
"id": "_ID_",
"params": {
"modeId": "<modeId>",
"userId": "<userId>"
}
}
reply:
{
"error": null,
"id": "_ID_",
"result": {}
}
hub.modes.disarmed_default.set
Version: 1.0
Classes: UI
Title: House modes
Description: Use default or custom disarmed devices list
parameters:
Field | Type | Required | Description |
---|---|---|---|
modeId | string | + | Id of the mode |
disarmedDefault | bool | + | Use default or custom disarmed devices list |
return result fields:
Return empty result or error
broadcasts:
Broadcast | Description |
---|---|
hub.modes.changed |
disarmedDefault state will change to **true** |
Here is it an example of usage:
call:
{
"method": "hub.modes.disarmed_default.set",
"id": "_ID_",
"params": {
"modeId": "<modeId>",
"disarmedDefault": true
}
}
reply:
{
"error": null,
"id": "_ID_",
"result": {}
}
hub.modes.disarmed_devices.add
Version: 1.0
Classes: UI
Title: House modes
Description: Add disarmed device to the mode (only to custom list)
parameters:
Field | Type | Required | Description |
---|---|---|---|
modeId | string | + | Id of the mode |
deviceId | string | + | Id of the disarmed device |
return result fields:
Empty result or error
broadcasts:
Broadcast | Description |
---|---|
hub.modes.changed |
disarmedDefault state will change to **false** |
Here is it an example of usage:
call:
{
"method": "hub.modes.disarmed_devices.add",
"id": "_ID_",
"params": {
"modeId": "<modeId>",
"deviceId": "<deviceId>"
}
}
reply:
{
"error": null,
"id": "_ID_",
"result": {}
}
hub.modes.disarmed_devices.remove
Version: 1.0
Classes: UI
Title: House modes
Description: Remove disarmed device from the mode (only to custom list)
parameters:
Field | Type | Required | Description |
---|---|---|---|
modeId | string | + | Id of the mode |
deviceId | string | + | Id of the device |
return result fields:
Empty result or error
broadcasts:
Broadcast | Description |
---|---|
hub.modes.changed |
disarmedDefault state will change to **false** |
Here is it an example of usage:
call:
{
"method": "hub.modes.disarmed_devices.remove",
"id": "_ID_",
"params": {
"modeId": "<modeId>",
"deviceId": "<deviceId>"
}
}
reply:
{
"error": null,
"id": "_ID_",
"result": {}
}
hub.modes.alarms_off.add
Version: 1.0
Classes: UI
Title: House modes
Description: Add alarmsOff to the mode
parameters:
Field | Type | Required | Description |
---|---|---|---|
modeId | string | + | Id of the mode |
deviceId | string | + | Id of the device |
return result fields:
Empty result or error
broadcasts:
Broadcast | Description |
---|---|
hub.modes.changed |
disarmedDefault state will change to **false** |
Here is it an example of usage:
call:
{
"method": "hub.modes.alarms_off.add",
"id": "_ID_",
"params": {
"modeId": "<modeId>",
"deviceId": "<deviceId>"
}
}
reply:
{
"error": null,
"id": "_ID_",
"result": {}
}
hub.modes.alarms_off.remove
Version: 1.0
Classes: UI
Title: House modes
Description: Remove alarmsOff from the mode
parameters:
Field | Type | Required | Description |
---|---|---|---|
modeId | string | + | Id of the mode |
deviceId | string | + | Id of the device |
return result fields:
Empty result or error
Here is it an example of usage:
call:
{
"method": "hub.modes.alarms_off.remove",
"id": "_ID_",
"params": {
"modeId": "<modeId>",
"deviceId": "<deviceId>"
}
}
reply:
{
"error": null,
"id": "_ID_",
"result": {}
}