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 🙏

© 2026 – Pkg Stats / Ryan Hefner

cm11a-js

v0.6.0

Published

A Node.js module for communicating with a CM11A X10 controller.

Downloads

27

Readme

cm11a-js

A Node.js module for controlling X10 devices through a serial CM11A interface. It allows NodeJe applications to conrol X10 devices through the serial interface of the CM11A, and monitors status of X10 devices.

Installation

npm install cm11a-js

Usage

// Import the module
const CM11A = require('cm11a-js');

// Create an CM11 object
let cm11 = CM11A();

// Start the service, connecting to the Serial Port
cm11.start('/dev/ttyUSB0');

// Issue Commands
let units = ['A1', 'A2'];

cm11.turnOn(units);
cm11.dim(units, 11);
cm11.bright(units, 11);
cm11.turnOff(units);

// Close the connection to the CM11A
cm11.stop();

Commands

Start

cm11.start(port);

Opens serial communications with the CM11A on the specified serial port, and begins monitoring for unit status.

  • port is the serial port to open, e.g. /dev/ttyUSB0 on Linux, and COM1 on Windows.

Stop

cm11.stop();

Close serial communications with the CM11A, and stops monitoring device status.

Turn On

cm11.turnOn(addresses);

Turns on the specified unit addresses.

  • addresses is an array of X10 device addresses. e.g. ['A1', 'A3']

Turn Off

cm11.turnOff(addresses);

Turns off the specified unit addresses.

  • addresses is an array of X10 device addresses. e.g. ['A1', 'A3']

Bright

cm11.bright(addresses, level);

Brightens the the specified unit addresses by the specfied level.

  • addresses is an array of X10 device addresses. e.g. ['A1', 'A3']
  • level is a value between 0 and 22, indicating how much to brighten the device. Note: this is a relative value, not an absolute value.

Dim

cm11.dim(addresses, level);

Dims the the specified unit addresses by the specfied level.

  • addresses is an array of X10 device addresses. e.g. ['A1', 'A3']
  • level is a value between 0 and 22, indicating how much to dim the device. Note: this is a relative value, not an absolute value.

setClock

cm11.setClock();

Sets the clock of the CM11A controller to the current time provided by the PC.

status

cm11.status();

Reads the status from the CM11A returns the status through the status callback event below.

Events

Calling modules can subscribe to the following events on cm11a-js interface.

Unit Status

Provides the status of X10 devices when the CM11A detects a change on the power line.

cm11a.on('unitStatus', callback);

When the status of a device changes, the callback function will be called with the following object:

{
    // An array of unit codes for which status is being reported.
    units: array,
        
    // The X10 Function that was called on the device       
    x10Function: string,
    
    // The level of the function is DIM or BRIGHT    
    level: number
}

Device Status

Provides the status of the CM11A as read from the device with the status() function.

cm11a.on('status', callback);

After the status has been read from the CM11A, the specified callback function will be called with the following object:

See section 9 in the Interface Communication Protocol on the Heyu website for more details.

{
    // Time since last battery change
    batteryTimer: value,
  
    // CM11A Firmware Revision
    firmwareRev: value,
  
    // An object containing values of the CM11A's clock
    time: {
        // Day of the year
        dayOfYear: value,

        // Hour of the day
        hours: value,

        // Minute of the hour
        minutes: value,

        // Second of the minute
        seconds: value
    },
    
    // An object containing the status of monitored devices
    monitoredDevices: {
        // House code being monitored
        houseCode: value,

        // Currently addressed devices    
        addresed: value,

        // On/Off status of monitored devices
        onOffStatus: value,

        // Dim status of the monitored devices
        dimStatus: value
    },
    // A bitmask indicating Which day it is (SMTWTFS)
    dayMask: value
}

Close

Notifies the calling software when communications with the CM11A have been closed.

cm11a.on('close', callback);

When the serial port has been closed, the specified callback function will be called with no parameters.

Acknowledgements

Heyu

Kudos to the Heyu project. Heyu provides a complete interface to the CM11A (and other devices). The documentation and research they have done has been priceless! Heyu ran my house for many years!