Chamberlain/Liftmaster MyQ Plugin

I have the MyQ Garage (MYQ-G0201) with one door opener which happens to be a Chamberlain. While I’m able to get past the username / password steps, the child device never shows up and “CommFailure” = 1.

Is it possible the MyQ Garage has a different TypeId (GATEWAY_DEVICE) with respect to the MyQ gateway (e.g. not equal to 49)?

I’m not familiar enough with the system to know how to debug this code on the micasaverde such that I can see what type id is returned. Is there a simple way to dump that variable somewhere where I can look at it?

[quote=“jeff3lo, post:38, topic:180826”]Thanks macrho! MyQ2.zip worked for me. Here is my observation:

  1. I uploaded the new files, and created a new device
  2. When I initially looked at the “Advance” tab, there was no Username and Password
  3. I started to reload Vera a few times, and Username showed up
  4. I put in my MyQ Username there, and continued to reload a few more times, the Password showed up
  5. I put in my MyQ Password there, and continued to reload a few more times, the Child Device “Garage Door” showed up
  6. Everything works perfectly after that (including Last Update, Open Garage Door, Close Garage Door)![/quote]

You can do it through your browser, get the security token by going here:

https://myqexternal.myqdevice.com/Membership/ValidateUserWithCulture?appId={0}&username={1}&password={2}&culture=en

but substitute:

{0}=Vj8pQggXLhLy0WHahglCD4N1nAkkXQtGYpq2HrHD7H1nvmbT55KqtN6RSF4ILB%2fi
{1}=Your email address
{2}=Your password

Then use:

https://myqexternal.myqdevice.com/api/UserDeviceDetails?appId={0}&securityToken={1}

with the following substitutions

{0}=AppID from above
{1}=Your security token that is returned from your first call

I have USB logging turned on, where does one find the log files? The plugin stops working after about 2 days and I’d like to track down the error message but as best as I can figure, log files only last a day.

Getting closer to having something ready – anyone with any comments on what has been produced so far in this plugin? I see there are some downloads but not any comments

With the MyQ Garage the opener is showing up as 49. I changed the number in the code and I get further along before but it doesn’t properly get the door status. Tossing in log() calls is only getting me so far. I’m afraid I really want a source level debugger. Is the ZB tool useful?

I should add that I see the token declared invalid must earlier than two days.

does the plugin enumerate your garage doors correctly?
i need to spend some more time with ZB, I’m not sure how to debug a plugin on restart and watch
I should have some more time to look at this over the weekend

If you turn on USB logging, and turn off sending them to MiOS Servers, then Vera will keep #'d backups compressed locally.

Either way, logs are on Vera in the directory:
/var/log/cmh/

Digging more into the code and the server’s response, using the following appears to get you plugin working for my configuration,

local GARAGE_DOOR_OPENER = 259
local GATEWAY_DEVICE = 259

That said I have two child devices created: _Door Lock and Garage Door Opener.

[quote=“macrho, post:45, topic:180826”]does the plugin enumerate your garage doors correctly?
i need to spend some more time with ZB, I’m not sure how to debug a plugin on restart and watch
I should have some more time to look at this over the weekend[/quote]

[quote=“guessed, post:46, topic:180826”]If you turn on USB logging, and turn off sending them to MiOS Servers, then Vera will keep #'d backups compressed locally.

Either way, logs are on Vera in the directory:
/var/log/cmh/[/quote]

I unchecked both:

Archive old logs on server (recommended)
Lock Log Levels (not recommended)

Everything else is checked

thanks!

EDIT:
Strangely, the settings don’t stick. When I go back to the logging section, everything reverts to be checked [I had saved the settings as well] Odd…

[quote=“strat, post:47, topic:180826”]Digging more into the code and the server’s response, using the following appears to get you plugin working for my configuration,

local GARAGE_DOOR_OPENER = 259
local GATEWAY_DEVICE = 259

That said I have two child devices created: _Door Lock and Garage Door Opener.[/quote]

Interesting, they are both 259? Can you possibly PM your devices XML file to me?

Showing my ignorance again about this system… I’m not sure what / where this file is. I did a find over the complete file system of the Vera and nothing with an XML extension came up that makes sense with respect to what you are asking for.

Thoughts?

[quote=“strat, post:50, topic:180826”]Showing my ignorance again about this system… I’m not sure what / where this file is. I did a find over the complete file system of the Vera and nothing with an XML extension came up that makes sense with respect to what you are asking for.

