Chamberlain MyQ Binding

Thanks, Scott. This update worked for me as well. Just changed config to {myq=“Garage Door”} and all was good.

I finally got my garage door working with the 1.14.0.201911070244 binding. The final key was to update {myq=“Garage Door Opener”} which is the way I named my device in the MyQ app on my phone.

I still see this error in the logs every time the door status changes, but it is working:
2019-11-12 11:43:24.467 [WARN ] [he.commons.httpclient.HttpMethodBase] - Cookie rejected: “$Version=0; TS01dfdd0d=015ca84662bb636bdbf028b0c0651fd83b3cd5086c3e957093623bfb027340e60ce65ea901fea8ed9b0dca8ed5a5f61e73a9287141; $Path=/; $Domain=.api.myqdevice.com”. Illegal domain attribute “.api.myqdevice.com”. Domain of origin: “api.myqdevice.com

I see above that the “myq=0#online” types of items don’t work anymore with the new API. Is there anyway to get the online/offline status of my garage door?

So my garage doors stopped updating yesterday sometime, and i finally got a chance to check my logs today. I’m getting the following messages. Anybody else having trouble like this? I just got this working Saturday by using @scooter_seh newest jar file from a few posts above.

2019-11-12 17:40:57.552 [ERROR] [handler.ChamberlainMyQGatewayHandler] - An exception occurred while executing a request to the Gateway: ‘null’

2019-11-12 17:41:57.405 [ERROR] [handler.ChamberlainMyQGatewayHandler] - Requesting URL Failed

at org.openhab.binding.chamberlainmyq.internal.HttpUtil.executeUrl(HttpUtil.java:148) ~[?:?]

at org.openhab.binding.chamberlainmyq.handler.ChamberlainMyQGatewayHandler.request(ChamberlainMyQGatewayHandler.java:413) ~[?:?]

at org.openhab.binding.chamberlainmyq.handler.ChamberlainMyQGatewayHandler.getMyqData(ChamberlainMyQGatewayHandler.java:249) ~[?:?]

at org.openhab.binding.chamberlainmyq.handler.ChamberlainMyQGatewayHandler.refreshDeviceState(ChamberlainMyQGatewayHandler.java:329) ~[?:?]

at org.openhab.binding.chamberlainmyq.handler.ChamberlainMyQGatewayHandler.lambda$0(ChamberlainMyQGatewayHandler.java:319) ~[?:?]

at org.openhab.binding.chamberlainmyq.internal.HttpUtil.executeUrl(HttpUtil.java:128) ~[?:?]

Update: I got it working by removing the “bridge” thing and re-adding it…

It is working fine but I am noticing one strange behavior, as I am using the Door State Switch to turn it on and off but pressing the button for example if the current state is off then if I hit the switch then it goes to on and then off. Not sure why but in the previous world the button was just executing one command. Am I doing something wrong in any of the settings?

I also get that state some times as well where the open close switch jumps to the other state. Also, I am getting this error in the log:

2019-11-14 22:56:13.940 [ERROR] [nhab.binding.myq.internal.MyqBinding] - Could not connect to MyQ service

java.io.IOException: Could not parse response

	at org.openhab.binding.myq.internal.MyqData.request(MyqData.java:286) ~[20:org.openhab.binding.myq:1.14.0.201910221119]

	at org.openhab.binding.myq.internal.MyqData.login(MyqData.java:138) ~[20:org.openhab.binding.myq:1.14.0.201910221119]

	at org.openhab.binding.myq.internal.MyqData.findAccount(MyqData.java:184) ~[20:org.openhab.binding.myq:1.14.0.201910221119]

	at org.openhab.binding.myq.internal.MyqData.getAccountID(MyqData.java:207) ~[20:org.openhab.binding.myq:1.14.0.201910221119]

	at org.openhab.binding.myq.internal.MyqData.getMyqData(MyqData.java:121) ~[20:org.openhab.binding.myq:1.14.0.201910221119]

	at org.openhab.binding.myq.internal.MyqBinding.poll(MyqBinding.java:205) [20:org.openhab.binding.myq:1.14.0.201910221119]

	at org.openhab.binding.myq.internal.MyqBinding.access$0(MyqBinding.java:197) [20:org.openhab.binding.myq:1.14.0.201910221119]

	at org.openhab.binding.myq.internal.MyqBinding$1.run(MyqBinding.java:388) [20:org.openhab.binding.myq:1.14.0.201910221119]

	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:?]

	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) [?:?]

	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) [?:?]

	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) [?:?]

	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]

	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]

	at java.lang.Thread.run(Thread.java:748) [?:?]

