Chamberlain MyQ Binding

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.

Opening/Closing Items/Rules

Got the 2.5 binding up/running on OH 2.4. Can someone let me know the following?

Which item will control the action for up/down?
Is it the switch item that is the state?
Is it the up/down contact items?

Group MyQ
Switch				MyQDoorState		"MyQ Door State [MAP(garagedoor.map):%s]"	(MyQ, GarageDoorUp, GarageDoorDown)	{ channel="chamberlainmyq:MyQDoorOpener:b74ed2e1:ABC123:doorstate" }
String				MyQDoorStatus		"MyQ Door Status [%s]"											(MyQ)			{ channel="chamberlainmyq:MyQDoorOpener:b74ed2e1:ABC123:doorstatus" }
Contact				MyQDoorOpen			"MyQ Door Open [%s]"															{ channel="chamberlainmyq:MyQDoorOpener:b74ed2e1:ABC123:dooropen" }
Contact				MyQDoorClosed		"MyQ Door Closed [%s]"															{ channel="chamberlainmyq:MyQDoorOpener:b74ed2e1:ABC123:doorclosed" }
Rollershutter		MyQDoorRoller		"MyQ Door Roller [%s]"															{ channel="chamberlainmyq:MyQDoorOpener:b74ed2e1:ABC123:rollerstate" }
String				MyQDoorName			"MyQ Door Name [%s]"															{ channel="chamberlainmyq:MyQDoorOpener:b74ed2e1:ABC123:devicename" }

Best, Jay

It’s is controlled by the switch and/or the rollershutter.

1 Like

Hey, thanks for the email!!! My upgrade to 2.5 had problems, there were other services that were failing, so I ended up reinstalling this morning. And when I went to the app to get the password it told me my account was locked!! So this was definitely on my end! Anyhow, I’m connected now and going through and getting everything setup again.

Guess I should have tried logging into the app again to verify my account.

Thanks again for your help!!!

Did you ever figure out how to add the door opener in the .things file? I’ve tried many different options but have been unable to make it work.

2 Likes

I’m a new user to OH, I have version 2.5.1-2 installed on a Pi3. I decided to try to get MyQ garage doors working first and I’m having issues. I could not get the 1.14 binding to work at all and reading posts installed the org.openhab.binding.chamerlainmyq-2.5.0-SNAPSHOT.jar file. From the PaperUI I am able to discover my two garage doors and control them. However, I want to be able to create & control them from the BasicUI which I cannot to date. I am getting “hingStatusInfoChangedEEvent” in my logfile for my gateway and two garage doors:

2020-02-02 17:23:26.582 [hingStatusInfoChangedEvent] - ‘chamberlainmyq:MyQDoorOpener:GarageDoor:CG08502DExxx’ changed from ONLINE to UNINITIALIZED

2020-02-02 17:23:26.615 [hingStatusInfoChangedEvent] - ‘chamberlainmyq:MyQDoorOpener:GarageDoor:CG08502DExxx’ changed from UNINITIALIZED to UNINITIALIZED (HANDLER_MISSING_ERROR)

2020-02-02 17:23:26.619 [hingStatusInfoChangedEvent] - ‘chamberlainmyq:MyQDoorOpener:GarageDoor:CG08502DEyyy’ changed from ONLINE to UNINITIALIZED

2020-02-02 17:23:26.644 [hingStatusInfoChangedEvent] - ‘chamberlainmyq:MyQDoorOpener:GarageDoor:CG08502DEyyy’ changed from UNINITIALIZED to UNINITIALIZED (HANDLER_MISSING_ERROR)

2020-02-02 17:23:26.648 [hingStatusInfoChangedEvent] - ‘chamberlainmyq:MyQGateway:GarageDoor’ changed from ONLINE to UNINITIALIZED

2020-02-02 17:23:26.677 [hingStatusInfoChangedEvent] - ‘chamberlainmyq:MyQGateway:GarageDoor’ changed from UNINITIALIZED to UNINITIALIZED (HANDLER_MISSING_ERROR)

PaperUI still works, BasicUI does not. Any help on this is greatly appreciated.

Thanks in advance.
Bill

If the thing is going offline you will not be able to control the garage via paper ui or basic ui. Linking the switch into basic ui is the same as using the switch from the control screen of paper ui. Your issue is with the garage door going offline. What are you doing in basicui that is “causing” the offline error message?

OK did a clean load of 2.5 installed myq binding 1.14.0 put did myq.cfg file home.items and home.sitemap. Everything for both doors show up in all my sight maps but I get the error

==> /var/log/openhab2/openhab.log <==

2020-02-18 22:28:07.825 [ome.event.ItemCommandEvent] - Item ‘GarageDoorSwitch’ received command ON

==> /var/log/openhab2/openhab.log <==

2020-02-18 22:28:08.001 [WARN ] [nhab.binding.myq.internal.MyqBinding] - no MyQ device found with index: 0

==> /var/log/openhab2/events.log <==

2020-02-18 22:28:08.005 [vent.ItemStateChangedEvent] - GarageDoorSwitch changed from OFF to ON

==> /var/log/openhab2/openhab.log <==

2020-02-18 22:28:10.296 [ERROR] [core.karaf.internal.FeatureInstaller] - Failed installing ‘openhab-misc-restdocs’

==> /var/log/openhab2/events.log <==

2020-02-18 22:28:11.417 [ome.event.ItemCommandEvent] - Item ‘GarageDoorSwitch1’ received command ON

==> /var/log/openhab2/openhab.log <==

2020-02-18 22:28:11.571 [WARN ] [nhab.binding.myq.internal.MyqBinding] - no MyQ device found with index: 0

==> /var/log/openhab2/events.log <==

2020-02-18 22:28:11.575 [vent.ItemStateChangedEvent] - GarageDoorSwitch1 changed from OFF to ON

Can anyone point me to what I have done wrong. I hate to say i seem to get it running and it breaks, get it running and it breaks.

The 1.14 binding no longer works, you must use the 2.5 snapshot binding in post 477 above. Chamberlain MyQ Binding

OK, thank you. I assumed when I loaded the new 2.5 the bindings would be correct. I have been fighting with this for weeks, off and on. I am getting ready to expand my home controls and sensors, but didn’t want to move forward till I got this working. Thanks again.

The new binding link works great. Question, how do we get this added to the openhab remote respository so it is no longer necessary to download manually?
Cheers

I proposed this to the author that I would help with a “proper submission” but I received no response. I would definitely need his help and permission to get started.

1 Like

I submitted the binding for review over a year ago and got lots of feedback. They wanted the json parsing all rewrite to use GSON serialization. After I updated the code for this, the server side code no longer worked. I cant get Eclipses debugging to work to try to figure it out. I haven’t tried recently to work on this maybe it is easier now.