Chamberlain MyQ Binding

I will for sure, I need to spend some time reworking the code into a better structure.

Anybody else having trouble with the MyQ binding lately?
My control of the garage doors suddenly stopped working (today or yesterday) after working perfect for several weeks.

In the log the following error appears:

2020-05-05 19:28:47.018 [ERROR] [handler.ChamberlainMyQGatewayHandler] - Could not parse response

com.google.gson.JsonSyntaxException: com.google.gson.stream.MalformedJsonException: Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 29 path $

	at com.google.gson.JsonParser.parse(JsonParser.java:65) ~[?:?]

	at com.google.gson.JsonParser.parse(JsonParser.java:45) ~[?:?]

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

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

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

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

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

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

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

	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) [?: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: com.google.gson.stream.MalformedJsonException: Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 29 path $

	at com.google.gson.stream.JsonReader.syntaxError(JsonReader.java:1568) ~[?:?]

	at com.google.gson.stream.JsonReader.checkLenient(JsonReader.java:1409) ~[?:?]

	at com.google.gson.stream.JsonReader.doPeek(JsonReader.java:542) ~[?:?]

	at com.google.gson.stream.JsonReader.peek(JsonReader.java:425) ~[?:?]

	at com.google.gson.JsonParser.parse(JsonParser.java:60) ~[?:?]

	... 12 more

2020-05-05 19:28:47.035 [ERROR] [handler.ChamberlainMyQGatewayHandler] - An exception occurred while executing a request to the Gateway: 'null'

im having the same issue. I restarted the binding and this didn’t fix it. For me it started at some point today.

Same issue here.

2020-05-05 14:31:01.609 [ERROR] [handler.ChamberlainMyQGatewayHandler] - Could not parse response
com.google.gson.JsonSyntaxException: com.google.gson.stream.MalformedJsonException: Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 29 path $
at com.google.gson.JsonParser.parse(JsonParser.java:65) ~[?:?]
at com.google.gson.JsonParser.parse(JsonParser.java:45) ~[?:?]
at org.openhab.binding.chamberlainmyq.handler.ChamberlainMyQGatewayHandler.request(ChamberlainMyQGatewayHandler.java:433) ~[?:?]
at org.openhab.binding.chamberlainmyq.handler.ChamberlainMyQGatewayHandler.getMyqData(ChamberlainMyQGatewayHandler.java:251) ~[?:?]
at org.openhab.binding.chamberlainmyq.handler.ChamberlainMyQGatewayHandler.refreshDeviceState(ChamberlainMyQGatewayHandler.java:331) ~[?:?]
at org.openhab.binding.chamberlainmyq.handler.ChamberlainMyQGatewayHandler.lambda$0(ChamberlainMyQGatewayHandler.java:321) ~[?:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_252]
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) [?:1.8.0_252]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) [?:1.8.0_252]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) [?:1.8.0_252]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_252]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_252]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_252]
Caused by: com.google.gson.stream.MalformedJsonException: Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 29 path $
at com.google.gson.stream.JsonReader.syntaxError(JsonReader.java:1568) ~[?:?]
at com.google.gson.stream.JsonReader.checkLenient(JsonReader.java:1409) ~[?:?]
at com.google.gson.stream.JsonReader.doPeek(JsonReader.java:542) ~[?:?]
at com.google.gson.stream.JsonReader.peek(JsonReader.java:425) ~[?:?]
at com.google.gson.JsonParser.parse(JsonParser.java:60) ~[?:?]
... 12 more

Can confirm. A little more info via log:set TRACE org.openhab.binding.chamberlainmyq:

