-
-
Couldn't load subscription status.
- Fork 6
Controller API
The Controller API, is used for network wide operations, but offers some utility methods also.
Its responsible for healing your network as an example.
Whilst most of the below, can be achieved using the User Interface Tab, the User Interface its self, is making use of the below.
Obtains the RF power level
let Message = {
payload: {
mode: "ControllerAPI",
method: "getPowerlevel"
}
}
return MessageObtains the RF Region of your USB Stick
let Message = {
payload: {
mode: "ControllerAPI",
method: "getRFRegion"
}
}
return MessageTurns on or off the usb Radio
let Message = {
payload: {
mode: "ControllerAPI",
method: "toggleRF",
params: [true]
}
}
return MessageFetches a list of all nodes
let Message = {
payload: {
mode: "ControllerAPI",
method: "getNodes"
}
}
return MessageKeeps a node awake, until it's been allowed to fall back to sleep.
Remember to switch back to false, else you could drain the battery of your device
let Message = {
payload: {
mode: "ControllerAPI",
method: "keepNodeAwake",
params: [<NodeID>, true | false]
}
}
return MessageReturns the reported Neighbors, for a node as reported by the controller
let Message = {
payload: {
mode: "ControllerAPI",
method: "getNodeNeighbors",
params: [<NodeID>]
}
}
return MessageSets the name of a node.
If the Node supports the Node Naming and Location CC, the value is also written to the device
let Message = {
payload: {
mode: "ControllerAPI",
method: "setNodeName",
params: [<NodeID>,'Some Name']
}
}
return MessageSets the location of the node
If the Node supports the Node Naming and Location CC, the value is also written to the device
let Message = {
payload: {
mode: "ControllerAPI",
method: "setNodeLocation",
params: [<NodeID>,'Some Location']
}
}
return MessageRe-interviews a z-wave device
let Message = {
payload: {
mode: "ControllerAPI",
method: "refreshInfo",
params: [<NodeID>]
}
}
return MessageHeals an Individual node
let Message = {
payload: {
mode: "ControllerAPI",
method: "healNode",
params: [<NodeID>]
}
}
return MessageStart a network wide heal
let Message = {
payload: {
mode: "ControllerAPI",
method: "beginHealingNetwork"
}
}
return MessageStops a network heal that is in progress.
let Message = {
payload: {
mode: "ControllerAPI",
method: "stopHealingNetwork"
}
}
return MessageRemoves a no longer communicating node from the network
let Message = {
payload: {
mode: "ControllerAPI",
method: "removeFailedNode",
params: [<NodeID>]
}
}
return MessageSome controllers have proprietary functions built in.
One example is to disable the LED on the Aeotec Gen5 Z Stick.
The first argument is the manufacture function ID, and the 2nd is the data portion for that request.
As an example, the byte array [0x01, 0x08, 0x00, 0xF2, 0x51, 0x01, 0x00, 0x05, 0x01, 0x51]
disables the LED on the GEN 5 Z-Stick,
breaking it down we have the following Z-Wave serial API payload:
/*
┌──── Serial API Stuff
| 0x01 - SOF
| 0x08 - Total Length
| 0x00 - REQ
| 0xF2 - Aeotec Set Configuration Function (Proprietary Function ID)
└────
┌──── User Request Data
| 0x51 - LED Configuration
| 0x01 - Configuration Value Size
| 0x00 - Value
| 0x05 - ??
| 0x01 - ??
└────
┌──── Serial API Stuff
| 0x51 - Serial API Checksum
└────
*/This means we do:
let OffBufferData = Buffer.from([0x51, 0x01, 0x00, 0x05, 0x01]) /* User Request Data */
let Message = {
payload: {
mode: "ControllerAPI",
method: "proprietaryFunction",
params: [0xF2, OffBufferData]
}
}
return MessageThe serial API parts will be provided for you internally.
- getPowerlevel
- getRFRegion
- toggleRF
- getNodes
- keepNodeAwake
- getNodeNeighbors
- setNodeName
- setNodeLocation
- refreshInfo
- healNode
- beginHealingNetwork
- stopHealingNetwork
- removeFailedNode
- proprietaryFunction