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

I did it, I deleted the st hub from the server, re added with different name, no success. I have one of my 2 HE already working and showing all devices in the HE hub server

All 4 hubs have reserved IP

Make sure you select SmartThings as the remote type. oAuth needs to be enabled on SmartThings Remote Client too. I still need to get the docs updated.

Yes, oauth is there, I get this when I try to save when adding the server info

If I try to add any device I can't save but not adding any device it saves. I got these logs.

Closer, as I can enter things now in the attribute fields... But...

I get this error when clicking DONE:
app:1312019-03-23 04:23:24.621 pm errorjava.lang.NullPointerException: Cannot get property 'value' on null object on line 251 (saveCustomDriverPage)

When I enter this on the page:

Am I doing something obviously wrong? Still not sure if there is a specific format/entry for attribute class name or driver name. I just made up something for Attirbute Class Name, and used the name of the driver stub I made for driver name.

Must be something in the ST code, I just installed the remote on my main hub and added 2 devices to the server hub, created a group in the server hub using 2 iris switches from my main hub and 1 Tradfri switch from the xiaomi hub and worked fine with the 3 HE hubs.

Is state synch working for others between a simple switch device on ST to HE ?

It works ok HE to HE and the device creates OK on HE from ST and is controllable from HE back to ST but a state change initiated from the app on ST (with accompanying physical state change) is not propogated over to HE. The ‘current states’ of the switch in the devices tab in HE is blank, and no last events show.

No, not you.. There is some quirkiness in how the UI pages are rendered. I'm reusing the UI page for creating new and editing custom drivers. I spent some time refactoring that part of the UI. Had to add a loading page to overcome whatever cache isssue (or other quirk) so that the form gets properly intialized. Also made a couple other tweaks, including forcing attribute 1 to be part of a known capability so that device selection can be made against it.

This needs a bit more testing, but I pushed it out. Update the HubConnect Server code again and give it a shot. I may have broken something else downstream with custom driverm, so no promises. :slight_smile:

I did it. I blew the dust off ST hub and plugged it back in... got it tied back to my acct again, Excluded a Zwave device and Included it to ST.

I get the same error:
UndeclaredThrowableException @line 562 (sendGetCommand)

The cause of that specific error is but a symptom. SmartThings is not returning state variables properly for appHealth/ping (runIn1Minute)

1 Like

What would one select for attribute #1 if if the custom driver should really be a thermostat type device? None of the attributes in the new dropdown really match for that.

Yes I have the same error (only using 1 switch device) from the every minute checkin
13:40:32: error java.lang.reflect.UndeclaredThrowableException @line 562 (sendGetCommand)

Also the HubConnect shows disconnected from ST (immediately after connecting) but continues to show connected on HE.

We already have a thermostat capability built in based on standard thermostat capabilities. Is there any a reason that isn’t working?

Temperature is probably the best one to use. There needs to be a primary attribute so we can prompt for device selection. I can look at something better but for the moment that’s my recommendation.

I’m sorry guys. I absolutely cannot reproduce this. I even wiped the app and started over. I’m on the na-04 shard.

It appears that ST is not properly saving or recalling state.

On all of my thermostat drivers I have an extra command and attribute to adjust the temperature sensor calibration. I use that extensively in user apps to effectively control off of a remote temperature reading instead of the built-in thermostat temperature sensor.

So, what I am trying to do is basically make a thermostat stub driver that has the normal thermostat attributes/commands + 1 additional attribute and command. I have the stub driver built (pretty obvious/straight forward).

I have some time today so will try a few things to get it going.


EDIT: Nope, still getting errors when clicking DONE. I get this error even if typing in only attribute class, driver name, and selecting just temperature for attribute 1.

app:1312019-03-24 09:44:56.038 am errorjava.lang.IllegalArgumentException: argument type mismatch on line 293 (saveCustomDriverPage)

OK .. I deleted the Hub Client in SmartApps from the the ST app and then poking around in the ST IDE I tried to delete the Smartapp and it wouldn't let me as it was 'still in use'. I also noticed in live logging that HubConnect Remote appeared listed several times. So looking in the particular location I see there were still many instances of the app still installed so I deleted all those and then started from scratch.

I now don't have the line 562 error :smile:

However the switch is still not updating state in HE when changed in ST.

14:43:25: info Subscribing to events..

14:43:23: info Sending devices to server: switch - [[id:883e8cdb-2c66-44a1-8ad0-e6c51c9ace53, label:Porch, attr:[]]]

14:43:23: info HubConnect Remote Client Initialized

14:43:23: info HubConnect Remote Client Updated

14:43:24: info Received command from server: ["Porch": refresh]

Nothing further appears in the log though when I click the button in the ST app to change the state - the light does respond though. Going to try a different device as this is a Hue bulb using 'switch' device handler only - maybe that's the issue.

ST receives these commands from HE coordinator but nothing happens..

16:08:12: info Received command from server: ["Kitchen Table": off]

16:08:06: info Received command from server: ["Kitchen Table": off]

P.S My multiple apps likely came about because of me using 'MarketPlace > SmartApps ' repeatedly rather than 'Automation > SmartApps' to configure devices

Just to note three of the device drivers are not universal due to differences between ST/HE

Button
Presence
Ring DoorBell

edit: sorry Presence is OK the third one is KeyPad.

Ring doesnt work locally on Hubitat so its intended as a Hubitat only driver.

Presence absolutely works for both. I have numerous devices.

Button may not work due to HEs implementation. I have not tested that one on ST an I have none connected.

Ooops sorry - I missed copying Presence across - the third one I meant was 'keypad'

What Button? What Keypad?

Removed all apps on Hubitat and ST plus the code on ST, re-added the code and reinstalled the SmartApp on ST, and I'm still getting the same errors. FWIW, I'm on the "original" graph.api shard. Not a big deal since I'm used to errors on ST anyway and can go back to using Other Hub--I just am trying to sync my thermostat (which OH doesn't support but I've already been using a workaround). Hubitat to Hubitat is working great. Thanks so much for your work on this!

Robert...

Kevin "started over" and didn't get those Line 562 errors.. So, I tried it too and got the same result. Those particular errors went away. It's certainly unexpected to save a state.{something} value and then NOT have it show up when you ask for it next.

I have logs that showed it being correct and then the exact same method failing the 2nd time (and from then on) even when the same state variables are used/displayed elsewhere.

Remember, I haven't used ST in a year. It did come back to me, but I do realize how much I'd discarded from my brain. :slight_smile: