Control your LiftMaster MyQ garage door openers.
npm install liftmaster
var MyQ = require('liftmaster'),
garageDoor = new MyQ('chad@developer.email', 'correct horse battery staple');
Logs in to your MyLiftMaster account and returns a security token
garageDoor.login(function(err, res) {
if(err) throw err;
console.log(res);
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);
});
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
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);
});
See the issue tracker for more.
This project is UNLICENSED and not endorsed by or affiliated with LiftMaster.