Chamberlain MyQ Binding

Thank you @scooter_seh

@scooter_seh back to my question from earlier: any chance you could post a repo for it. It allows the community to help fix problems rather than relying on one person.

1 Like

In my experience with open source projects there are always people that talk about helping but at the end of the day very few every do. My GitHub link has been posted before but here is the current branch I am working from. I am in the process of rewriting it all to be more object oriented and switching to a Google json parser. Feel free to contribute, if you are unhappy with the progress I’ll gladly step away. I do this all for fun and entitled users are my number one frustration.

I agree that there will be few that help, and I can’t say that I’ll be any better… I’m a ruby not Java developer so it takes me far more time to do stuff than I’d prefer. But at least then the coffee is out there if any one is interested or if you decide that you’re no longer interested.

I’ve submitted a PR that fixes the bundleContext errors I was receiving now that OpenHAB 2.5 is out: https://github.com/computergeek1507/openhab2-addons/pull/1

Separately, I’m now getting nulls returned as my Thing ID from the MyQGateway. I’m hoping my PR will get those folks working with 2.5 that were already working with previous milestones and releases. I’ve personally only tried this binding with 2.5 as I’ve only just purchased a MYQ-G0301-E and couldn’t even get this far until the small PR above:

26-Dec-2019 00:11:45.375 [DEBUG] [hamberlainmyq.handler.ChamberlainMyQGatewayHandler] - attempting to login
26-Dec-2019 00:11:45.442 [DEBUG] [hamberlainmyq.handler.ChamberlainMyQGatewayHandler] - myq securityToken: deadbeef-3fcc-4647-9835-dfcb16a5b690
26-Dec-2019 00:11:45.445 [DEBUG] [hamberlainmyq.handler.ChamberlainMyQGatewayHandler] - Retrieving door data
26-Dec-2019 00:11:45.446 [DEBUG] [nding.chamberlainmyq.handler.ChamberlainMyQHandler] - Thing ID: null
26-Dec-2019 00:11:45.446 [DEBUG] [nding.chamberlainmyq.handler.ChamberlainMyQHandler] - Thing ID: null
26-Dec-2019 00:11:45.614 [DEBUG] [hamberlainmyq.handler.ChamberlainMyQGatewayHandler] - myq AccountId: deadbeef-06c1-4620-af48-1f694701a59f
2 Likes

With Brian’s fix I was able to get the binding working with 2.5. Link to the new binding is below.

7 Likes

@scooter_seh Thanks a lot!! Can confirm that this version is working :muscle::+1:

Thanks @scooter_seh and @liko just updated to the new version and it’s working great!

@liko thanks for the quick fix, and @scooter_seh thanks for posting the Github link!

also thx from myside to @scooter_seh!

i have had to remove the old MyQ bundle manually via Karaf, after that everything was working fine!

Works like a charm! Hope you had a merry Christmas and a Happy New Year!

Greetings,

Is it possible to manually add the the door opener to a .things file? I can use PaperUI to add the gateway and door. Everything works like a charm. But I would like to manually add them to a things file and manage them that way.

I can get the gateway added and Im able to discover the door. but I would prefer to add the door to the .things file as well.

My things definition for the gateway is :

Bridge chamberlainmyq:MyQGateway:GarageDoor "MyQ API Services" [ username="xxxx", password="xxxxx"] { }

For smartthings I would do something like:

Bridge smartthings:smartthings:Controller01 [ smartthingsIp ="192.168.100.191", smartthingsPort=39500 ] {
    Thing switch OfficeDeskLight  "Office Desk Light Switch" [smartthingsName="Office Desk Light"]
    Thing switchLevel OfficeDeskLight "Office Desk Light Level" [smartthingsName="Office Desk Light"]
}

I’m not sure what the actual syntax for the opener its self would be.

1 Like

This is very timely given that I just decided to upgrade to 2.5. Thank you much.

As a feature request; I’d love to also see the last time that any action was taken on the garage door. The MyQ app shows something along the lines of “last opened 3hrs ago”.

This is already available. All you need to do is create a DateTime item and then kick off a rule whenever that item changes. Here is an example of one that I use for my patio door as a reminder of when we last let the dog out.

DateTime alarm_zone_patiodoor_changed  "[%1$ta %1$tR]" <time> (persistAndRestore)

rule "zone patio door fault"
when
    Item alarm_zone_patiodoor changed to OPEN
