[RELEASE] HubConnect - Share Devices across Multiple Hubs (no longer SmartThings!)

@csteele Awesome. Thank you for doing that. I will test out those instructions.

Hi all.
I'm getting a new C7 hub ( :grinning: ) to replace my existing C3 hub.
My C3 hub has a HubConnect server instance installed with one client hub off of it.
When I get the new hub I'm going to load the C3 DB onto the C7.
Does anybody know if hubConnect will just 'work' or is there something that needs to be done.
Just thinking ahead here.
TIA.

Screen Shot 2020-07-24 at 9.03.15 AM @csteele pointed this out earlier in this thread
I think then it should just work.

Thanks for the reply. I'm thinking of using the same ip address as I need to keep it for other apps and devices.

1 Like

I would do the same if I was getting a shiny new hub :cry:

1 Like

I've got a folder full of DB backups for various uses, but specifically, yes, I've Soft Reset a pair of hubs, restored a Backup and had them link up without issue, many times.

To be clear, I'm Soft Resetting them individually, finishing one, before starting the 2nd. In most cases, the config I'm starting from has no HubConnect, then I soft reset and restore to a DB that has HubConnect. There's nothing for it to connect to... until I Soft Reset/Restore the 2nd hub with a HubConnect backup.

In fact, I did it yesterday...

Screen Shot 2020-07-27 at 2.23.05 PM

My Development pair.. both got soft reset (individually) and the backup I chose to use included HubConnect. This is their 'normal' config.. I soft reset to a no-hubconnect Backup to try various things, including reminding myself what "from scratch" installs look like. Then I Soft Reset/Restore back to 'normal'.

TMI ?

1 Like

Off topic but just curious.

Twice now I have seen WARNING on the apps page on my server hub beside the remote instance. The first time I turn on the debug logs and flipped back to the apps page and it said ONLINE.

Yesterday when it said WARNING again I clicked on the app and went back to the apps page and it was gone.

Something to worry about??

I am running 2.0 RC1

Edit: I am running small with only 34 server devices connected to the remote and 26 devices from the remote to the server.

It's a warning :smiley:
Telling you there's been a problem and if it continues, there will be trouble. :smiley:

There's a 'Health Heartbeat (ping)' between the pairs of hubs. When you lose a couple, you get a Warning, when you lose 5 you get an Offline.

It indicates a network problem at some layer. The two hubs aren't 100% successful at sending / receiving. If it comes and goes, as you describe, it implies there's a large consumer of resources in the path.. This Hub, That Hub, The Network. Something's running out of 'time.'

3 Likes

Brilliant. When I get my shiny knew hub this will save an awful lot of time.

I used to see this warning every day before ditching my Netgear X6S for a Lynksys Velop AX. My printer always works now as well, which I didn’t think was possible for printers to do :wink:

1 Like

Interesting. Thank you.

@csteele, would this be the spot to make a feature request?

Also, if anyone has suggestions around this, I’ll take them!!! :smiley:

I would like to have a way to identify when the state of a device that is linked from one hub to another is different on both hubs. As far as I know, the only way I could do this is to link a device to a hub, then link that HubConnect device back to the original hub and compare the two.... I’m thinking of testing this at some point soon...

I find that I occasionally need to refresh the connection or the sync the devices when that happens (It’s happen to me a couple of times already, not sure the root cause yet...). To make the fix to the issue automatic, I would like to make a rule in rule machine that does this - if device states don’t match (Ideally for more than a set duration), then first sync them, and if that doesn’t work re-initialize the connection and then sync again.

Hey @csteele, I'm getting this error relatively frequently:

errorjava.lang.IllegalArgumentException: null on line 355 (wsSendEvent)

The error is in logs of the server hub. It may be related to receiving events from one of the remote hubs (HE as well). The error is always in close proximity of having received an event from the remote hub, but it's sometimes as long as 5 seconds after an event or 5 seconds before an event, so I cannot say for sure that it is related to the event update.

A few examples:

[app:35]2020-08-01 12:51:43.332 [info]Received event from Harrier Road House - Main HE/Sensor - Ensuite: [motion, active null]
[app:35]2020-08-01 12:51:41.132 [error]java.lang.IllegalArgumentException: null on line 355 (wsSendEvent)
[app:35]2020-08-01 12:51:26.548 [trace]Received ping from Harrier Road House - Main HE.


