Security News
New Proposed CISA Mandate Would Require Critical Infrastructure to Report Ransom Payments Within 24 Hours
CISA has proposed a set of new rules that would require critical infrastructure to report cyber incidents and ransom payments.
zwaveip
Advanced tools
A Z-Wave IP implementation for Node.js
Weekly downloads
Readme
A Z-Wave IP implementation for Node.js. Unofficial library, not supported by Sigma Designs.
This library enables node.js application to communicate with Z-Wave devices via a Z/IP (Z-Wave IP) Gateway.
npm install zwaveip
let ZWaveIP = require('zwaveip');
let convertHexStringToBinaryPsk = function(hexString) {
let result = Buffer.alloc(hexString.length / 2);for (let i = 0; i < hexString.length; i += 2) {
result[i / 2] = parseInt("0x" + hexString.substr(i, 2), 16);
}return result;
}
let deviceConnection = ZWaveIP.connectToZWaveDevice(ipAddress, pskIdentity, pskPassword);
deviceConnection.sendMessage(ZWaveIP.CommandClass.SwitchBinary, ZWaveIP.SwitchBinaryCommand.Set, [0xFF]);
deviceConnection.sendMessage(ZWaveIP.CommandClass.SwitchBinary, ZWaveIP.SwitchBinaryCommand.Set, [0xFF])
.then(
function() {
console.log('Message acknowledged.');
},
function(err) {
console.log('Message failure: ' + JSON.stringify(err));
}
);
deviceConnection.sendMessageAndWaitForResponse(ZWaveIP.CommandClass.SwitchBinary, ZWaveIP.SwitchBinaryCommand.Get, [], ZWaveIP.SwitchBinaryCommand.Report)
.then(
function(response) {
let powerStateAsByte = response.data[0];
let powerStateAsBoolean = (powerStateAsByte != 0);
console.log("powerState: " + powerStateAsBoolean + " (" + powerStateAsByte + ")");
},
function(err) {
console.log('Message failure: ' + JSON.stringify(err));
}
);
deviceConnection.close(callback);
deviceConnection.unref();
ZWaveIP.findGatewayControllerIpv4Address()
.then(
function(ipv4Address) {
console.log(" FOUND: Z/IP Gateway controller IPv4 address is: " + ipv4Address + "\n");
},
function(err) {
console.log('Could not discover the Z-Wave Gateway Controller's virtual IPv4 address: ' + JSON.stringify(err));
}
);
ZWaveIP.requestNodeListFromGatewayController(gatewayIpAddress, pskIdentity, pskPassword)
.then(
function(nodeList) {
let ipAddress = nodeList[index].ipv4Address === null ? nodeList[index].ipv6Address : nodeList[index].ipv4Address;
console.log('Z-Wave Node # ' + nodeList[index].nodeId + ' (' + ipAddress + ')');
},
function(err) {
console.log('Could not request node lsit from the specified Z-Wave Gateway Controller: ' + JSON.stringify(err));
}
);
FAQs
A Z-Wave IP implementation for Node.js
The npm package zwaveip receives a total of 0 weekly downloads. As such, zwaveip popularity was classified as not popular.
We found that zwaveip demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CISA has proposed a set of new rules that would require critical infrastructure to report cyber incidents and ransom payments.
Security News
Redis is no longer OSS, breaking its explicit commitment to remain under the BSD 3-Clause License forever. This has angered contributors who are now working to fork the software.
Product
Socket AI now enables 'AI detected potential malware' alerts by default, ensuring users benefit from AI-powered state-of-the-art malware detection without needing to opt-in.