Thoughts?[/quote]

Sorry, I meant from the MyQ site, part 2 form here http://forum.micasaverde.com/index.php/topic,24715.msg174695.html#msg174695

I’m thinking I might be able to use a different identifier to find the gateway and the openers.

My gateway also contains a “MyQDeviceTypeId” that is a 1
Each of my garage door openers have “a MyQDeviceTypeId” that is a 2

I’m hoping your devices show that as well

[quote=“macrho”]And thank you for the link to your code, I’ll start looking over it. I’m looking at this as a challenge: Can I actually do this? I hope the appId I’m using stays viable – if not, I’ve gotten to better understand Vera and LUA/LUUP through this exercise :slight_smile:

-Mark[/quote]

Keep up the good work. Don’t worry about the app id, as long as their app uses SSL it shouldn’t be too difficult to get with some new root certs.

I uploaded a newer version to the first post – I figure that’s the easiest way to keep stuff updated

am unable to make any changes to how i save my logs (unchecking upload to micasaverde, for example, can’t be unchecked – I reload and it’s checked again). so while I’m having the plugin crash, I can’t find the reason why in the logs as they seem to cycle after the plugin crashes or does something…

i did some work renaming the plugin to “MyQ Gateway” along with a 23 hour re-auth for the token…

once I figure out why the plugin crashes/stops, I’ll upload a new version.

Great Work!

I upgraded to a MyQ and have this connected. I know you’re still working on it but I’ll throw out a few comments for now:

  1. I opened it successfully (with the unlock button) and tried to close (lock) it while it was still moving up. That didn’t work (I suspect a limitation with the Chamberlain MyQ system). But Vera shows the button as locked. I had to unlock again then lock again to close it.

  2. In doing this, the Vera button status got a bit out of sync with the state of the door. I did a refresh (not reload) of my browser and it was still out of a sync, then a few seconds later the button status changed to reflect the correct state.

  3. I’ve not had this more than 24 hours but I can stop playing with it for a day or two and then test to see if it still works if you’d like me to test that.

  4. On install it did take a few reloads before the password field appeared. Not unexpected and probably a Vera thing.

  5. Do you plan to change the JSON? (I think that is what it is called). Right now it shows as a lock and has all of the options a lock would have (PIN codes etc). Is there a door or gate option you can use (with open or close graphic indicators?). Though I suppose creating your own device type will make 3rd party phone apps have a problem working with the device.

Overall, great app. Thanks so much for doing this. I’ve ordered a second wall remote that will hopefully enable my older liftmaster for the service… Otherwise I may be swapping out a second garage door opener soon!

thanks for the kind words, @ramias

  1. Once you change the state of a door, it will change the lock from the opposite of what it was before. Then it will wait another 90 seconds to change the state of the door. I’ll need to test with MyQ app to see if it automatically detects a change. There’s probably a way I can change the poll to 5 seconds for 2 minutes after a change is detected.

  2. That’s the 90 second delay I hard coded

  3. I’m seeing the plugin crashing or rather stop working after 20+ hours. My Vera is recycling logs and I’m not sure where they are so I can’t troubleshoot (yet)

  4. Yes, I’ve observed the same. I think I improved it a bit but it’s more homework for me to do to figure out why this happens

  5. You mean the UI for the garage door opener, yes, I should figure out how to create a device that inherits from the door locks but only shows what I need (lock/unlock and that’s about it)

The last 10% of this plugin seems to be taking up the largest portion of my time. But I’ll get there

again, thanks for the kind words – I’m learning as I go

I'm seeing the plugin crashing or rather stop working after 20+ hours. My Vera is recycling logs and I'm not sure where they are so I can't troubleshoot (yet)
.

Is there anything that resets the 20 hour clock?

Will a Vera reload do it?

Control of the door from Vera? (I.e. just using the plugin?)

What should I be looking for to help you troubleshoot this?

So, the issue with the refresh after 23 hours was my fault. I seemed to have left off the code that runs once it happens (doh!)
I’ve uploaded another version of the code, I’ve renamed everything from LiftMasterOpener to MyQGateway, just seemed to make more sense

It’s been running for over 24 hours now without issue, cross my eyes and fingers and toes
I’m thinking that I’ll alter the refresh after a door action is triggered, perhaps query the door status every 10 seconds for 2 minutes