npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

elkmon

v1.2.5

Published

Module to interact with the Elk M1 Gold, using M1XEP ethernet interface

Downloads

17

Readme

elkmon

elkmon is a module for interfacing with the Elk M1 security and automation control system.

Not all features have been implemented. This is something I have been experimenting with in my free time. I don't have a thermostat integrated with my home system so I haven't implemented those commands yet. However, a Thermostat Reply Message (TR) will be parsed.

Note: For users upgrading to version 1.0.0 from an earlier version, please be aware that there was a bug where the Physical and Logical status, for a zone, was incorrectly swapped. This has been fixed in version 1.0.0.

Features

  • Supports both secure and non-secure communication with Elk M1XEP

  • All received messages are parsed into an ElkMessage

    Example

      {
        message: '1EAS000000001111111100000000000E', // Full message
        body: '00000000111111110000000000', // Parsed message
        type: 'AS', // Type of message
        hexLength: '1E',
        checkSum: '0E'
      }
  • Some messages are parsed into a specific message type. For example, ZoneStatusReport (ZS) which includes an array of zones:

    {
      message: 'D6ZS33333333333333303333000000000000333300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000034',
      body: '333333333333333033330000000000003333000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000',
      type: 'ZS',
      hexLength: 'D6',
      checkSum: '34',
      zones:
        [
          { id: 1, physicalStatus: 'Short', logicalState: 'Normal' },
          { id: 2, physicalStatus: 'Short', logicalState: 'Normal' },
          ...
        ]
    }
  • Events are emitted when messages are received. You can listen for all (*) or by type (KC, ZD, ZC, etc).

  • Requests for data return a Promise and can be chained together.

Example Usage

var Elk = require('elkmon');

// Instantiate a new Elk instance (non-secure)
var elk = new Elk(
  2101, // port
  '192.168.1.100' // M1XEP address
);

// Register any event handlers
elk.on('connected', () => {
  console.log('***connected***');

  // Request arming status report
  elk.requestArmingStatus()
    .then((report) => {
      console.log(report.areas);
      // Request zones status report
      return elk.requestZoneStatusReport()
    })
    .then((report) => {
      console.log(report.zones);
      elk.speak('all clear');
  });
});

// Listen for all messages
elk.on('*', (message) => {
  console.log(message);
});

// Listen for messages by type (Zone Change)
elk.on('ZC', (message) => {
  console.log('Zone Change Report: ', message);
});

elk.connect();
// Instantiate a secure instance
var elk = new Elk(
  2601,
  '192.168.1.100', {
    secure: true,
    userName: 'SomeUser',
    password: 'YourPassword',
    keypadCode: 'YourPin',
    rejectUnauthorized: false,
    secureProtocol: 'TLSv1_method'
  }
);

API

connect()

Connects to M1XEP.

disconnect()

Closes connection to M1XEP.

arm(areaId, armMode, keypadCode)

Arm Elk in specified arming mode

disarm(areaId, keypadCode)

Disarm Elk

activateTask(taskId)

Activates a task

setOutputOn(outputId, seconds)

Turns an output on

setOutputOff(outputId)

Turns an output off

speak(message)

Command Elk panel to speak a message over it's speaker.

toggleOutput(outputId)

Toggles a control Output On/Off.

requestOutputStatusReport([timeout])

Request the Control Output Status report from Elk panel.

bypassZone(zoneId, areaId, keypadCode)

Bypass a Zone.

requestArmingStatus([timeout])

Requests an Arming Status Report.

requestAreas([timeout])

Request Keypad Area assignments

requestZoneDefinitionReport([timeout])

Requests a Zone Definition Report.

requestZonePartitionReport([timeout])

Requests a Zone Partition Report.

requestZoneVoltageReport(id, [timeout])

Requests a Zone Voltage Report.

requestZoneStatusReport([timeout])

Requests a Zone Status Report.

requestTextDescription(id, type, [timeout])

Requests a text description.

requestTextDescriptionAll(type)

Requests the configured Text Descriptions, by type.