[app:35]2020-08-01 12:47:22.010 [info]Received event from Harrier Road House - Main HE/Sensor - Bathroom: [illuminance, 47 Lux]
[app:35]2020-08-01 12:47:12.128 [error]java.lang.IllegalArgumentException: null on line 355 (wsSendEvent)
[app:35]2020-08-01 12:47:12.078 [info]Received event from Harrier Road House - Main HE/Sensor - Bathroom: [illuminance, 21 Lux]
[app:35]2020-08-01 12:47:11.721 [error]java.lang.IllegalArgumentException: null on line 355 (wsSendEvent)
[app:35]2020-08-01 12:47:06.956 [info]Received event from Harrier Road House - Main HE/Sensor - Bathroom: [illuminance, 0 Lux]

[app:35]2020-08-01 12:46:27.269 [trace]Received ping from Harrier Road House - Main HE.
[app:35]2020-08-01 12:46:23.426 [error]java.lang.IllegalArgumentException: null on line 355 (wsSendEvent)
[app:35]2020-08-01 12:46:19.149 [info]Received event from Harrier Road House - Main HE/Sensor - Stairs: [motion, inactive null]

It is by no means happening for every event it receives, but it's frequent enough to happen every few minutes. Do you have any idea what this might be caused by?

I have a new C7 and an existing SmartThings V2 hub.

Which hub is generally considered the best choice to assign as server in that configuration? Better to make the ST hub manage the server processing load, or the Hubitat, or doesn't matter as the processor/communication load on the server is not that significant?

Thanks!

SmartThings must be a Remote hub. Only Hubitat hubs can take the Server role. :slight_smile:

1 Like

That makes it pretty easy to decide then. :slight_smile:

Yup yup... definitely over at the no-brainer end of things :smiley: :smiley:

1 Like

That would be me, at the no-brainer end of things most of the time.

I'm getting a connection error in the ST HubConnect app when I hit done after selecting devices to be included, etc.

ALso, the ST app tells me I'm connected, but on the Hubitat side I'm getting an error:

I don't see any devices on the Hubitat when I look at my devices page (other than Hue devices I've already added via normal HUE bridge device add in Hubitat.

All apps on both Hubitat and ST have OAuth enabled, and I've pasted the key into the ST HubConnect app.

This is the 2.x RC I'm installing - says "{major=2, minor=0, build=9700, platform=Hubitat}" on the Hubitat app server status page. Smartapp in ST IDE code says "Map getAppVersion() {[platform: "SmartThings", major: 2, minor: 0, build: 9700]}".

Both Hubitat and ST hubs are on the same subnet (same VLAN, actually). When I was discovering the ST hub from the HubConnect app on the Hubitat it did not find the ST hub automatically, I had to enter the IP address of the ST hub. After I did that the connection was verified in the HubConnect app on the Hubitat. However, the ST app was giving the error above so I returned to the Hubitat Hubconnect server app and since then when I try to verify the connection I always get the error above.

ok, a couple of questions..

Are you using the Classic ST App or the new one?? I understand that the new one does work, but all of my experience is via the classic app.

Installing HubConnect really has to follow a two major step process. You shouldn't try to select devices to be 'mirrored' until the first step is successful. I use a metaphor of 'highway' vs 'cars and trucks'.

Getting the hub(s) interconnected is similar to building a highway. Pairs of hubs are interconnected and the resulting array of connections makes up your HubConnect Highway. Can't drive cars and trucks of an incomplete highway. :smiley:

You're still on the build-a-bear, umm highway, stage.

I'm sure you're more familiar with ST's App process than I am anymore. You have to use the IDE to add in the code, then in Classic App, use MarketPlace to install the App.. then use Automation to configure the App, including adding the Key.

It's HubConnect Remote Client for SmartThings under SmartApps in the IDE with OAuth and at least HubConnect Remote Hub for SmartThings Driver under Device Handler in the IDE.

Once the 'highway' is built (online) then you can install appropriate drivers for the devices you wish to 'mirror'. After that, you can make your device selections. Be sure to review the driver list when you complete the selection process. You must be certain all the drivers in the list are on the 'other' hub before clicking Done. If you don't, the other end can't create the 'mirrored devices'.

Thanks, @csteele!

I have removed everything and am starting over...the driver part was something that I didn't see at first, the need to install all the drivers as well.

I'll try your suggestion to use the Classic app to set up the ST app. I have created the ST app (many times now :wink: ) in the IDE, but haven't used the classic app to add the key, been doing it all in the new app.

Onward! (I hope...) :slight_smile: