node-x10-comm

1.2.1 • Public • Published

Dependency Status

node-x10-comm

Communicate with X10 modules via a CM17A FireCracker interface

Usage

var x10 = require('node-x10-comm');
var comm_name = "COM3";
var house_code = 2; //C
var module_code = 0; //01
 
x10.listPorts(function (ports) {
  console.log("Available ports:");
  console.log(ports);
}, function (err) {
  console.log("Unable to enumerate available ports");
});
 
var device = x10.device();
device.open(comm_name, function () {
  device.sendCommand(house_code, module_code, 1, function () {
    console.log("Turned on device C01");
  }, function (err) {
    console.log("Unable to send to device");
  });
}, function (err) {
  console.log(err);
});

Or use promises or async/await:

await device.open(comm_name);
await device.sendCommand(2, 0);

Package Sidebar

Install

npm i node-x10-comm

Weekly Downloads

1

Version

1.2.1

License

ISC

Last publish

Collaborators

  • teledemic