Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

node-alarm-dot-com

Package Overview
Dependencies
Maintainers
0
Versions
52
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-alarm-dot-com

An interface module written in node.js to arm and disarm Alarm.com security systems.

  • 2.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
71
Maintainers
0
Weekly downloads
 
Created
Source

Node.js Alarm.com Interface

Unofficial interface module written in Node.js to access and operate Alarm.com security systems.

This interface works best with the fork: https://github.com/node-alarm-dot-com/homebridge-node-alarm-dot-com, based off of John Hurliman's FrontPoint* plugin for Homebridge. This variation adds changes the default login authentication for to Alarm.com. with a switch to use the FrontPoint login authentication process if desired.

*FrontPoint is simply a rebranded service provider for Alarm.com.

Originally intended for use with the fork: https://github.com/node-alarm-dot-com/homebridge-node-alarm-dot-com, originally created by Bryan Bartow for his Alarm.com plugin for Homebridge.

Supported Features

  • Querying panels
    • Arming
    • Disarming
  • Sensors
    • Contact states
    • Occupancy states (this does not work due to lag in the Alarm.com webAPI itself)
    • Water Leak states
  • Lights
    • On/Off switch
    • Dimmer switch
  • Locks
    • Lock/Unlock switch
  • Thermostats
    • State (Off, Heat, Cool, Auto)
    • Desired Heat setpoint
    • Desired Cool setpoint

Usage

Install:

npm i node-alarm-dot-com

Querying:

const nodeADC = require('node-alarm-dot-com');

nodeADC
  .login('your_username', 'your_password')
  .then((authOpts) => nodeADC.getCurrentState(authOpts.systems[0], authOpts))
  .then((res) => {
    console.log('Security Systems:', res.partitions);
    console.log('Sensors:', res.sensors);
  })
  .catch((err) => console.error(err));

Arming:

const nodeADC = require('node-alarm-dot-com');

nodeADC
  .login('your_username', 'your_password')
  .then((authOpts) => {
    return nodeADC.getCurrentState(authOpts.systems[0], authOpts).then((res) => {
      // This will take 20-30 seconds
      nodeADC.armStay(res.partitions[0].id, authOpts).then((res) => {
        console.log(res);
      });
    });
  })
  .catch((err) => console.error(err));

Documentation

nodeADC~login(username, password) ⇒ Promise

Authenticate with alarm.com using the mobile webpage login form (loads faster than the desktop webpage login form). Returns an authentication object that can be passed to other methods.

Kind: inner method of module_nodeADC

ParamTypeDescription
usernamestringFrontPoint username.
passwordstringFrontPoint password.

nodeADC~getCurrentState(systemID, authOpts) ⇒ Promise

Retrieve information about the current state of a security system including attributes, partitions, sensors, and relationships.

Kind: inner method of nodeADC

ParamTypeDescription
systemIDstringID of the FrontPoint system to query. The Authentication object returned from the login method contains a systems property which is an array of system IDs.
authOptsObjectAuthentication object returned from the login method.

nodeADC~getPartition(partitionID, authOpts) ⇒ Promise

Get information for a single security system partition.

Kind: inner method of nodeADC

ParamTypeDescription
partitionIDstringPartition ID to retrieve
authOptsObjectAuthentication object returned from the login method.

nodeADC~getSensors(sensorIDs, authOpts) ⇒ Promise

Get information for one or more sensors.

Kind: inner method of nodeADC

ParamTypeDescription
sensorIDsstring | Array.<string>Array of sensor ID strings.
authOptsObjectAuthentication object returned from the login method.

nodeADC~getLights(lightIDs, authOpts) ⇒ Promise

Get information for one or more lights.

Kind: inner method of nodeADC

ParamTypeDescription
lightIDsstring | Array.<string>Array of light ID strings.
authOptsObjectAuthentication object returned from the login method.

nodeADC~turnOnLight(lightID, brightness, authOpts) ⇒ Promise

Sets a light to ON and adjusts brightness level (1-100) of dimmable lights.

Kind: inner method of nodeADC

ParamTypeDescription
lightIDstringLight ID string.
brightnessnumberAn integer, 1-100, indicating brightness.
authOptsObjectAuthentication object returned from the login method.

