Skip to content
Discussion options

You must be logged in to vote

Docs for the topic are here: https://zwave-js.github.io/zwave-js-ui/#/guide/mqtt?id=driverfunction

It's a little tricky because the payload is in JSON, so the quotes need to be escaped, and either the newlines need to be escaped, or the code joined into a single line. Here's the single line version:

{"args": ["const { logger, zwaveClient, require } = this; const { BinarySwitchCCSet, MultiChannelCCCommandEncapsulation } = require(\"zwave-js\"); const nodeId = 3; let cc = new BinarySwitchCCSet({ nodeId, targetValue: true }); cc = new MultiChannelCCCommandEncapsulation({ nodeId, destination: [1,2,3,4,5,6], encapsulated: cc, }); await driver.sendCommand(cc);"]}

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by mattia93cz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants