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

  • Issue of the topic:
    I can only get 5 to 6 items seen by google the number that works seems to change but 5 always works. If I add any more items that contain tags, the command “Sync my devices” fails with “something went wrong. Try again”. Removing and re-adding the openhab link from the google home also breaks with the extra items. Now here is the weird part, I can choose any 5 of my items and they work proving that the item file is not at fault, it is only when I combine too many at a time that it breaks and each line works by itself.

What does work?
If I expose an item and when the switch is moved it shows up in the event log list at myopenhab.org so this works fine as does notifications. This proves the secret and uuid are correct. I have updated and checked these so many times and it shows up as ONLINE.

What is broken?
Everything is working except If I click to open the Dashboard from inside the myopenhab.org account I get this error.

504 Gateway Time-out
nginx/1.10.0 (Ubuntu)

When I try and add Openhab as a device in “Home Control” I get the message it is linked after the oauth2 page, but then after closing, the spinning coloured wheel goes for a while and I get this message on iPhone.

Something went wrong: Try again.

Under andriod I get a timeout/no reply message at the same point in the linking process.

  • Platform information:

    • Hardware: PI 2
    • OS: Openhabian 1.41 image a few hours old on a brand new SD card, then fully updated using openhabian-config.
    • Java Runtime Environment: Default fresh Openhabian.
      openjdk version “1.8.0_152”
      OpenJDK Runtime Environment (Zulu Embedded 8.25.0.76-linux-aarch32hf) (build 1.8.0_152-b76)
      OpenJDK Client VM (Zulu Embedded 8.25.0.76-linux-aarch32hf) (build 25.152-b76, mixed mode, Evaluation)
  • openHAB version: Tried 2.3 stable then went to openHAB 2.4.0 (Build #1313)

openhab-cli info

Version:     2.3.0 (Build)
User:        openhab (Active Process 440)
User Groups: openhab tty dialout audio bluetooth gpio
Directories: Folder Name      | Path                        | User:Group
             -----------      | ----                        | ----------
             OPENHAB_HOME     | /usr/share/openhab2         | openhab:openhab
             OPENHAB_RUNTIME  | /usr/share/openhab2/runtime | openhab:openhab
             OPENHAB_USERDATA | /var/lib/openhab2           | openhab:openhabian
             OPENHAB_CONF     | /etc/openhab2               | openhab:openhabian
             OPENHAB_LOGDIR   | /var/log/openhab2           | openhab:openhabian

URLs:        http://192.168.1.100:8080
             https://192.168.1.100:8443

Add a label after dimming by adding “dimming”.

This is my post with a similar issue. I swore I posted a solution. I will post tomorrow from my lapto p.

What i found is that even though an label is not required in the item it is required to use Google home. In addition Google will not connect if the label is missing. Th e only service that works with no label is ifttt.

Let t me know if label works.

Thanks for the reply, but no that has not changed anything by adding a label. I still can not get Google Home to link and show the devices, nor can I open the control panel via myopenhab.org
Any other ideas on what you changed?

Please post your items file.

Also, does myopenhab show that your openha b instance connected and is online?

The entire contents is this single line.

Switch Dimming "Dimmer" [ "lighting" ] 

Yes it shows as online when I log into myopenhab, plus my local openhab logs show it connected despite the wrong base url showing as explained in my first post. If I expose the item, I can get “myopenhab event logs” occuring to show it is working when the switch is moved but I can not get any reply back when I click on this link…

You are using openHAB 2.x. Click here to access your openHAB's dashboard

I click, it take 30+ seconds of thinking and then fails with this message in the browser…

504 Gateway Time-out
nginx/1.10.0 (Ubuntu)

I have been checking the servers are online with this link.
https://www.appbeat.io/status/openHAB

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