SOLVED: Openhab Cloud Connector and Google Home will not 'sync my devices' with more than 5 tags

I believe Lighting, need a capital L. Try that to see. May just be a typo.

I don’t have any ideas currently as to why the sitemap won’t function.

Yes I have tried upper and lower case for lighting and switchable tags and it is broken the same way even if I remove the tag completely. Until I can get the myopenhab to open up to the dashboard it has nothing to do with the tag as the dashboard should work for remote access with no tags. Any other ideas or how to fault find this would be great as the logs even in debug are not displaying any more useful clues on where to start looking.

I am about to wipe and try simple and not expert mode when setting up openhabian to see if that has a different result.

I just found something interesting. I am in the process of moving from a RPi 2 to an Rpi3+. For some reason some things were not working correct with openhabcloud.

I realized my timezone was not correct. I fixed it and rebooted and instantly the cloud connector showed correct. execute ‘cat /etc/timezone’ or run openhabian-config and check in there. the config tool can be used to fix it.

Sadly that did not fix it either. Is there any way to get more information in the logs?
I tried this in the console and had zero effect on getting any more useful information to use as leads on what to try next.

log:set TRACE org.openhab.io.openhabcloud

@Thedannymullen
A big THANK YOU as I now have google home working again, the remote access side of Openhab Cloud connector is still broken but I don’t care so much about that.

The keys to getting it to work were…

  1. Use a label for all items with a tag in the item file. If you leave out the label you get an error that breaks everything and nothing will sync and you can not get GH to add openhab if setting up a new connection.
  2. You must use Upper case for the tag. If you use lower case it does not cause an error, but the device does not get added when you sync.
  3. I had to reinstall and select STANDARD and not EXPERT like I usually do. I have noticed that a new cfg file is possibly used in Openhab Ver 2.3 and possibly there is an issue between old and new config files. Not sure but I did try the first two with expert and it did not work until I used a standard install.

Glad I could help! I had many of the same struggles.

Fyi I have submitted issues in the Google connector github. This issue really needs addressing as many people have fun across it.

@Thedannymullen
Thanks for reporting it. I have now run into another bug which hopefully you know of it and can suggest what I am doing wrong or a known work around.

The reason I call it a bug is because I can tag only up to 5 items. The 6th tag always break the command “sync my devices”. I have tried any random 5 items and they always work, but add a 6th and everything breaks with the following error…

2018-07-15 20:03:20.534 [INFO ] [io.openhabcloud.internal.CloudClient] - Connected to the openHAB Cloud service (UUID = xxxx, base URL = http://localhost:8080)

2018-07-15 20:06:30.486 [ERROR] [io.openhabcloud.internal.CloudClient] - Socket.IO error: {}

io.socket.engineio.client.EngineIOException: websocket error

	at io.socket.engineio.client.Transport.onError(Transport.java:71) [192:org.openhab.io.openhabcloud:2.3.0]

	at io.socket.engineio.client.transports.WebSocket.access$500(WebSocket.java:28) [192:org.openhab.io.openhabcloud:2.3.0]

	at io.socket.engineio.client.transports.WebSocket$2$5.run(WebSocket.java:150) [192:org.openhab.io.openhabcloud:2.3.0]

	at io.socket.thread.EventThread$2.run(EventThread.java:80) [192:org.openhab.io.openhabcloud:2.3.0]

	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: java.io.EOFException

	at okio.RealBufferedSource.require(RealBufferedSource.java:59) ~[?:?]

	at okio.RealBufferedSource.readByte(RealBufferedSource.java:72) ~[?:?]

	at okhttp3.internal.ws.WebSocketReader.readHeader(WebSocketReader.java:115) ~[?:?]

	at okhttp3.internal.ws.WebSocketReader.processNextFrame(WebSocketReader.java:104) ~[?:?]

	at okhttp3.internal.ws.RealWebSocket.readMessage(RealWebSocket.java:97) ~[?:?]

	at okhttp3.ws.WebSocketCall.createWebSocket(WebSocketCall.java:152) ~[?:?]

	at okhttp3.ws.WebSocketCall.access$000(WebSocketCall.java:41) ~[?:?]

	at okhttp3.ws.WebSocketCall$1.onResponse(WebSocketCall.java:97) ~[?:?]

	at okhttp3.RealCall$AsyncCall.execute(RealCall.java:126) ~[?:?]

	at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32) ~[?:?]

	... 3 more