nodeADC~turnOffLight(lightID, brightness, authOpts) ⇒ Promise

Sets a light to OFF. The brightness level is ignored.

Kind: inner method of nodeADC

ParamTypeDescription
lightIDstringLight ID string.
brightnessnumberAn integer, 1-100, indicating brightness. Ignored.
authOptsObjectAuthentication object returned from the login method.

nodeADC~getLocks(lightIDs, authOpts) ⇒ Promise

Get information for one or more locks.

Kind: inner method of nodeADC

ParamTypeDescription
lockIDsstring | Array.<string>Array of lock ID strings.
authOptsObjectAuthentication object returned from the login method.

nodeADC~setLockSecure(lockID, authOpts) ⇒ Promise

Sets a lock to "locked" (SECURED).

Kind: inner method of nodeADC

ParamTypeDescription
lockIDstringLock ID string.
authOptsObjectAuthentication object returned from the login method.

nodeADC~setLockUnsecure(lockID, authOpts) ⇒ Promise

Sets a lock to "unlocked" (UNSECURED).

Kind: inner method of nodeADC

ParamTypeDescription
lockIDstringLock ID string.
authOptsObjectAuthentication object returned from the login method.

nodeADC~setThermostatState(thermostatID, newState, authOpts) ⇒ Promise

Update Thermostat State (see THERMOSTAT_STATES)

Kind: inner method of nodeADC

ParamTypeDescription
thermostatIDstringThermostat ID string.
newStateTHERMOSTAT_STATESDesired state, THERMOSTAT_STATES.OFF/HEAT/COOL/AUTO
authOptsObjectAuthentication object returned from the login method.

nodeADC~setThermostatTargetHeatTemperature(thermostatID, newTemp, authOpts) ⇒ Promise

Set desired Heat setpoint temperature for Thermostat

Kind: inner method of nodeADC

ParamTypeDescription
thermostatIDstringThermostat ID string.
newTempnumberDesired temperature
authOptsObjectAuthentication object returned from the login method.

nodeADC~setThermostatTargetCoolTemperature(thermostatID, newTemp, authOpts) ⇒ Promise

Set desired Cool setpoint temperature for Thermostat

Kind: inner method of nodeADC

ParamTypeDescription
thermostatIDstringThermostat ID string.
newTempnumberDesired temperature
authOptsObjectAuthentication object returned from the login method.

nodeADC~armStay(partitionID, authOpts, opts) ⇒ Promise

Arm a security system panel in "stay" mode. NOTE: This call may take 20-30 seconds to complete.

Kind: inner method of nodeADC

ParamTypeDescription
partitionIDstringPartition ID to arm.
authOptsObjectAuthentication object returned from the login method.
optsObjectOptional arguments for arming the system.
opts.noEntryDelaybooleanDisable the 30-second entry delay.
opts.silentArmingbooleanDisable audible beeps and double the exit delay.

nodeADC~armAway(partitionID, authOpts, opts) ⇒ Promise

Arm a security system panel in "away" mode. NOTE: This call may take 20-30 seconds to complete.

Kind: inner method of nodeADC

ParamTypeDescription
partitionIDstringPartition ID to arm.
authOptsObjectAuthentication object returned from the login method.
optsObjectOptional arguments for arming the system.
opts.noEntryDelaybooleanDisable the 30-second entry delay.
opts.silentArmingbooleanDisable audible beeps and double the exit delay.

nodeADC~disarm(partitionID, authOpts) ⇒ Promise

Disarm a security system panel.

Kind: inner method of nodeADC

ParamTypeDescription
partitionIDstringPartition ID to disarm.
authOptsObjectAuthentication object returned from the login method.

Notes

In efforts to maintain this project as a native Alarm.com implementation, authentication and reference to FrontPoint have been removed altogether within the code as of versions 1.6.0. This allows for the codebase to be cleaner without having to solve everyone else's extraneous Alarm.com Verified-Partner setups, encouraging separate forks and augmentation for those unique scenarios.

Acknowledgements

Keywords

FAQs

Package last updated on 21 Sep 2024

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc