visonic-powerlink3
v1.3.4
Published
Allows you to get and set the status of a Visonic security system (i.e. arm or disarm it) via its PowerLink3 communication module
Readme
visonic-powerlink3
Allows you to get and set the status of a Visonic security system (i.e. arm or disarm it) via its PowerLink3 communication module and server
Install
$ npm install --save visonic-powerlink3Usage
var PowerLink3 = require("visonic-powerlink3");
var PowerLink3 = new PowerLink3({
host: "visonic.tycomonitor.com",
userCode: "your-pin-code",
appType: "com.visonic.PowerMaxApp",
userId: "generated-guid",
panelWebName: "your-panel-web-name",
userEmail = "[email protected]",
userPassword = "yourpassword",
restVersion = "10.0"
});
PowerLink3.getStatus(function (error, status) {
if (error) {
console.log(`Error getting status: ${error}`);
return;
}
console.log(`Status: ${status}`); //=> Status: disarmed
});
PowerLink3.setStatus(PowerLink3.STATUSES.ARMED_HOME, function (error) {
if (error) {
console.log(`Error getting status: ${error}`);
return;
}
console.log(`Status set successfully`);
});
API
PowerLink3
STATUSES
Map of possible statuses
DISARMEDARMED_HOMEARMED_AWAYEXIT_DELAY– Can only get, not set, this status. Occurs when the system has begun arming; allowing people to exit.UNKNOWN– Can only get, not set, this status.
new PowerLink3(config, [log])
configObjecthoststring – The IP address, or hostname, of the PowerLink3 serveruserCodestring – The pin code you use to disarm or arm the systemappTypestring – Default: com.visonic.PowerMaxAppuserIdstring – A newly generated GUIDpanelWebNamestring – The panel web name as used in the Visonic GO appdebugoptional boolean – Turns on extensive logging, to help debug issues, when set totrue(default:false)userEmailstring - Your e-mail to login to VisonicuserPasswordstring - Your password to login to VisonicrestVersionstring - Version of the REST API of Visonic (default 10.0)
logoptional Function - Logging function
getStatus(callback)
Get the current system status
callbackFunction - Callback to call with the status or error (error, status). Status will be a value fromPowerLink3.STATUSES
setStatus(status, callback)
Sets the system status (i.e. arms or disarms the system)
statusstring - The status to set. Use a value fromPowerLink3.STATUSEScallbackFunction - Callback to call (error)
