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

The light in my office has been 'mirrored' to ST as part of my testing.. Despite being ears deep in tech for so many years, sometimes when it works, it's gleeful....

A long time ago I stuck a Pico onto my Monitor and programmed it to turn on/off the lights and fans. This was in StaplesConnect days and remained needed in SmartThings days too. Now with Hubitat, not so much BUT it is still stuck there.

When testing HubConnect to ST I would push the Pico button, and the light would go on/off and I'd verify the indicator in ST UI followed along. For that to work.. the Pico talks to the Lutron Bridge, which talks to the Hubitat Hub for this Floor, which, via HubConnect, updates 'coordinator' which pushes the Event to ST's cloud, and the indicator changes. Soooooo silly it's making me grin. :smiley:

2 Likes

So, this fixed my null DNI issue (and a simple switch I tested seems to work), but I'm still getting the "line 610" error when I try to do anything with a thermostat. I do have a bit of a possibly odd setup: Hub 2 (remote client) has a directly-paired thermostat sync'd to Hub 1 (server), which I am then trying to share from that hub (Hub 1) to Hub 3 (SmartThings remote client). So, I'm not sharing a "native" thermostat but rather a HubConnect thermostat from the "server" hub. Is this the wrong way to do that? :slight_smile:

I have a Window Shades that I'm doing the same thing with. It's one of those strange devices have been around a while, but Hubitat 'defines' in an odd way.. so it's my test device for HubConnect too.

Nothing wrong with that approach. I'm doing the same thing with one of my Iris V1 devices.. :slight_smile:

Thermostats are a complex animal.. There could (not sure) be subtle differences between implementations on each platform, similar to buttons. I'll do some testing on my system to see what happen. I have a couple thermostats to test with.

My Thermostat is not ZWave , but WiFi although there is a driver for it and therefore it is showing on Dashboard. The driver exposes:

Current States
DriverAuthor : cSteele
DriverStatus : Current
DriverUpdate : N/A
DriverVersion : 1.2.2
coolingSetpoint : 75
followSchedule : FollowingSchedule
heatingSetpoint : 67
lastUpdate : 03/26/2019 10:36 AM
temperature : 67
thermostatFanMode : auto
thermostatMode : heat
thermostatOperatingState : Idle

You and @JasonJoelOld have "extended" thermostats I think. Attributes that Dashboard doesn't display.

Attention SmartThings Users!!

I just posted (beta) SmartThings Device Types for Switches and Pocket Sockets that have a new tiles UI. This means you should (it is SmartThings after all) be able to control and view status of the device using the ST Classic app.

To install these DeviceTypes in SmartThings simply import the code over the existing HubConnect Switch or HubConnect Pocket Socket (universal drivers), click Save, then Publish.

They are located in SmartThings/DeviceTypes/ in the HubConnect repo.

I'm looking for bug report and other feedback on these drivers. If it works for most folks I'll build out the rest of the device types with tiles..

1 Like

ok, this is working perfect seeing HE devices in ST and mode changes. However, i'm not getting any of the ST devices showing in HE..

Usually that means that one or more drivers are missing on the target hub.
Can you post logs from both ST and the Hubitat server hub when you're saving the device selections?

Steve,

I updated the code you posted today. I did not recreate the OAuth keys (was I supposed to?). Anyways, I have 2 devices on ST that I wanted to sync to. Nothing is showing up in the HE devices page like before the latest update.

A also have the generic device drivers installed on HE.

I am not seeing the HubConnect remote driver installed in HE as before either.

I did see this error in the logs for HubConnect Server Instance:

