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

I'll give this a try. Thanks for working so hard on this. I think I should be making a donation, although I am on furlough right now. Dang virus...:slight_smile:

1 Like

Thank you for that Code!!!!!! I am no longer getting the error!!!!

2 Likes

Hi, really liking HubConnect. Saves me from replacing two perfectly good thermostats. :grinning:

But I have been getting a persistent error in my logs.
2020-04-30 10:14:37.076 am errorgroovy.lang.MissingMethodException: No signature of method: user_driver_shackrat_HubConnect_Thermostat_513.currentValue() is applicable for argument types: (java.lang.String) values: [thermostatMode] on line 249 (refreshLRM)

I saw the comment in the function that it has something to do with Google Home and since I do not have that I just placed a return statement in there for now to bypass the function as a temporary workaround. I'll be happy to test any code changes for you.

4 messages above yours is the fix for line 249.

I can't figure out how to sync a device with a custom DTH in Smartthings to my Hubitat hub? I need the attributes of the custom DTH ported over to hubitat. Can someone point me in the right direction? I have everything installed, but nothing appears when i select "Custom Devices" in the HubConnect Remote Client in my Smartthings SmartApp

Custom Devices are created in the HubConnect Server App.. once created, it gets distributed to all connected hubs. THEN you'll find something in ST's Custom Devices menu. :smiley:

Gotcha. I have it showing up in the list now, but it's not working right. I want to reflect a custom device (with a custom DTH) in smartthings to my hubitat hub. The custom device is simply a device that has about 30 attributes (strings and numbers). No real capability, just a device with data that I need.
(1) do i need to add all 30 attributes to the list of attributes here:


(2) do i need to create a driver with the build (beta) driver? I already have a custom DTH in smartthings...
(3) if i select the custom device in the ST's Custom Devices menu in the remote client, should it show up as a device in Hubitat's device list?

Yes.

Every device 'mirroring' involves a) the "real device" that has a real driver or DTH. It exists on one of the two hubs in a connected pair. b) a HubConnect driver on the 'other' connected hub.

If the "real device" is on Hubitat and you use the Builder tool to create a driver, it's targeting Hubitat, not ST. You can use it as a base, but you'll have to decide if ST's Tiles and Simulation are needed in your situation.

If you look at HubConnect Universal drivers, they dominantly do one thing.. sendEvent() In other words, the 'stub driver' gets the mirrored event and pushes them into the corresponding hub's Event system. Said another way, the originating event occurs in a driver (or DTH) and is injected into the Hub's Event system. HubConnect Apps provide a 'mirroring mechanism' to cause the events to appear on the connected Hub's HubConnect App, which determines which driver needs to review the Event and ultimately inject it into the connected Hub's Event system.

Because it's bidirectional, the nomenclature gets abstract. I can't say "server hub" or "remote hub" because the originating event can occur on either end. You'll have to apply the abstract to the specific. :smiley:

I've used a "highway metaphor" before, where the Server Instance and Remote Client Apps (and the underlying hub device and driver) create a Highway between two hubs. Once the Highway exists, all sorts of cars, trucks and motorcycles can travel back and forth. Events travel upon the highway. If the highway is damaged (orphaned hub device) then the highway is impassable.

I've found keeping those two segregated in my mind critical to debugging problems.

Very confused. Trying to setup 2.0, shows connection online, but I don't get any devices.

Sorry to ask the obvious question, but you have got the required driver installed OK?
You can see the drivers it is looking for when you select your devices. On one of the pages it shows which drivers are required before you hit 'Done'.
I believe the error message is issued when it cannot find the driver it needs to install the device.

1 Like

No apologies needed. I'm confused, which means I'm very likely at fault.

I did this a while back, but totally forgot how I did it. No offense to anyone but the instructions could use some love. Maybe I can donate my time to that if anyone is interested.

It sounds like that's where my issue is.

How do I add multiple attributes when creating custom driver? Sorry, I feel very stupid right now. Steven went over this me (or someone did) already and I cannot find the conversation. Even made me a custom driver for my HEM, and cannot find that either :confounded:

"Add Input", rinse, repeat :slight_smile:

Add as many as you need. Then Save Driver...

1 Like

Got it. Thanks. A lot of confusion. I'm pretty good at writing instructions. Let me know if can offer help with new documentation for 2.0

1 Like

Steve may have started "Camping 2020 (with COVID-19 adventure)"

If so, I don't have access to his Document Repository.

I can add to "hubconnect.HubitatCommunity.com" if you'd like and then mark it for Steve to import it to the repo.

2 Likes

@csteele Got any ideas on this? Trying to add my HEM, which is now shared to hub number 3 where I have @thomas.c.howard 's brilliant new app HubiGraph installed. Under HE Link to Hub, it shared as a Power Meter, but then uses the Omnisensor driver. The HubiGraph child app couldn't see it with only capability.sensor, so I changed that to capability.powerMeter and it worked. With Hub Connect, I'm not seeing it at all. Tried changing the child app to have capability.energyMeter, but that still doesn't expose the device for selection.

Should I re-share the device as Power Meter, instead of Energy Meter?
As far as HubConnect goes, it is working and I'm able to see all the current states of the HEM.

Screen Shot 2020-05-02 at 4.35.02 PM

[Edit] Figured it out. Just changed capability in my custom HubConnect driver for the HEM to Sensor instead of EnergyMeter

Steve may have started "Camping 2020 (with COVID-19 adventure)"

I think last year he returned in October.

I remember..
... vividly. :slight_smile:

2 Likes

Trying to do Homebridge HubConnect on 2.0RC1. I also have HubConnect proxy setup on the same device I'm running Homebridge on. I never seem to get the final step when adding the device - the step where you change the name of your device - it shows up, but there isn't a save/install button.

[04/05/2020, 12:34:14] [Hubitat hhh:0.3.9] attempt connection to ws://192.168.1.16/eventsocket
[04/05/2020, 12:34:14] [Hubitat hhh:0.3.9] homebridge-hubitat-hubconnect server listening on 20010
[04/05/2020, 12:34:14] [Hubitat hhh:0.3.9] connection to ws://192.168.1.16/eventsocket established
[04/05/2020, 12:34:14] [Hubitat hhh:0.3.9] HE websocket sending keepalive ping
[04/05/2020, 12:34:14] [Hubitat hhh:0.3.9] HE got pong
[04/05/2020, 12:34:14] [Hubitat hhh:0.3.9] Successfully connected to HubConnect

When I click Verify:


Looks like it's wanting me to click install somewhere. There is no install button on this page to finish the install process. The device now exists - called Null with the correct DNI, but I don't see another HubConnect instance listed - just my secondary hub and SmartThings.

I do see this in the logs, but I think it's unrelated as it does this after I enter the IP but before I select the type as homebridge.

def checkIP(String ipAddress)
{
    def child = getChildApps().each{}.find{it?.getPref("clientIP") == ipAddress && it.getPref("remoteType") != "homebridge"}
    return [name: child.label, id: child.id] ?: (location?.hubs[0]?.data?.localIP == ipAddress) ? [name: "Server Hub", id: 0] : null
}

NOTE: @csteele is actively working on a fix for this.

2 Likes

@srwhite would it be possible to add pressure to the Omnipurpose sensors ?