2020-05-06 17:48:23.865 [TRACE] [handler.ChamberlainMyQGatewayHandler] - refreshDeviceState
2020-05-06 17:48:23.865 [DEBUG] [handler.ChamberlainMyQGatewayHandler] - Retrieving door data
2020-05-06 17:48:23.865 [TRACE] [handler.ChamberlainMyQGatewayHandler] - BrandId: 2
2020-05-06 17:48:23.866 [TRACE] [handler.ChamberlainMyQGatewayHandler] - SecurityToken: <redacted>
2020-05-06 17:48:23.866 [TRACE] [handler.ChamberlainMyQGatewayHandler] - MyQApplicationId: JVM/<redacted>
2020-05-06 17:48:23.866 [TRACE] [handler.ChamberlainMyQGatewayHandler] - Requesting method GET
2020-05-06 17:48:23.866 [TRACE] [handler.ChamberlainMyQGatewayHandler] - Requesting URL https://api.myqdevice.com/api/v5/Accounts/<redacted>/Devices
2020-05-06 17:48:23.866 [TRACE] [handler.ChamberlainMyQGatewayHandler] - Requesting payload null
2020-05-06 17:48:23.866 [TRACE] [handler.ChamberlainMyQGatewayHandler] - Requesting payloadType null
2020-05-06 17:48:23.867 [TRACE] [ing.chamberlainmyq.internal.HttpUtil] - About to execute https://api.myqdevice.com/api/v5/Accounts/<redacted>/Devices
2020-05-06 17:48:25.471 [TRACE] [ing.chamberlainmyq.internal.HttpUtil] - Http Response <html><head><title>Request Rejected</title></head><body>The requested URL was rejected. Please consult with your administrator.<br><br>Your support ID is: <redacted><br><br><a href='javascript:history.back();'>[Go Back]</a></body></html>.
2020-05-06 17:48:25.472 [TRACE] [handler.ChamberlainMyQGatewayHandler] - Received MyQ JSON: <html><head><title>Request Rejected</title></head><body>The requested URL was rejected. Please consult with your administrator.<br><br>Your support ID is: <redacted><br><br><a href='javascript:history.back();'>[Go Back]</a></body></html>
2020-05-06 17:48:25.472 [ERROR] [handler.ChamberlainMyQGatewayHandler] - Could not parse response
com.google.gson.JsonSyntaxException: com.google.gson.stream.MalformedJsonException: Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 29 path $
	at com.google.gson.JsonParser.parse(JsonParser.java:65) ~[?:?]
	at com.google.gson.JsonParser.parse(JsonParser.java:45) ~[?:?]
	at org.openhab.binding.chamberlainmyq.handler.ChamberlainMyQGatewayHandler.request(ChamberlainMyQGatewayHandler.java:433) ~[?:?]
	at org.openhab.binding.chamberlainmyq.handler.ChamberlainMyQGatewayHandler.getMyqData(ChamberlainMyQGatewayHandler.java:251) ~[?:?]
	at org.openhab.binding.chamberlainmyq.handler.ChamberlainMyQGatewayHandler.refreshDeviceState(ChamberlainMyQGatewayHandler.java:331) ~[?:?]
	at org.openhab.binding.chamberlainmyq.handler.ChamberlainMyQGatewayHandler.lambda$0(ChamberlainMyQGatewayHandler.java:321) ~[?:?]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_242]
	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) [?:1.8.0_242]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) [?:1.8.0_242]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) [?:1.8.0_242]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_242]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_242]
	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_242]
Caused by: com.google.gson.stream.MalformedJsonException: Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 29 path $
	at com.google.gson.stream.JsonReader.syntaxError(JsonReader.java:1568) ~[?:?]
	at com.google.gson.stream.JsonReader.checkLenient(JsonReader.java:1409) ~[?:?]
	at com.google.gson.stream.JsonReader.doPeek(JsonReader.java:542) ~[?:?]
	at com.google.gson.stream.JsonReader.peek(JsonReader.java:425) ~[?:?]
	at com.google.gson.JsonParser.parse(JsonParser.java:60) ~[?:?]
	... 12 more

The same issue was confirmed in Home Assistant issue 35257 and fixed in PyMyQ PR #35.

I made a new version of the binding to fix the v5/v5.1 API issue people are seeing. You have to open the Karaf console and run the ‘bundle:uninstall’ command on the old binding first. If you run into any issues please let me know.

Thanks,
Scott

8 Likes

EDIT: read my post below, answered my own question.

Thanks for the quick fix.

I am used to just deleting the binding file from my addons folder and putting the new version in. Are you saying we need to run that command in addition to this?

Scott,

Thanks for the post. Unfortunately, after dropping in the new version, I am now getting the following error. Thanks for the help!

