Skip to content

Latest commit

 

History

History
37 lines (27 loc) · 1.11 KB

README.md

File metadata and controls

37 lines (27 loc) · 1.11 KB

A driver for the Nutech AD2USB Ademco Vista security panel interface.

Build Status

The AD2USB interface is a serial device. This library assumes the serial communication has been made available on the network using a Serial-IP adapter.

Usage

Call the connect function to connect with the AD2USB controller. After the connection has been established, proceed by interacting with the controller.

var Alarm = require('ad2usb');
var alarm = Alarm.connect('192.168.1.6', 4999, function() {
  // connected to interface

  // listen for alarm to be armed
  alarm.on('armedAway', function() {
    console.log('Alarm has been armed in away mode');
  });

  // arm in away mode with user code 1234
  alarm.armAway('1234');
});

You may also opt to manually set up a socket and provide it to the constructor directly.

var Alarm = require('ad2usb'),
    Socket = require('net').Socket;
var socket = new Socket({type: 'tcp4'});
var alarm = new Alarm(socket);
alarm.connect('192.168.1.6', 4999);