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
Downloads
6
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-powerlink3
Usage
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
DISARMED
ARMED_HOME
ARMED_AWAY
EXIT_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])
config
Objecthost
string – The IP address, or hostname, of the PowerLink3 serveruserCode
string – The pin code you use to disarm or arm the systemappType
string – Default: com.visonic.PowerMaxAppuserId
string – A newly generated GUIDpanelWebName
string – The panel web name as used in the Visonic GO appdebug
optional boolean – Turns on extensive logging, to help debug issues, when set totrue
(default:false
)userEmail
string - Your e-mail to login to VisonicuserPassword
string - Your password to login to VisonicrestVersion
string - Version of the REST API of Visonic (default 10.0)
log
optional Function - Logging function
getStatus(callback)
Get the current system status
callback
Function - 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)
status
string - The status to set. Use a value fromPowerLink3.STATUSES
callback
Function - Callback to call (error)