Giter Club home page Giter Club logo

node-aladdin-connect-garage-door's Introduction

Node tool for Aladdin Connect Garage Door

mit license npm npm donate

This tool can be used to check the status and open/close an Aladdin Connect Garage Door via a Node.js script.

Example Script

var aladdinGarageDoor = require('node-aladdin-connect-garage-door');
var allowDebug = true;
var action = 'status';
var deviceNumber = 0;
var garageNumber = 1;

function callback(text)  {
  console.log(text);
}

aladdinGarageDoor('USERNAME/EMAIL', 'PASSWORD', action, callback, deviceNumber, garageNumber, allowDebug);

Function Parameters

Parameter Description
USERNAME/EMAIL (required) Your Genie Aladdin Connect Username (usually an email address)
PASSWORD (required) Your Genie Aladdin Connect Password
action (required, invalid default: status) status, battery, status-and-batt, open, or close
callback (required) action callback, function parameter is action result (like door status or battery level).
deviceNumber (optional - 0, 1, 2, default: 0) Use for multiple Garage Door controller devices on 1 account
garageNumber (optional - 1, 2, 3, default: 1) Use for multiple Garage Doors connected to a single device
allowDebug (optional - true, false, default: false) Set to true for more logs to be generated

Actions

Action Callback function results
status String(OPENING, OPEN, CLOSING, CLOSED)
battery Integer(% of Battery Level)
status-and-batt String(status:battery)
open String(OPENING)
close String(CLOSING)

Credits

Uses API Documentation from aladdin connect postman which was implemented via python by shoejosh.

Home Automation

This can be used in a home automation program that will run commands to check status, open, and close a garage door.
If using homebridge, just use homebridge-aladdin-connect-garage-door

node-aladdin-connect-garage-door's People

Contributors

apexad avatar dependabot[bot] avatar ianatoly avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

node-aladdin-connect-garage-door's Issues

Get Doors Function

A get doors request will return all available doors rather than the user having to be aware of which devices/doors exist

Still Struggling With Unexpected Token

Can you offer any insight? I'd gladly pay to get this plugin working for me, it's the last piece of my homebridge puzzle. See below for error in terminal.

[6/25/2019, 11:17:09 AM] [Garage Door] Error: Command failed: node C:/Users/Chambers/AppData/Roaming/npm/node_modules/garage-control/state.js
C:\Users\Chambers\AppData\Roaming\npm\node_modules\node-aladdin-connect-garage-door-master\example\node_modules\node-aladdin-connect-garage-door\index.js:36
modules.export = (user, password, action, callback, deviceNumber = 0, doorNumber = 1) {
^

SyntaxError: Unexpected token {
at Module._compile (internal/modules/cjs/loader.js:718:23)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:785:10)
at Module.load (internal/modules/cjs/loader.js:641:32)
at Function.Module._load (internal/modules/cjs/loader.js:556:12)
at Module.require (internal/modules/cjs/loader.js:681:19)
at require (internal/modules/cjs/helpers.js:16:16)
at Object. (C:\Users\Chambers\AppData\Roaming\npm\node_modules\node-aladdin-connect-garage-door-master\example\state.js:1:25)
at Module._compile (internal/modules/cjs/loader.js:774:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:785:10)
at Module.load (internal/modules/cjs/loader.js:641:32)

at ChildProcess.exithandler (child_process.js:290:12)
at ChildProcess.emit (events.js:200:13)
at maybeClose (internal/child_process.js:1021:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5) {

killed: false,
code: 1,
signal: null,
cmd: 'node ' +
'C:/Users/Chambers/AppData/Roaming/npm/node_modules/garage-control/state.js'
}

Open to PRs?

Hey there! Thanks for getting this module going, may be something I'd be looking to use. โœจ

Right now I'd say a few things could probably use a bit of cleaning up (param signature in the main function, errbacks, async support, etc.), I'm wondering how amenable you are to PRs? (Especially the variety that introduce breaking changes?)

Thanks!

Get Status re-write

getStatus function should take an array of objects with device and door numbers and return status for all doors

Logging in on every request

Hi, I work for Overhead Door Corporation, which owns Genie (Aladdin Connect). Your current implementation issues a login request for every API call, which is causing a very large number of active sessions for users of HomeBridge. We follow the OAuth2.0 specification, and the access token you receive is valid for 24 hours.

As a quick fix for this, could you do the following?

  1. Cache the access token somehow and use it until it expires
  2. When it expires, logout by sending a POST request to https://app.apps.st1.gdocntl.net/api/v1/session/logout with the Authorization header set to the bearer token (e.g. "Authorization": "Bearer 12345")

At the very least, could you issue the logout request after every API request? This way we will not end up with so many orphaned user sessions.

Handle shared users

Currently it is assumed that the supplied username and password is the 'main'/master account user.

Shared users has been un-tested and I believe will not currently work. This is something that I would like to fix for the sake of security.

Obstruction Detection

I know the App is able to report that there is an obstruction preventing the garage door from being closed. Need to investigate further on how to get this value from the API.

My guess is the fault value or a different state number for door_status (maybe 7).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.