2018-07-15 20:06:30.573 [INFO ] [io.openhabcloud.internal.CloudClient] - Disconnected from the openHAB Cloud service (UUID = xxxx, base URL = http://localhost:8080)

2018-07-15 20:06:33.966 [INFO ] [io.openhabcloud.internal.CloudClient] - Connected to the openHAB Cloud service (UUID = xxxx, base URL = http://localhost:8080)

And the items are listed below, I use a double slash to disable/comment the line, so all lines work individually just any 6 of them break my setup.

//Switch BabyMonitor "Baby monitor" ["Switchable"]
Switch TVDimming "TV dimming" ["Switchable"]
Color MilightID1G2Hue "First linen hall" ["Lighting"] {channel="espmilighthub:rgb_cct:001:0x12:colour"}
Color MilightID1G3Hue "Second linen hall" ["Lighting"] {channel="espmilighthub:rgb_cct:001:0x13:colour"}
Color MilightID2G1Hue "First bathroom mirror" ["Lighting"] {channel="espmilighthub:rgb_cct:001:0x21:colour"}
Color MilightID2G2Hue "Second bathroom mirror" ["Lighting"] {channel="espmilighthub:rgb_cct:001:0x22:colour"}
//Color MilightID2G3Hue "Third bathroom mirror" ["Lighting"] {channel="espmilighthub:rgb_cct:001:0x23:colour"}
//Color MilightID2G4Hue "Forth bathroom mirror" ["Lighting"] {channel="espmilighthub:rgb_cct:001:0x24:colour"}
//Color MilightID3G1Hue "Second bedroom hall" ["Lighting"] {channel="espmilighthub:rgb_cct:001:0x31:colour"}

Sorry at a loss on that one. Only thing I know for sure is that there are some issues with the cloud connector. It seems we newer folks are the ones that find them!

I have an issue right now with items also. They only seem to show in my openHAB if explicitly declares in the services dir as items to expose. However google and amazon see them! So it seems there are many over looked issues that people just accept!

I will have to try to expose six items to google I think I have only 5 so far.

@matt1 no issues here. I synced 10 devices to alexa and google with no issue.

Have you fixed your problem?

No I still can not get more than 5 working at a time, and I also can not use the myopenhab for remote control of the UI panels, the other features of myopenhab are working fine. I did find someone saying a similar thing in a forum post that was using Alexa and they fixed it by changing from a pi2 to the latest PI3. You posted above in this thread you had a similar experience of a PI3 fixing issues so looks like I will be upgrading the hardware if I can not find a software fix over the next few days. I still have no clue in which direction to look first eg

  • Openhabian not configuring for a PI2 correctly
  • Cloud connector bug
  • Some stupid thing I missed or am doing wrong which is missing from all documentation.

i know exactly how you feel on the some little thing. I have had several of these problems and it all stemmed from something as simple as a typo that appears to pass syntax checks.

In addition, I have also found your second conclusion on documentation to be true also.

Keep me posted if you find anything. I don’t remember any thing of mine being fixed going to a pi 3. I moved just because I had one. I do suggest it though since moving i noticed its faster! Mainly on reboot and restart!
But I think having two running openhab is nice. It allows for some debug offline so you don’t break things. I

Best of luck! Feel free to message me directly.

I’ll post my findings here as I have started looking into the source code of “org.openhab.io.openhabcloud” and compiled a few log changes in to help track the remaining problems down…

I found where my system hangs in the code by comparing when it works, to when it does not, and what do you know I found this comment right where the code hangs for 30-60 seconds. Only on my system the code which is the “fix” does not run as it looks like a deadlock stops the flow just before it can run…

/**
             * What is this? In some cases where latency is very low the myopenhab service
             * can receive responseFinished before the headers or content are received and I
             * cannot find another workaround to prevent it.
             */

So I ran a ping to www.myopenhab.org and I get an average of 18ms ping to the server. Wish I had a VPN to increase my ping with for testing. Does anyone know of a quick way to increase your ping?

I also found a handy link to help fault find issues. The binding uses this address to GET your items from. This link MUST work and return your items. If it does not you will need to fault find why…
http://openHABianPi:8080/rest/items/
Alas this works for me.

However this link fails to work.
https://myopenhab.org/rest/items

1 Like

Great! The cloud connector could definitely use a little touch up.

Actually, I have gone over it with a fine tooth comb and I can only find 1 tiny little thing I would change unless throwing out the socket.io library but that is just me liking Netty. I would however put far better logging in it for fault finding and warnings for when people use the wrong TAG format etc.

@matt1 as requested dropping into this thread from the other thread Strange error when updating an item file (hey how do you link the thread like you did?).

The format I posted for the item came from running a query using the PaperUI Rest API Documentation Add-on. My real format for the url http://openhabianpi:8080/rest/items/Kitchen_PantryLights was a line like:

{"link":"http://openhabianpi:8080/rest/items/Kitchen_PantryLights","state":"ON","editable":false,"type":"Switch","name":"Kitchen_PantryLights","label":"Pantry Lights","category":"light","tags":["Lighting"],"groupNames":["gDevices","gRoom_Kitchen"]}

You can install the REST API Documentation in PaperUI in Add-Ons - MISC - REST Documentation - then open this from the Dashboard and you navigate to the right spot and run the query which simply gives you the formatted response.

I should also point out that currently I have only 1 tagged device in my OH setup as my other 50 or so are still sitting on my Vera and using the Vera - Alexa bridge that I am trying to get away from. I will be bringing more across shortly now that I have it working.

1 Like

That is automatic by the forum, just post a raw link without putting it inside link code formatting and it occurs.
Thanks for posting the raw output as it shows that mine is the same.

Great let me know either way if it works or does not work when you move more than 10 across.

1 Like

OK I finally appear to have found my issue. Drull roll… After 80+ hours of looking it was changing my MTU and MRU from the default 1492 in my router to the value of 1440.
I found this out because I had a very weird problem with Netflix not working and it was giving a NW-2-5 error which only happened on 1 device, when netflix worked on all other devices on the same network. I found some SONOS users with the same fix.

To diagnose if this is your issue you can do a ping with a set packet size and see if you get fragmentation and 100% loss…

windows command

ping myopenhab.org -f -l 1500

Linux command

 ping -s 1500 -M do myopenhab.org

See this link for more info on how to test and set the optimal size…
https://kb.netgear.com/19863/Ping-Test-to-determine-Optimal-MTU-Size-on-Router

Glad you figured it out.

Sadly I still have not figured it out fully and I am back to where I was before I got hit by the MTU issue. Currently it will not allow me to “sync my devices” as that fails to work. But if I remove the device link from the google app and re link the accounts, it will then find and work with any changes I have made. This proves it is not my items file. I have seen a number of people complain of this same behaviour and they appear to ignore it due to a workaround being in place and that is becoming my stance as I have wasted enough time on this now. I can now also use the remote UI panels from the myopenhab.org website since changing the MTU size on my router so the only thing left broken is the ability to “sync my devices”.

An update on this is that after updating to Openhab 2.4.0 Stable I can now use the “sync my devices” command to find new devices. Looks like everything is now work great.