then
    var now = new DateTime()
    alarm_zone_patiodoor_changed.postUpdate(now.toString)  
end

That’s certainly a workable solution. Ultimately, I wanted it to be like the app (ie: 2hrs ago). I could get that done also with rules by updating the DateTime every minute and formatting my string to reflect it properly. The ideal solution would be one where the client computes the total amount of time (say in JS in a browser) given the last time where an action happened, but I don’t believe that’s feasible. It’s my understanding that I’d have to update variables server side to achieve this.

I have this working using the paperui creation of the things. I can not seem to figure out the correct syntax for the text based .things file. I can create the Bridge in the .things file (which in my case is the MyQ wifi bridge) and I see both of my garage doors show up in the inbox so I believe the connection to the API to be functional. Adding from the inbox seems to work. Personal preference is to not create the things in this manner as I have had problems in the past. Can someone post an example of a Bridge and garage door thing I can use as a basis? Thank you!

2 Likes

I’ve just upgraded to 2.5 (from 2.40) and on Openhabian

openHAB 2.5.1-2 (Release Build)

and am unable to get the 2.5 snapshot posted above by Scott H to work.
Any advice?

I’m getting the following error in paperui

UNINITIALIZED - HANDLER_INITIALIZING_ERROR

Log snippet

==> /var/log/openhab2/openhab.log <==
2020-01-19 20:04:42.920 [ERROR] [handler.ChamberlainMyQGatewayHandler] - Requesting URL Failed
java.io.IOException: java.util.concurrent.ExecutionException: org.eclipse.jetty.client.HttpResponseException: HTTP protocol violation: Authentication challenge without WWW-Authenticate header
at org.openhab.binding.chamberlainmyq.internal.HttpUtil.executeUrl(HttpUtil.java:148) ~[bundleFile:?]
at org.openhab.binding.chamberlainmyq.handler.ChamberlainMyQGatewayHandler.request(ChamberlainMyQGatewayHandler.java:415) [bundleFile:?]
at org.openhab.binding.chamberlainmyq.handler.ChamberlainMyQGatewayHandler.login(ChamberlainMyQGatewayHandler.java:225) [bundleFile:?]
at org.openhab.binding.chamberlainmyq.handler.ChamberlainMyQGatewayHandler.validConfiguration(ChamberlainMyQGatewayHandler.java:138) [bundleFile:?]
at org.openhab.binding.chamberlainmyq.handler.ChamberlainMyQGatewayHandler.initialize(ChamberlainMyQGatewayHandler.java:102) [bundleFile:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_222]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_222]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_222]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_222]
at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:152) [bundleFile:?]
at org.eclipse.smarthome.core.internal.common.Invocation.call(Invocation.java:52) [bundleFile:?]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_222]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_222]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_222]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_222]
Caused by: java.util.concurrent.ExecutionException: org.eclipse.jetty.client.HttpResponseException: HTTP protocol violation: Authentication challenge without WWW-Authenticate header
at org.eclipse.jetty.client.util.FutureResponseListener.getResult(FutureResponseListener.java:118) ~[bundleFile:9.4.20.v20190813]
at org.eclipse.jetty.client.util.FutureResponseListener.get(FutureResponseListener.java:101) ~[bundleFile:9.4.20.v20190813]
at org.eclipse.jetty.client.HttpRequest.send(HttpRequest.java:685) ~[bundleFile:9.4.20.v20190813]
at org.openhab.binding.chamberlainmyq.internal.HttpUtil.executeUrl(HttpUtil.java:128) ~[bundleFile:?]
… 14 more
Caused by: org.eclipse.jetty.client.HttpResponseException: HTTP protocol violation: Authentication challenge without WWW-Authenticate header
at org.eclipse.jetty.client.AuthenticationProtocolHandler$AuthenticationListener.onComplete(AuthenticationProtocolHandler.java:163) ~[?:?]
at org.eclipse.jetty.client.ResponseNotifier.notifyComplete(ResponseNotifier.java:198) ~[?:?]
at org.eclipse.jetty.client.ResponseNotifier.notifyComplete(ResponseNotifier.java:190) ~[?:?]
at org.eclipse.jetty.client.HttpReceiver.terminateResponse(HttpReceiver.java:444) ~[?:?]
at org.eclipse.jetty.client.HttpReceiver.responseSuccess(HttpReceiver.java:390) ~[?:?]
at org.eclipse.jetty.client.http.HttpReceiverOverHTTP.messageComplete(HttpReceiverOverHTTP.java:316) ~[?:?]
at org.eclipse.jetty.http.HttpParser.handleContentMessage(HttpParser.java:574) ~[?:?]
at org.eclipse.jetty.http.HttpParser.parseContent(HttpParser.java:1644) ~[?:?]
at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:1490) ~[?:?]
at org.eclipse.jetty.client.http.HttpReceiverOverHTTP.parse(HttpReceiverOverHTTP.java:172) ~[?:?]
at org.eclipse.jetty.client.http.HttpReceiverOverHTTP.process(HttpReceiverOverHTTP.java:135) ~[?:?]
at org.eclipse.jetty.client.http.HttpReceiverOverHTTP.receive(HttpReceiverOverHTTP.java:73) ~[?:?]
at org.eclipse.jetty.client.http.HttpChannelOverHTTP.receive(HttpChannelOverHTTP.java:133) ~[?:?]
at org.eclipse.jetty.client.http.HttpConnectionOverHTTP.onFillable(HttpConnectionOverHTTP.java:154) ~[?:?]
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311) ~[?:?]
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103) ~[?:?]
at org.eclipse.jetty.io.ssl.SslConnection$DecryptedEndPoint.onFillable(SslConnection.java:426) ~[?:?]
at org.eclipse.jetty.io.ssl.SslConnection.onFillable(SslConnection.java:320) ~[?:?]
at org.eclipse.jetty.io.ssl.SslConnection$2.succeeded(SslConnection.java:158) ~[?:?]
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103) ~[?:?]
at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:117) ~[?:?]
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:336) ~[?:?]
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:313) ~[?:?]
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:171) ~[?:?]
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:129) ~[?:?]
at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:367) ~[?:?]
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:782) ~[?:?]
at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:918) ~[?:?]
… 1 more
2020-01-19 20:04:42.962 [ERROR] [nal.common.AbstractInvocationHandler] - An error occurred while calling method ‘ThingHandler.initialize()’ on ‘org.openhab.binding.chamberlainmyq.handler.ChamberlainMyQGatewayHandler@14acc36’: null
java.lang.NullPointerException: null
at org.openhab.binding.chamberlainmyq.handler.ChamberlainMyQGatewayHandler.login(ChamberlainMyQGatewayHandler.java:232) ~[?:?]
at org.openhab.binding.chamberlainmyq.handler.ChamberlainMyQGatewayHandler.validConfiguration(ChamberlainMyQGatewayHandler.java:138) ~[?:?]
at org.openhab.binding.chamberlainmyq.handler.ChamberlainMyQGatewayHandler.initialize(ChamberlainMyQGatewayHandler.java:102) ~[?:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_222]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_222]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_222]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_222]
at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:152) [bundleFile:?]
at org.eclipse.smarthome.core.internal.common.Invocation.call(Invocation.java:52) [bundleFile:?]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_222]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_222]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_222]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_222]
2020-01-19 20:04:42.969 [ERROR] [core.thing.internal.ThingManagerImpl] - Exception occurred while initializing handler of thing ‘chamberlainmyq:MyQGateway:21fe9f3a’: null
java.lang.NullPointerException: null
at org.openhab.binding.chamberlainmyq.handler.ChamberlainMyQGatewayHandler.login(ChamberlainMyQGatewayHandler.java:232) ~[?:?]
at org.openhab.binding.chamberlainmyq.handler.ChamberlainMyQGatewayHandler.validConfiguration(ChamberlainMyQGatewayHandler.java:138) ~[?:?]
at org.openhab.binding.chamberlainmyq.handler.ChamberlainMyQGatewayHandler.initialize(ChamberlainMyQGatewayHandler.java:102) ~[?:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_222]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_222]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_222]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_222]
at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:152) [bundleFile:?]
at org.eclipse.smarthome.core.internal.common.Invocation.call(Invocation.java:52) [bundleFile:?]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_222]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_222]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_222]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_222]

Make sure you get Scott’s latest version at Chamberlain MyQ Binding.

Then add the thing from PaperUI. It no longer reads from myq.conf file.

I have his latest. I did try adding it through the PaperUI, that’s where I ended up with the error. I wonder if I have a separate upgrade issue going on… (asside from the addons.cfg that’s mentioned quite frequently)

Based on your log, it is failing to login. I would double check your username and password. I just updated my main install to 2.5 with my new binding yesterday and it worked for me. If your password has a unique character in it please let me know. In the past they have caused issues.