[OBSOLETE] MyQ Lite Door and Lamp Control (for Liftmaster/Chamberlain)

Does this open up a security hole for the MyQ integration? If this endpoint is attacked in some way, what are the potential side effects?

I thought about that, but either way it’s going to be irrelevant. After a long battle with the Groovy last night, I finally hit the limit for the last step where it is required to basically halt the final oauth redirect step and pull out the generated access code. The watered-down httpGet method in Groovy does not have an option to do that.

So that’s a bummer. But all is not lost. The current plan is to provide a small, downloadable javascript executable (multi-OS compatible) that people can run to generate the initial MyQ oauth tokens - this is pretty easy now with Node. Then, it’s just a matter of pasting those initial values into the app in the IDE, and SmartThings can (hopefully) manage the periodic token refresh from then on out.

Once that is working, I’ll just need to tweak the other things that changed with the new API version around door commands.

9 Likes

Thank you very much for your efforts Brian…we all appreciate it. Cheers!

2 Likes

That sounds similar to the way GCal integration is authorized?(It’s been a while since I set that up, so maybe not!) If so should be pretty manageable.

Appreciate all your work on this Brian!

I’ve about run out of patience for myq, though. Time to move on to greener pastures. No interest in having to deal with additional add-ons.

Thank you Brian

For those who also use Alexa, there is a pretty easy workaround here using Simple Commands, which is also free. You can use then use virtual switches to control functionality within Smartthings. I assume this would only work for those who are using contact sensors to determine door status though.

https://simplecommands.zendesk.com/hc/en-us/community/posts/360031227294-setting-up-MyQ-garage-door-to-automatically-open-and-close-based-on-home-location

"December 21, 2020 16:59

It’s actually much easier now than in the past thankfully. I no longer use IFTTT since they began charging for the service, so that eliminates an entire step. This process assumes that you have a wifi enabled MyQ controller and an active MyQ account. It also assumes that you are using an Alexa device, but I imagine that other voice assistants could be configured similarly…I am just not familiar with those platforms.

  1. Within the All Items section of Simple Commands, choose Add/Remove Items. Select myQ Openers and enter your myQ credentials to connect the account. When finished, you should have a tile under All Items that is labeled Garage Door - myQ. You should be able to open this tile and open and close your garage door.

  2. Do not toggle on any of the options listed below the Open and Close toggles even tho you might think you should!

  3. Now go into the Routines section of Simple Commands and click on Add Routine. Name this routine Auto Open the Garage. On the next screen, choose Garage Door (myQ-Openers) and click Add. The click Open on the next screen and then click Add Command. This should then take you to the Routines page and display a tile with the label you just created.

  4. Now basically repeat this process to create a second routine and label it Auto Close the Garage and choosing Close as the command.

  5. You should now have 2 tiles under Routines. One labeled Auto Open the Garage and one labeled Auto Close the Garage. You are now finished with the Simple Commands portion of the set up.

  6. Within Alexa, you must first enable the skill to connect to Simple Commands. Go to the skills section and search for ā€œkloee for scā€ Using your login and password from Simple Commands, enable this skill and connect the accounts.

  7. Once you have connected the accounts, Alexa will usually prompt you to discover new devices. If she doesn’t, then do a device discovery manually simply by saying ā€œAlexa, discover devicesā€ Once the discovery is complete, you should have 2 new entries under the Scenes section on the Devices page in the Alexa App. These will be the routines you created in Simple Commands.

  8. Now you can simply create routines within Alexa and use these scenes to control your garage door.

  9. To auto open your garage door when your cell phone gets close to home, go to the Routines page in the Alexa App and click ā€˜+’ to add a routine. Give the routine a name (I used the same name as in Simple Commands). Click the ā€˜+’ next to ā€œwhen this happensā€ and choose location. Make sure that you have Arrives chosen at the top of the page and confirm your location and adjust the map as needed. Then under Add Action, choose Smart Home and then Control Scene and choose the Auto Open the Garage Scene that was imported from Simple Commands. Click Save in the upper right corner and you should be finished. You can then create an Auto Close Routine by repeating the above steps and changing your choices to Leaves and choosing the Auto Close the Garage routine.

I hope this is step by step enough. Once you have the scene imported into Alexa, it can be used in a routine to do many different things…it can be an action or even a trigger for a different action. Just play with it and have fun!"

2 Likes

Well, I had a moment of panic earlier when I realized the home assistant and pymyq implementations of this do not seem to use the refresh token (they simply redo the entire oauth request from the beginning). Seeing as how I cannot do that piece in groovy, that was going to be a killer.

Luckily, MyQ is sticking to normal OAuth convention, so I was able to basically guess the refresh token call, and I can now get new tokens with a simple POST request.

The biggest milestone accomplishment was that I successfully pulled a refresh token from within the SmartApp groovy and then was able to make a call to get the list of devices.

This is a huge relief as I now know for certain this will work and have a definite path forward. It will still take me some time to clean it up and put it together, but we’re talking days, not weeks.

14 Likes

Excellent! Enjoy your weekend!

Thanks for all your hard work Brian!

2 Likes

Yayyyyyyy!!! Thank ya thank ya!!!

Thanks Brian you are a boss

sdbg,

I used Simple Commands many months ago when it was working properly, then it stopped. I see that it is back online now. However following your instructions I am only able to add my Chamberlain garage door to Simple Commands as well as create the Routines. However Alexa never discovers or creates my scenes. All Apps are linked together and I can easily open/close by garage with the Simple Commands App, and with the routines as well. Any suggestions? Thank you. - Bill

Thanks Brian as usual. Looking forward to a fix

Odd. Mine worked right away and Alexa detected the myq device and added two scenes, one for open and one for close. Did you check within the Alexa app on 'Scenes "?

There is an important step in SC of enabling voice assistant.

You can see the instructions here

It’s working! I got lamp and door control command sent successfully. The code is still really rough, but…I figured I’d post this anyway for anyone who is really eager. If you’re willing to do some trailblazing without much direction, here ya go:

  1. Download the token generator applicable to your computer OS here: https://github.com/brbeaird/SmartThings_MyQ/tree/apiV6/myQTokenGenerator. Run it (you may need to answer prompts from Windows that it is safe), enter your credentials, and get the token.
  2. Update SmartApp https://github.com/brbeaird/SmartThings_MyQ/tree/apiV6/smartapps/brbeaird/myq-lite.src
  3. Once the update is saved and published, go to ā€œApp settingsā€ on the SmartApp or click the ā€œEditā€ icon next to it in the SmartApp list. Scroll down and click on ā€œSettings.ā€ You should see a box named MyQToken - paste your token into the Value box.
  4. Update device handlers https://github.com/brbeaird/SmartThings_MyQ/tree/apiV6/devicetypes/brbeaird
  5. Open the SmartApp, tap modify devices, and click through that process.
  6. Open the IDE logs, then try a command.

This is considered super ā€œalphaā€ - it is for sure not perfect. I’ll be cleaning this up and writing up new documentation. If you do have success, let me know.

13 Likes

quick question - how do you run it on a mac? what is required? :slight_smile:

There should be a macos-compatible file to download. Just click and run it I think? It should be totally self-contained, no need to have anything else.

does not run. only able to open as text file