2019-03-26 03:42:13.359 pm [error](http://192.168.86.5/installedapp/configure/825)org.apache.http.client.ClientProtocolException: null on line 610 (setCommStatus)

Should I delete everything and try again, or is a bug you have to sort out?

Thanks,
Scott

Just so I am clear, how many hubs to you have? I ask because you mention HE Remote Client, Server, and SmartThings. I want to get an understanding of your environment before I dig in further.

Sorry about that. I have HE as coordinator hub and a ST V3 hub as a remote.

I have the HubConnect-Remote-Hub.groovy file from the HE Drivers installed as a driver in HE

I installed the device drivers when you first released this app (prior to moved to hubitiat github) was there changes to the universal drivers since then? i updated all the hub specific drivers but not those.

I'm also get the error on line 610

So I uninstalled everything to start from scratch. When I first intialize connect to hub and enter all of the IP address, name, and it automagically populates the key, and I click Done, I get the message:

[info](http://192.168.86.5/installedapp/configure/829)HubConnect Server Instance Installed

When I click Done to exit that screen I get the following:

app:8262019-03-26 04:08:27.491 pm debugFound server instance: HubConnect Server Instance

app:8292019-03-26 04:08:27.489 pm errororg.apache.http.client.ClientProtocolException: null on line 610 (setCommStatus)

app:8292019-03-26 04:08:27.475 pm infoSetting event communication status from remote hub: [status: false]

app:8262019-03-26 04:08:27.438 pm infoHubConnect Server for Hubitat Initialized

app:8262019-03-26 04:08:27.360 pm infoHubConnect Server for Hubitat Updated

Therein lies problem #1. You only need to install the server components on your coordinator and the SmartThings Remote Client in your ST location.

Do not install the remote client on the same
Hub as the server. They cannot coexist and are not needed on the same hub as the server has those capabilities built in.

From the 30000 ft level. Installing HubConnect begins with importing 3 pieces of Code on the device you've chosen as "Server" You would, at this point have ZERO devices in your Server Hub's list using "HubConnect... " drivers.

45%20PM

  1. HubConnect-Server.groovy <-- App Code
  2. HubConnect-Server-Instance.groovy <-- App Code
  3. HubConnect-Remote-Hub.groovy <--Driver Code

On your Hubitat Hub, designated as a "Remote" You need only One piece of Code:
49%20PM

  1. HubConnect-Remote-Client.groovy <-- App Code

Ideally you would NOT have done an Add User App before this next step:

Add User App:
45%20PM

You would then go to Apps and HubConnect for Hubitat and create an Instance for each Hub you've designated as "Remote".

Upgraded to 1.1 and am still getting errors adding a custom driver when I click SAVE.

app:1312019-03-26 04:35:00.788 pm errorjava.lang.IllegalArgumentException: argument type mismatch on line 284 (saveCustomDriverPage)

I'll start from square 1 and ask two stupid questions:

  1. What should users put for Attribute Class Name? Is this user defined, or are there specific entries that are valid here?
  2. What should users put for Device Driver Name? Is it the actual name of the driver, or something else?

This is what I just tried (I also tried the Attribute Class Name without the "-" in case it literally means only letters and numbers - same result):

1 Like

Try just opening the server app then clicking done so the updated() method is called to properly initialize the customDrivers map.

@csteele is my witness that this works now. :slightly_smiling_face:

Just tried that. Same error.

I think I'll just remove everything and start over to see if it does anything different.

Maybe I was unclear. I have this installed on my HE "Server":

  1. HubConnect-Server.groovy -- App Code
  2. HubConnect-Server-Instance.groovy -- App Code
  3. HubConnect-Remote-Hub.groovy -- Driver Code

On ST, I have the following installed:

  1. HubConnect-Remote-Client.groovy -- ST SmartApp

Prior to the update this morning, everything worked. Now, I am getting the error described in my earlier post and devices are not showing in HE at all.

I think I'm making progress. I was able to successfully add a custom driver. It took a complete remove/re-install though. No amount of clicking done before re-installing worked/helped.

OK. Now... For attributes all I have selected is "thermostat" as attribute 1.

Q: Do I need to manually enter all thermostat attributes (coolingSetpoint, heatingSetpoint, temperature, etc) in attributes 2-8, or do those come along for free with attribute #1?