Chamberlain MyQ Binding

I just tried and mine installed the 2/14 binding…

Something is very strange with the builds. On build 838 the downstream build for openhab-linuxpkg succeeded and I ended up with a working March version of the binding. On build 839 the downstream build for openhab-linuxpkg failed and I reverted back to the 2/14 binding. Today’s build 840 failed, so no update attempt today. I’m just going to put a working version of the jar in addons and wait until the builds settle down.

I am using openhab 1.83 and updated myq binding from wget http://pictures.scott-hanson.com/org.openhab.binding.myq-1.10.0-SNAPSHOT.jar

But still error
2017-03-15 12:40:07.484 [ERROR] [inding.myq.internal.MyqBinding] - Could not connect to MyQ service
java.io.IOException: Request Failed: Unknow resonse
at org.openhab.binding.myq.internal.MyqData.request(MyqData.java:248) ~[bundlefile:na]
at org.openhab.binding.myq.internal.MyqData.login(MyqData.java:144) ~[bundlefile:na]
at org.openhab.binding.myq.internal.MyqData.getSecurityToken(MyqData.java:183) ~[bundlefile:na]
at org.openhab.binding.myq.internal.MyqData.getMyqData(MyqData.java:128) ~[bundlefile:na]
at org.openhab.binding.myq.internal.MyqBinding.poll(MyqBinding.java:210) [bundlefile:na]
at org.openhab.binding.myq.internal.MyqBinding.access$0(MyqBinding.java:202) [bundlefile:na]
at org.openhab.binding.myq.internal.MyqBinding$1.run(MyqBinding.java:407) [bundlefile:na]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_121]
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) [na:1.8.0_121]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) [na:1.8.0_121]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) [na:1.8.0_121]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_121]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_121]
at java.lang.Thread.run(Thread.java:745) [na:1.8.0_121]

That’s still using the old API according to the error
I’m using the jar from Scott’s Google Drive.

https://drive.google.com/open?id=0Bx6EpCMtJQHVVzlQSmtWT3AwWDg

Works perfectly.
Make sure to remove your old binding from your Addon folder.

The JAR on my google drive and website should be exactly the same.

@j_higs Liftmaster and Chamberlain use the same API. The Liftmaster and Chamberlain android app are the same sourcecode if you decompile one app all the code for the other app is included. If you want to try using the API manually I recommend using Postman app for Google Chrome. If you match my settings below you should get a return code of zero when you click send. The MyQApplicationId is “NWknvuBd7LoFHfXmKNMBcgajXtZEgKUh4V7WNzMidrpUUluDpVYVZx+xT4PCM5Kx”

All the settings are in the binding sourcecode if you want to copy them. You could also try using the Chamberlain MyQ Phone app(the API I am simulating) if your gateway works with the app it should work with the binding. If you figure anything else out please let me know. I will keep searching and see if any other projects have this problem too(none I found so far)

Thanks,
Scott

I’m getting the same error. I’ve tried removing the Chamberlain Binding in the PaperUI, and adding the .jar file mentioned above into the openhab/addons dir and it didn’t seem to do anything. I then tried (with the .jar still in the addons dir) installing the Chamberlain Binding and get the error again. I’m kinda new to openhab and trying to get my doors working, but could be doing something wrong too…

any advice would be greatly appreciated!