2020-05-06 11:25:55.441 [ERROR] [org.openhab.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:314) ~[bundleFile:?]
at org.openhab.binding.myq.internal.MyqData.getMyqData(MyqData.java:145) ~[bundleFile:?]
at org.openhab.binding.myq.internal.MyqBinding.poll(MyqBinding.java:205) [bundleFile:?]
at org.openhab.binding.myq.internal.MyqBinding.access$0(MyqBinding.java:197) [bundleFile:?]
at org.openhab.binding.myq.internal.MyqBinding$1.run(MyqBinding.java:388) [bundleFile:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:1.8.0_251]
at java.util.concurrent.FutureTask.runAndReset(Unknown Source) [?:1.8.0_251]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(Unknown Source) [?:1.8.0_251]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source) [?:1.8.0_251]
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:1.8.0_251]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:1.8.0_251]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_251]
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@dcfd81d; line: 1, column: 2]
at org.codehaus.jackson.JsonParser._constructError(JsonParser.java:1432) ~[bundleFile:1.9.2]
at org.codehaus.jackson.impl.JsonParserMinimalBase._reportError(JsonParserMinimalBase.java:385) ~[bundleFile:1.9.2]
at org.codehaus.jackson.impl.JsonParserMinimalBase._reportUnexpectedChar(JsonParserMinimalBase.java:306) ~[bundleFile:1.9.2]
at org.codehaus.jackson.impl.ReaderBasedParser._handleUnexpectedValue(ReaderBasedParser.java:1192) ~[bundleFile:1.9.2]
at org.codehaus.jackson.impl.ReaderBasedParser.nextToken(ReaderBasedParser.java:479) ~[bundleFile:1.9.2]
at org.codehaus.jackson.map.ObjectMapper._initForReading(ObjectMapper.java:2761) ~[bundleFile:1.9.2]
at org.codehaus.jackson.map.ObjectMapper._readMapAndClose(ObjectMapper.java:2709) ~[bundleFile:1.9.2]
at org.codehaus.jackson.map.ObjectMapper.readTree(ObjectMapper.java:1533) ~[bundleFile:1.9.2]
at org.openhab.binding.myq.internal.MyqData.request(MyqData.java:280) ~[bundleFile:?]
… 11 more

For what its worth, I ran the below command, then removed the file from my addons folder, then added the new one and mine worked fine.

bundle:uninstall org.openhab.binding.chamberlainmyq

All good here . . .

2020-05-06 10:29:26.717 [INFO ] [ainmyq.handler.ChamberlainMyQHandler] - Initializing a MyQ device:
Device Serial: ABC123
Device Type: virtualgaragedooropener
Device Family: garagedoor

Name: Garage Door
State: closed
Online: true

1 Like

I’ve updated the addon. the error in the log went away. MyQ Gateway was still showing an error in PaperUI so i force removed all the Things+Items through PaperUI and re-added them. MyQ Gateway now showing UnInitialized - Handler_Initializing_Error. Nothing showing in the logs. Please advise. Thanks!

btw i did run bundle:uninstall from the openhab-cli. I’ve also ran clean-cache and restarted OH2 services.

Worked like a charm as per your directions. Tested and myq hub and garage doors are back up and running fine, openhab logfile is clean. No changes required to any of the existing things/items I had setup in paper-UI, and if it helps I didn’t clear the cache either.

Thx much for all your work on this!

Hello,

I’m currently on 1.14.0. What’S the difference with 2.5?

I removed the 1.14 using the bundle:uninstall and removed the jar file from addons. I restarted, added the jar file for 2.5.0 in addons folder and I’m now getting this error:
2020-05-06 17:45:56.749 [WARN ] [org.apache.felix.fileinstall ] - Error while starting bundle: file:/opt/openhab2/addons/org.openhab.binding.chamberlainmyq-2.5.0-SNAPSHOT.jar
org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.chamberlainmyq [285]
Unresolved requirement: Import-Package: com.google.gson; version="[2.8.0,3.0.0)"
at org.eclipse.osgi.container.Module.start(Module.java:444) ~[?:?]
at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:383) ~[?:?]
at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundle(DirectoryWatcher.java:1260) [10:org.apache.felix.fileinstall:3.6.4]
at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(DirectoryWatcher.java:1233) [10:org.apache.felix.fileinstall:3.6.4]
at org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:520) [10:org.apache.felix.fileinstall:3.6.4]
at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:365) [10:org.apache.felix.fileinstall:3.6.4]
at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:316) [10:org.apache.felix.fileinstall:3.6.4]

I’m on openhab 2.4.0

That may be your issue. I can’t tell for sure though. Have you considered upgrading to 2.5 now that it’s been fully released?

Yeah that was the issue. But between 2.4 and 2.5, a lot of changed it seems. All my sitemap are screwed, my DC’s binding doesn’t work, neither does ecobee. Ecobee has a v2 superseding v1 that I was using, but in 2.5.4. So I updated to 2.5.4. There’s a lot I must redo to get 2.5.4. to work like my older 2.4.0. I don’t get why everything break like that between version. I never had an upgrade without trouble with openhab.

So for now, I’m back on 2.4.0 to get everything working except my garage door (using myq app or Google in the meantime). I’ll have to redo everything in 2.5.4.

I just noticed mine wasn’t working and the new .jar fixed it without a reboot. Thanks for providing the fix so quickly!

My only thought would be to increment the version number in some way so we know what’s what when we install or check. Granted the bundle:list shows the date code I think (mine shows 2.5.0.202005061425 now).

Can never thank you enough for maintaining this.
Chamberlain is such a pain in the butt with their surprises.

4 Likes

Also have to drop in a thank you for this. I swapped the jar and life was good again.

So how would you set this up from scratch?

1 Like