Code Monkey home page Code Monkey logo

homebridge-myq's Introduction

Project Retired

Already an existing project that does this called "Liftmaster": https://github.com/nfarina/homebridge-liftmaster

homebridge-myq

Homebridge Plug for Chamberlain MyQ Garage Door

Installation

  • Install homebridge using: npm install -g homebridge
  • Install this plugin using: npm install -g homebridge-myq
  • Update your configuration file. See the sample below.

Configuration

Add the token to your config and restart homebridge. Make sure to update the username and password the values you have set in the App.

    "platforms": [
       {
         "platform": "MyQ",
         "name": "MyQ",
         "MyQApplicationId": "NWknvuBd7LoFHfXmKNMBcgajXtZEgKUh4V7WNzMidrpUUluDpVYVZx+xT4PCM5Kx",
         "UserAgent": "Chamberlain/10482 CFNetwork/978.0.7 Darwin/18.6.0",
         "username": "[email protected]",
         "password": "supersecretpassword",
         "loglevel":"0"
       }

    ],

MyQ API

1) Execute the Login API to get Security Token

Required Headers

POST https://api.myqdevice.com/api/v5/Login

  • 'Content-Type': 'application/json',
  • 'User-Agent': 'Chamberlain/10482 CFNetwork/978.0.7 Darwin/18.6.0'
  • 'MyQApplicationId': 'NWknvuBd7LoFHfXmKNMBcgajXtZEgKUh4V7WNzMidrpUUluDpVYVZx+xT4PCM5Kx'

JSON Body

  • UserName
  • Password
myqToken=$(curl -s -X POST -H "Content-Type: application/json" -H "User-Agent: Chamberlain/10482 CFNetwork/978.0.7 Darwin/18.6.0" -H "MyQApplicationId: NWknvuBd7LoFHfXmKNMBcgajXtZEgKUh4V7WNzMidrpUUluDpVYVZx+xT4PCM5Kx" -d "{\"UserName\":\"$myqUsername\",\"Password\":\"$myqPassword\"}" "https://api.myqdevice.com/api/v5/Login" | jq -r .SecurityToken)

2) Get Account Id

GET https://api.myqdevice.com/api/v5/My?expand=account

myqAccountId=$(curl -s -G -H "User-Agent: Chamberlain/10482 CFNetwork/978.0.7 Darwin/18.6.0" -H "MyQApplicationId: NWknvuBd7LoFHfXmKNMBcgajXtZEgKUh4V7WNzMidrpUUluDpVYVZx+xT4PCM5Kx" -H "SecurityToken: ${myqToken}" "https://api.myqdevice.com/api/v5/My?expand=account" | jq -r .Account.Id)

3) Get Devices and State

curl -s -H "User-Agent: Chamberlain/10482 CFNetwork/978.0.7 Darwin/18.6.0" -H "MyQApplicationId: NWknvuBd7LoFHfXmKNMBcgajXtZEgKUh4V7WNzMidrpUUluDpVYVZx+xT4PCM5Kx" -H "SecurityToken: ${myqToken}" "https://api.myqdevice.com/api/v5.1/Accounts/${myqAccountId}/Devices" | jq .

Open the Garage Door

Required Headers

PUT https://api.myqdevice.com/api/v5.1/Accounts/${myqAccountId}/Devices/${myqDeviceId}/actions

  • 'Content-Type': 'application/json',
  • 'User-Agent': 'Chamberlain/10482 CFNetwork/978.0.7 Darwin/18.6.0'
  • 'MyQApplicationId': 'NWknvuBd7LoFHfXmKNMBcgajXtZEgKUh4V7WNzMidrpUUluDpVYVZx+xT4PCM5Kx'

JSON Body

  • action_type: open

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.