This is the error.
2017-03-31 19:04:15.500 [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:242)[198:org.openhab.binding.myq:1.9.0]
at org.openhab.binding.myq.internal.MyqData.login(MyqData.java:133)[198:org.openhab.binding.myq:1.9.0]
at org.openhab.binding.myq.internal.MyqData.getSecurityToken(MyqData.java:173)[198:org.openhab.binding.myq:1.9.0]
at org.openhab.binding.myq.internal.MyqData.getMyqData(MyqData.java:118)[198:org.openhab.binding.myq:1.9.0]
at org.openhab.binding.myq.internal.MyqBinding.poll(MyqBinding.java:205)[198:org.openhab.binding.myq:1.9.0]
at org.openhab.binding.myq.internal.MyqBinding.access$0(MyqBinding.java:197)[198:org.openhab.binding.myq:1.9.0]
at org.openhab.binding.myq.internal.MyqBinding$1.run(MyqBinding.java:402)[198:org.openhab.binding.myq:1.9.0]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)[:1.8.0_112]
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)[:1.8.0_112]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)[:1.8.0_112]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)[:1.8.0_112]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[:1.8.0_112]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[:1.8.0_112]
at java.lang.Thread.run(Thread.java:745)[:1.8.0_112]
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@d9ef585; line: 1, column: 2]
at org.codehaus.jackson.JsonParser._constructError(JsonParser.java:1432)[190:org.openhab.core.compat1x:2.0.0]
at org.codehaus.jackson.impl.JsonParserMinimalBase._reportError(JsonParserMinimalBase.java:385)[190:org.openhab.core.compat1x:2.0.0]
at org.codehaus.jackson.impl.JsonParserMinimalBase._reportUnexpectedChar(JsonParserMinimalBase.java:306)[190:org.openhab.core.compat1x:2.0.0]
at org.codehaus.jackson.impl.ReaderBasedParser._handleUnexpectedValue(ReaderBasedParser.java:1192)[190:org.openhab.core.compat1x:2.0.0]
at org.codehaus.jackson.impl.ReaderBasedParser.nextToken(ReaderBasedParser.java:479)[190:org.openhab.core.compat1x:2.0.0]
at org.codehaus.jackson.map.ObjectMapper._initForReading(ObjectMapper.java:2761)[190:org.openhab.core.compat1x:2.0.0]
at org.codehaus.jackson.map.ObjectMapper._readMapAndClose(ObjectMapper.java:2709)[190:org.openhab.core.compat1x:2.0.0]
at org.codehaus.jackson.map.ObjectMapper.readTree(ObjectMapper.java:1533)[190:org.openhab.core.compat1x:2.0.0]
at org.openhab.binding.myq.internal.MyqData.request(MyqData.java:213)[198:org.openhab.binding.myq:1.9.0]
… 13 more

Looks like you have binding 1.9 instead of 1.10, I think the link to 1.10
is in a post above.

I just installed OpenHab2 on Raspbian Jessie via apt-get. I originally installed the Chamberlain MyQ Binding v 1.9. via PaperUI. At that point, I got the “Could not connect to MyQ service java.io.IOException: Could not parse response”, so I followed the instructions in this post

I’m now getting the following error in /var/log/openhab2/openhab.log:

2017-03-31 21:48:00.561 [ERROR] [org.openhab.binding.myq ] - FrameworkEvent ERROR - org.openhab.binding.myq
org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.myq [195]
Unresolved requirement: Import-Package: org.openhab.core.binding

at org.eclipse.osgi.container.Module.start(Module.java:434)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1582)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1562)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1533)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1476)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]

did you make sure you removed the 1.9 binding through the PaperUI first?

You should uninstall the binding through the PaperUI. Don’t know if its necessary but I always stop the openhab service before adding addon manually. Some of the openhab 1 binding were written to only load config setting on startup and will not reload config changes on the fly. I pretty sure the MyQ binding doesn’t have this issue but I always stop and restart the openhab service just in case. If you are running openhab2 on a rasberrypi you have to SSH into it. Then run the commands in the post 150 above. After you install a binding manually do not try to install it with the PaperUI. When a new version of openhab2 comes out (2.1 or 2.0.1) this bug should be fixed and you will be able to install the binding from the PaperUI again.

Yes, I did uninstall the 1.9 version via PaperUI. Also with service stops/restarts for configuration changes. I’ve done all of my work logged in via ssh. Additionally, for what it’s worth, the module resolving error goes away if I completely delete the 1.10 version (with a stop before and restart after deleting). I’m just getting started with OpenHab2, so I won’t lose anything significant by completely wiping the installation and config files and restarting fresh.

My primary openhab2 install is on a ubuntu server but when I am having issues, I recommend just running a clean install on Windows 7(since most ppl use windows normally) then try to setup the binding manually. In post 170 I tried explaining how to test the web calls manually. If you need any help please let me know.

@scooter_seh I finally got around to playing with Postman tonight like you suggested. I realized that my password has a double quote in it. If I added a \ before the double quote in Postman, the call would work, but fail otherwise. Maybe your new code isn’t escaping double quotes, but the old code did? I ending up changing my password to a single quote and all is well! Thank you for your tip and for all of your work on this addon!