Caused by: org.codehaus.jackson.JsonParseException: Unexpected character ('<' (code 60)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')

 at [Source: java.io.StringReader@1cc1ef9; line: 1, column: 2]

	at org.codehaus.jackson.JsonParser._constructError(JsonParser.java:1432) ~[?:?]

	at org.codehaus.jackson.impl.JsonParserMinimalBase._reportError(JsonParserMinimalBase.java:385) ~[?:?]

	at org.codehaus.jackson.impl.JsonParserMinimalBase._reportUnexpectedChar(JsonParserMinimalBase.java:306) ~[?:?]

	at org.codehaus.jackson.impl.ReaderBasedParser._handleUnexpectedValue(ReaderBasedParser.java:1192) ~[?:?]

	at org.codehaus.jackson.impl.ReaderBasedParser.nextToken(ReaderBasedParser.java:479) ~[?:?]

	at org.codehaus.jackson.map.ObjectMapper._initForReading(ObjectMapper.java:2761) ~[?:?]

	at org.codehaus.jackson.map.ObjectMapper._readMapAndClose(ObjectMapper.java:2709) ~[?:?]

	at org.codehaus.jackson.map.ObjectMapper.readTree(ObjectMapper.java:1533) ~[?:?]

	at org.openhab.binding.myq.internal.MyqData.request(MyqData.java:252) ~[?:?]


I don’t know if they could be related.

I haven’t been able to find a similar error condition in this thread as to what I’m seeing, so I’m going to add my output and hopefully someone can point me in the right direction. I’m getting a 400 Bad Request when the binding connects to the myq api.

2019-11-14 21:46:10.760 [DEBUG] [he.commons.httpclient.HttpConnection] - Open connection to myqexternal.myqdevice.com:443
2019-11-14 21:46:10.776 [DEBUG] [mpl.info.InfoBundleTrackerCustomizer] - Ignore incorrect info null provided by bundle org.openhab.binding.myq
2019-11-14 21:46:10.779 [DEBUG] [org.openhab.binding.myq             ] - BundleEvent STARTED - org.openhab.binding.myq
2019-11-14 21:46:10.790 [DEBUG] [e.osgi.LoggingCommandSessionListener] - Command: 'bundle:restart org.openhab.binding.myq' returned 'null'
2019-11-14 21:46:10.851 [DEBUG] [httpclient.wire.header              ] - >> "POST /api/v4/User/Validate HTTP/1.1[\r][\n]"
2019-11-14 21:46:10.853 [DEBUG] [he.commons.httpclient.HttpMethodBase] - Adding Host request header
2019-11-14 21:46:10.856 [DEBUG] [httpclient.wire.header              ] - >> "User-Agent: Chamberlain/3.73[\r][\n]"
2019-11-14 21:46:10.858 [DEBUG] [httpclient.wire.header              ] - >> "ApiVersion: 4.1[\r][\n]"
2019-11-14 21:46:10.860 [DEBUG] [httpclient.wire.header              ] - >> "Culture: en[\r][\n]"
2019-11-14 21:46:10.863 [DEBUG] [httpclient.wire.header              ] - >> "MyQApplicationId: *censored*[\r][\n]"
2019-11-14 21:46:10.865 [DEBUG] [httpclient.wire.header              ] - >> "Accept: application/json[\r][\n]"
2019-11-14 21:46:10.867 [DEBUG] [httpclient.wire.header              ] - >> "BrandId: 2[\r][\n]"
2019-11-14 21:46:10.870 [DEBUG] [httpclient.wire.header              ] - >> "Host: myqexternal.myqdevice.com[\r][\n]"
2019-11-14 21:46:10.872 [DEBUG] [httpclient.wire.header              ] - >> "Content-Length: 62[\r][\n]"
2019-11-14 21:46:10.874 [DEBUG] [httpclient.wire.header              ] - >> "Content-Type: application/json[\r][\n]"
2019-11-14 21:46:10.876 [DEBUG] [httpclient.wire.header              ] - >> "[\r][\n]"
2019-11-14 21:46:10.879 [DEBUG] [httpclient.wire.content             ] - >> "{"username":"myemailaddress@domain","password":"*censored*"}"
2019-11-14 21:46:11.125 [DEBUG] [client.methods.EntityEnclosingMethod] - Request body sent
2019-11-14 21:46:11.213 [DEBUG] [httpclient.wire.header              ] - << "HTTP/1.1 400 Bad Request[\r][\n]"
2019-11-14 21:46:11.215 [DEBUG] [httpclient.wire.header              ] - << "HTTP/1.1 400 Bad Request[\r][\n]"
2019-11-14 21:46:11.217 [DEBUG] [httpclient.wire.header              ] - << "Cache-Control: no-cache[\r][\n]"
2019-11-14 21:46:11.219 [DEBUG] [httpclient.wire.header              ] - << "Connection: close[\r][\n]"
2019-11-14 21:46:11.221 [DEBUG] [httpclient.wire.header              ] - << "Content-Type: application/json; charset=utf-8[\r][\n]"
2019-11-14 21:46:11.223 [DEBUG] [httpclient.wire.header              ] - << "Pragma: no-cache[\r][\n]"
2019-11-14 21:46:11.225 [DEBUG] [httpclient.wire.header              ] - << "Content-Length: 165[\r][\n]"
2019-11-14 21:46:11.227 [DEBUG] [httpclient.wire.header              ] - << "[\r][\n]"
2019-11-14 21:46:11.230 [DEBUG] [httpclient.wire.content             ] - << "{[\r][\n]"
2019-11-14 21:46:11.231 [DEBUG] [httpclient.wire.content             ] - << "    "SecurityToken": "",[\r][\n]"
2019-11-14 21:46:11.233 [DEBUG] [httpclient.wire.content             ] - << "    "ReturnCode": "0",[\r][\n]"
2019-11-14 21:46:11.235 [DEBUG] [httpclient.wire.content             ] - << "    "ErrorMessage": "please contact customer care, supportID: *censored*",[\r][\n]"
2019-11-14 21:46:11.237 [DEBUG] [httpclient.wire.content             ] - << "    "CorrelationId": ""[\r][\n]"
2019-11-14 21:46:11.239 [DEBUG] [httpclient.wire.content             ] - << "}"

I’m guessing that the json will come from the API, so I can’t even get that far. I’ve triple checked my user name and password and they both seem just fine. I have the MyQ app installed on my iPhone (with that user/password) and can successfully open and close the doors with the app.

The version of the binding I’m using is 1.13, which I got from downloading from within the paper UI.

Any ideas?

The 1.13 doesn’t work anymore. You have to manually install a newer version.

In your item file you can add autoupdate=“false” to prevent this.

When I was tried the 1.14 it wasn’t working last night, I need to look into why. The 2.5 was working.

My apologies. I should have read the error more carefully. I uninstalled the 1.14 binding via Paper UI but maybe it didn’t completely uninstall. I will check with Openhab console to make sure it is completely gone. I had dropped the 2.5 binding in the addons folder and the door was responding to Openhab so I thought I was working with only the 2.5 binding.

@scooter_seh Thanks again for updating this. Mine was broken until I snagged the latest 2.5 this past weekend. Greatly appreciate it.

Thank you for updating this binding to keep up with API changes! I was curious if there are new items that we can leverage with the new API? I removed all the items with a # symbol in them, and am now left with this:

Switch GarageDoorSwitch “Garage Door” [“Switchable”] {myq=“Garage Door Opener”}
Rollershutter GarageDoorShutter “Garage Door” {myq=“Garage Door Opener”}
Contact GarageDoorContact “Garage Door Status [MAP(en.map):%s]” {myq=“Garage Door Opener”}
String GarageDoorString “Garage Door Status [%s]” {myq=“Garage Door Opener”}

Is that it, or is there a comprehensive list of items that I’m missing?

What is the latest version? 2.5.0 SNAPSHOT? I see some references to that version in earlier comments on this thread. It would be great if you listed where to find all of the releases instead of direct links. Any chance you can put this somewhere like github?

Also, downloading from a google drive is difficult for some people. For instance, I do most of my work from a chromebook and gdrive doesn’t give you direct links. I was unable to find a way to actually get the URL to feed to wget on my openhab raspberry pi.

Lastly, can the binding documentation on the main page mention that the 1.13 version you get when you download from the UI no longer works? That might save some frustration.

Thanks.

I just upgraded my OH2 installation from 2.5.0-SNAPSHOT Build #1747 to Build #1759 and the manually installed version of your 2.5.0-SNAPSHOT JAR is now failing. It was working without issue under OH2 2.5.0-SNAPSHOT build #1747.

Binding version info:

openhab> bundle:list -s -r | grep -i myq
205 │ Active │  80 │ 2.5.0.201911090131      │ org.openhab.binding.chamberlainmyq                                              │ [osgi.identity; type="osgi.bundle"; version:Version="2.5.0.201911090131"; osgi.identity="org.openhab.binding.chamberlainmy

Errors:

2019-11-18 07:00:10.130 [ERROR][     safeCall-2][nal.common.AbstractInvocationHandler] - An error occurred while calling method 'ThingHandler.initialize()' on 'org.openhab.binding.chamberlainmyq.handler.ChamberlainMyQGatewayHandler@73ee4688': bundleContext
java.lang.NoSuchFieldError: bundleContext
        at org.openhab.binding.chamberlainmyq.handler.ChamberlainMyQGatewayHandler.initialize(ChamberlainMyQGatewayHandler.java:103) ~[?:?]
        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]
2019-11-18 07:00:10.149 [ERROR][     safeCall-2][core.thing.internal.ThingManagerImpl] - Exception occurred while initializing handler of thing 'chamberlainmyq:MyQGateway:d9038950': bundleContext
java.lang.NoSuchFieldError: bundleContext
        at org.openhab.binding.chamberlainmyq.handler.ChamberlainMyQGatewayHandler.initialize(ChamberlainMyQGatewayHandler.java:103) ~[?:?]
        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]

