/node-liftmaster

A node.js library for the LiftMaster MyQ garage door gateway

Primary LanguageJavaScript

node-liftmaster

Control your LiftMaster MyQ garage door openers.

Installation

npm install liftmaster

Usage overview

new MyQ(email, password)

var MyQ = require('liftmaster'),
  garageDoor = new MyQ('chad@developer.email', 'correct horse battery staple');

garageDoor.login(callback)

Logs in to your MyLiftMaster account and returns a security token

garageDoor.login(function(err, res) {
  if(err) throw err;
  console.log(res);

garageDoor.getDevices(callback)

Returns an array of garage door devices on the account.

  garageDoor.getDevices(function(err, devices) {
    if(err) throw err;
    
    devices.forEach(function(device) {
      console.log(device.name, device);
  });

garageDoor.getDoorState(id, callback)

Retrieves the latest state of the requested door.

  var device = garageDoor.devices[0];
  garageDoor.getDoorState(device.id, function(err, device) {
    if(err) throw err;
    console.log(device);
  });

Known door states: 1 = open, 2 = closed, 4 = opening, 5 = closing

garageDoor.setDoorState(id, state, callback, fastP)

Set the requested door to open or close. If the fastP parameter is not present, then returns an updated state once complete; otherwise returns immediately.

  garageDoor.setDoorState(device.id, openP, function(err, device) {
    if(err) throw err;
    console.log(device);
  });

TODO

See the issue tracker for more.

Author

Chad Smith (chad@nospam.me).

License

This project is UNLICENSED and not endorsed by or affiliated with LiftMaster.