I did remove the code to URL Encoding for the username and password. I assumed because it is now in a JSON Post it was not needed but maybe it is still necessary. I will experiment with it some more and see if I can fix it. Thanks for the help in finding the issue.

Any timeline for when install through paperui will be functional?

Thanks!

@scooter_seh I hope you can help me here. I have been trying to get this working with my liftmaster, and I have an issue I haven’t seen here. When using the 1.9 Jar file, I get the error we all know. But If I take that out of the addons folder, and place the new one (yours), I am able to access the garage opener controls locally, but I do not see anything saying that I connected to my openHab account. It shows me offline on myopenhab. Any thoughts?

I used this bundle, but replaced the addon jar with yours.

Launching the openHAB runtime…
osgi> 2017-05-11 22:19:32.976 [INFO ] [.o.core.internal.CoreActivator] - openHAB runtime has been started (v1.8.3).
2017-05-11 22:19:36.446 [INFO ] [o.o.i.s.i.DiscoveryServiceImpl] - mDNS service has been started
2017-05-11 22:19:36.507 [INFO ] [o.o.i.s.i.DiscoveryServiceImpl] - Service Discovery initialization completed.
2017-05-11 22:19:39.070 [INFO ] [penhab.io.rest.RESTApplication] - Started REST API at /rest
2017-05-11 22:19:45.289 [INFO ] [c.internal.ModelRepositoryImpl] - Loading model 'default.sitemap’
2017-05-11 22:19:45.650 [INFO ] [c.internal.ModelRepositoryImpl] - Loading model 'myopenhab.persist’
2017-05-11 22:19:45.691 [INFO ] [c.internal.ModelRepositoryImpl] - Loading model 'default.items’
2017-05-11 22:19:46.680 [INFO ] [.o.u.w.i.servlet.WebAppServlet] - Started Classic UI at /classicui/openhab.app
2017-05-11 22:19:52.760 [INFO ] [runtime.busevents ] - GarageDoorString state updated to Closed
2017-05-11 22:19:52.763 [INFO ] [runtime.busevents ] - GarageDoorOnline state updated to True
2017-05-11 22:19:52.765 [INFO ] [runtime.busevents ] - GarageDoorSerialNumber state updated to ********
2017-05-11 22:19:52.768 [INFO ] [runtime.busevents ] - GarageDoorShutter state updated to DOWN
2017-05-11 22:19:52.769 [INFO ] [runtime.busevents ] - GarageDoorSwitch state updated to OFF
2017-05-11 22:19:52.770 [INFO ] [runtime.busevents ] - GarageDoorDeviceType state updated to GarageDoorOpener
2017-05-11 22:19:52.772 [INFO ] [runtime.busevents ] - GarageDoorDesc state updated to Garage Door
2017-05-11 22:19:52.773 [INFO ] [runtime.busevents ] - GarageDoorContact state updated to CLOSED
2017-05-11 22:19:52.774 [INFO ] [runtime.busevents ] - GarageDoorDeviceId state updated to *******
2017-05-11 22:19:55.813 [INFO ] [c.internal.ModelRepositoryImpl] - Loading model 'default.rules’
2017-05-11 22:19:56.156 [ERROR] [i.t.TTSServiceSpeechDispatcher] - Output device not configured [null]

I think your issues is related to myopenhab binding not the chamberlain MyQ binding. I would make sure you have the newest “myopenhab” binding in your addons folder. Also check you UUID and Secret ID’s for myopehhab. The binding also requires Java 1.8.0_101 for the it to work properly. This wiki has all the instructions of openHAB 1.8. Latest binding can be downloaded from here. Kai has an forum post will a lot more information if needed, See below:

As stated before this fix will not be included in the Paper UI until the next release(2.0.1 or 2.1.0). Rumor is a new release will be out sometime this summer.

I’m new to raspberrypi and openhab and linux. I understand that the PaperUI version of Myq doesn’t work. I went through the steps to download the latest jar file to the /usr/share/openhab2/addons folder, restarted openhab, but the bindings don’t show up in paperUI - maybe they’re not supposed to? But then how do I know if it worked? In /etc/openhab2/services/ there is a myq.cfg file with username/password filled out; I can usually figure this stuff out, but sort of stuck. ty for any help.