Statuses of MyQ things:

chamberlainmyq:MyQDoorOpener:d9038950:CG082XXXXXXX (Type=Thing, Status=UNINITIALIZED (BRIDGE_UNINITIALIZED), Label=Garage Door, Bridge=chamberlainmyq:MyQGateway:d9038950)
chamberlainmyq:MyQGateway:d9038950 (Type=Bridge, Status=UNINITIALIZED (HANDLER_INITIALIZING_ERROR): bundleContext, Label=MyQ Gateway, Bridge=null)
chamberlainmyq:MyQLight:d9038950:CG068XXXXXXX (Type=Thing, Status=UNINITIALIZED (BRIDGE_UNINITIALIZED), Label=Garage Door Light, Bridge=chamberlainmyq:MyQGateway:d9038950)

This was removed in the most recent openhab-core (it had been marked as deprecated for quite some time).

@scooter_seh See here for how to do it now.

Thanks for the quick response with explanation. I didn’t peruse issues on GitHub, but figured it was likely something deprecation related.

I knew the discovery code I am using was going to be deprecated, I have to rewrite it all for the binding. I haven’t found a good example to base the code off yet.

1 Like

@scooter_seh So does this mean the binding is broken until you have an opportunity to “rewire” this? I had the binding working a couple of weeks ago, then had all sorts of unrelated problems which prompted me to reload my entire install about 47 times(lol), and now it’s not working and i’m seeing the same errors in my log as Scott K is a few posts up.

PS: Please forgive me for not having the details of my system to post along with my question. I’m on the 2.5 Snapshot build #1764.

1 Like

I read through this whole thread but didn’t find an exact answer. Is openHAB working correctly with the MyQ Smart Hub ( MYQ-G0301)?
Thanks!
Mike