-
-
Notifications
You must be signed in to change notification settings - Fork 6
Payload Messaging Format
The messages you send and receive are of a typical payload.
the module only works with a payload
object, and does not employ the use of topic
or any other msg
part.
All events in your z-wave network, will be injected into your flow via the ZWave JS Controller node and the ZWave Device node, if you have set that up, and the event is for the specified node(s)
The event messages coming "out" of a z-wave node will have the following shape.
{
"payload": {
"networkId": 1,
"node": 10,
"event": "SOME_EVENT",
"object": {},
"timestamp": 1637014660258,
}
}
The contents of object
differs between the type of event
, an object may not even be provided, if no data is to be utilized.
The same can be said for node
, if the event is not node specific, then it will not be provided.
netwokrId
, denotes the source network
Detailing all object types might make for some unpleasant reading; it is best to attach a debug node to simply watch the messages as they are emitted. This will help you learn the functionality of your device.
Below is a table, detailing the common event types that you will likely be interested in. The ticks represent if a node ID is included and / or some structured object. There are too many event types to list, but those listed below, will allow you to respond with automation decisions.
event | node | object | Meaning |
---|---|---|---|
ALL_NODES_READY | Zwave JS sent "all nodes ready" status | ||
GET_VALUE_RESPONSE | ✓ | ✓ | Response to getValue |
GET_VALUE_METADATA_RESPONSE | ✓ | ✓ | Response to getValueMetadata |
NODE_LIST | ✓ | Response to getNodes | |
NOTIFICATION | ✓ | ✓ | A Notification Was Received |
SLEEP | ✓ | A Node Has Gone To Sleep | |
VALUE_DB | ✓ | Response to getValueDB | |
VALUE_ID_LIST | ✓ | ✓ | Response to getDefinedValueIDs |
VALUE_NOTIFICATION | ✓ | ✓ | A Value Notification Was Received |
VALUE_UPDATED | ✓ | ✓ | A Value Was Updated |
WAKE_UP | ✓ | A Node Has Woken Up | |
WATCHDOG | ✓ | Serilaport Monitoring event |
Sending a command is no different to anything else in node red, wrap it in a msg.payload
object
The shape of your message will match the form of the below structure.
In this example, we are using the CC API, and setting a value for the Binary Switch CC on node 5
{
"payload": {
"node": 5,
"mode": "CCAPI",
"cc": "Binary Switch",
"method": "set",
"params": [true]
}
}
mode
is certainly always going to be needed, but the rest are dependent on the combination of mode
, method
, and which node you're sending to (i.e. the device node will not always require node
value).
So, now that you understand the basics- explore the pages for each API, details for how the Controller Node
and Device Node
work, and start interacting with your devices!
- getPowerlevel
- getRFRegion
- toggleRF
- getNodes
- keepNodeAwake
- getNodeNeighbors
- setNodeName
- setNodeLocation
- refreshInfo
- healNode
- beginHealingNetwork
- stopHealingNetwork
- removeFailedNode
- proprietaryFunction