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

Hub Monitoring Device is found in your list of devices. It's using the HubConnect Remote Hub Driver:

Screen Shot 2020-05-19 at 9.05.20 AM
on the Remote Hub and for the Server hub, there's on per Server Instance:

Screen Shot 2020-05-19 at 9.05.58 AM

I have a smart plug shared from ST, to my main Hubitat running HC 1.6.4, then shared to my 2nd Hubitat hub as a client. When there are status updates on this particular plug, I get null errors in my log:

I had to turn debug logging on and swap lines 254 and 255 so that the log message would happen before it threw an exception. You can see that it appears to be sending a null for the event.unit portion. Is that normal? I don't see this for my other smart plugs around the house, just this one right now.

Yes, completely normal.

"Unit" is the unit of measure.. like feet or kilograms or degrees. So if there's a Value of 28.. then maybe it would be nice to know 28 whats. 28 degrees? 28 feet? or 28 kg?

But for some Values, there's no corresponding unit of measure. On / Off for example. They don't come in units of anything.

event.unit is filled by the "Real Driver". HubConnect passes it on. If it gets null, it passes null along.

As far as I can tell the Master Hub is not sending anything to the Remote Hub. The devices I've shared don't appear on the Remote Hub and I can't find them listed in any of the logs on either Hub.

Devices sharing back from Remote Hub to Master Hub with no problems though.

There's a drawing quite a ways UP in this thread pointing out the Parent Child relationships. I'll post it again:

What happens occasionally is that the Parent APP to Child DEVICE gets disconnected. There's no way to reform that relationship and the HubConnect Remote Hub Device becomes an orphan. HubConnect will try and create the missing device, but will fail due to it being a duplicate.

On your Remote Hub, find the HubConnect Remote Hub Device (default name: Server Hub) and remove it. Then, in the Server Instance, click Connect to Remote Hub and then Done and Done again. Back on the Remote hub, you'll see that the HubConnect Remote Hub Device has been recreated. Go into that device's Info page and verify that the switch is On.

The Server hub's HubConnect Remote Hub Device could be orphaned too but your clues suggests it's the Remote Hub device.

I finally found my way to the 2.0 site and upgrade my hubconnect. I tried again to added Aeotec Home Energy Monitor and still get the same relative error. What I mean is the line change but the code it does not like is the same. This is the error I get when adding the device.

2020-05-21 05:13:22.346 pm errorjava.lang.NumberFormatException: null on line 577 (updated)

and line 577 is

Any thoughts I why this device will not add correctly?

For reference I am using the driver posted above at ...

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

Everyone help is appreciated.

EDIT: Also is there a device, or driver that would allow for Lutron Keypad Button LED on/of control via HubConnect?

Settings in HE

Question:
I seem to be getting the following error in my logs from HubConnect 2.0:
image
(app 235 is the HubConnect)
A few questions:
a) Does this mean that device with id 258 on the Remote Hub cannot be pushed to the Server Hub?
or
b) Does this mean that a device with id 258 on the Server Hub cannot be pushed to the Remote Hub?
and
c) Is that 258 decimal = 102 in Hex? Is that the DNI?

{your hub ip}/device/edit/258


(on both Remote and Server - same error message)

SO you agree with HubConnect :smiley:

There is no device with that ID.

Try resending the device list from Server Hub.. go into the Server Instance and pretend to select devices then Done out... be certain to select:

Screen Shot 2020-05-26 at 1.29.29 PM

@csteele

I ran into 2 issues with 2.0 RC1. One I fixed and and one I can get around:

  1. I had a space in front of the name of the driver aka " HubConnect .xxxx" for a custom device and that caused the UI to fail with an error on line 642 with a NULL value. Once I discovered this, i removed the offending character and fixed the major issue. UI kept fritzing though until I removed the custom device completely.

  2. I was importing via Code a bunch of drivers. I entered one by hand, exported the definition. Hand edited it and imported three more drivers via the paste option and now the "IMPORT Drivers" options brings me to this screen:

image

It doesn't have the URL or paste options.

Thanks
Alan

I did quite a bit of searching but I can't seem to find anything to match my situation. I have just set up my Second Hub and I am trying to get Hubconnect setup. I am using the RC1. The links to the previous versions seem to be gone, so I assume this is what we should use.

The install seemed to go ok, but When I complete the remote HUB install in the app it says connected when I click the connect to server app but in the main apps window it shows my server hub as offline. Back on the server hub it shows the remote Hub is online.

Any ideas?

v2.0.RC1 is the latest, and is considered public Beta. v1.6.4 Release is available on github:

When v2 goes to Release, the github repo will be updated to have only the Universal Drivers. The App code will live on HubConnect.to

Therefore, feel free to use RC1 :slight_smile:

Look at the drawing a few messages above: [RELEASE] HubConnect - Share Devices across Multiple Hubs (even SmartThings!)

Note that there are 3 code installs on the hub designated as 'Server' and 2 code installs on each Remote -- just to get the 'highway built'.

On the Server hub, there's a HubConnect Remote Hub device for each connected hub. I have 3 Hubitat Hubs as well as a Homebridge and a SmartThings:

Screen Shot 2020-05-27 at 7.02.58 AM

If you open the Device Info for your remote hub, you should see plenty of detail, including the state of the switch. Make sure the details reflect your connection choices. I am using HubConnect NodeJS Server, and thus my details will include 'proxy'

I assume you are not, it's optional, therefore yours will show 'Socket'.
Screen Shot 2020-05-27 at 7.08.02 AM

IF the Parent/Child relationship between Server Instance App and Remote Hub Device is broken, it's a simple thing to fix. Delete the Remote Hub Device and go into the Server Instance and pretend to get the Key. Click Done and Done, and the Remote Hub Device gets recreated, correctly. The same fix works on the Remote Hub too.

It's important to get the 'highway built' before selecting devices to mirror (aka 'use the highway') because the next method is to choose a disconnect and then go back through a real Key exchange.

Between the 3 methods (Switch ON; Remote Hub recreate; Rebuild the Key exchange) I've found all of my (intentional) 'build the highway' errors are cured. (Intentional, because I tested the enhanced Key exchange process of v2.0 extensively. :slight_smile: )

1 Like

Okay the detail for mine shows the following which matches what you show, except the version is higher.

  • connectionType : socket
  • eventSocketSource : hubitat
  • eventSocketStatus : connected
  • presence : present
  • switch : on
  • version : v2.0.9501

On the remote client I see:

On the server I see:

{edit]I tried both event socket and HTTP and got the same result.
Also it should be creating a device on my remote hub? I am not seeing that.

OK it was me. I missed a step. I deleted everything and started over and I realized on my second attempt I never installed the Remote Hub driver on the remote Hub, I only put it on the server Hub.

I just got it connected and it appears all my remote devices are now available;e on my server Hub.

So now the real work starts. My plan is to migrate everything from Smartthings to Hubitat. There are a few devices I will probably need to leave on ST, but with this I guess I can control those through this as well.

So I will probably be adding my ST hub soon.

Thanks for your help.

2 Likes

hi @csteele and @srwhite

I recently added my smartthings hub as remote to be able to control my device through the smarrthings app on my galaxy watch. I am testing with a single hue lightsrip mirrored to the smarrthings hub.

Brings me to the first issue.

If i share the lightsrip to the smarrthings hub as a dimmer. I can access and control the lightstrip from both smarrthings apps. The status of the device never updates in on my watch and is not controlable. I have verified that a simulated switch created through the smartthings ide works as expected on the watch. Any ideas what might make the smarrthings simulated switch update and function properly on the watch but not the simulated dimmer created by hubconncet?

Second issue - If i try to share the lightstrip to the smartthings hub as a bulb - it tells me to install the HubConnect Bulb driver on the remote hub.

Looking at the github repository I cannot seem to find this driver in the smarrthings folders. The driver in the universal folder contains a driver with this name - it however throws an error in the smarrthings ide.

Im pretty clueless when it comes to creating the custom devices - I was excited when the original simulated switch worked then got bummed when I ran into these problems with hubconnect devices.

I am fairly sure I can use webcore to create links between virtual devices, however I was hoping something could be worked out with the drivers to make this all work.

thanks in advance to any all for thoughts and help.

The error is correct... SmartThings doesn't have a Change Level capability, that's exclusive to Hubitat. You may comment it out by putting a pair of // before it, like this:

// capability "ChangeLevel"

2 Likes

I kinda figured this - just though maybe the bulb driver for smarrthings was overlooked. No biggie..

still leaves me scratching my head over how to make the devices controllable on my watch. -- I do not see any magic in the device handler - it may just be a matter of having all the bits present.

Anyways thanks for your time. I guess I will shelve this until I have time to setup webcore.

@csteele

Can you check out the "HubConnect RM Global Variable Connector" for 2.0RC1. It doesn't look correct. It doesn't seem correct.

HubConnect RM Global Variable Connector

/*

  • Copyright 2019-2020 Steve White, Retail Media Concepts LLC.
  • Licensed under the Apache License, Version 2.0 (the "License"); you may not
  • use this file except in compliance with the License. You may obtain a copy
  • of the License at:
  •  http://www.apache.org/licenses/LICENSE-2.0
    
  • Unless required by applicable law or agreed to in writing, software
  • distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  • WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  • License for the specific language governing permissions and limitations
  • under the License.

*/
def getDriverVersion() {[platform: "Universal", major: 2, minor: 0, build: 0]}

metadata
{
definition(name: "HubConnect RM Global Variable Connector", namespace: "shackrat", author: "Steve White", importUrl: "https://raw.githubusercontent.com/HubitatCommunity/HubConnect/master/Hubitat/drivers/HubConnect-RM-Global-Variable-Connector.groovy")
{
capability "Sensor"
capability "AccelerationSensor"
capability "CarbonDioxideMeasurement"
capability "CarbonMonoxideDetector"
capability "ContactSensor"
capability "IlluminanceMeasurement"
capability "MotionSensor"
capability "PresenceSensor"
capability "RelativeHumidityMeasurement"
capability "SmokeDetector"
capability "TemperatureMeasurement"
capability "WaterSensor"
capability "Refresh"

	attribute "version", "string"
	attribute "variable", "string"

	command "accelerationActive"
	command "accelerationInactive"
	command "arrived"
	command "close"
	command "COClear"
	command "CODetected"
	command "departed"
	command "dry"
	command "motionActive"
	command "motionInactive"
	command "open"
	command "setCarbonDioxide",    [[type: "NUMBER"]]
	command "setIlluminance",      [[type: "NUMBER"]]
	command "setRelativeHumidity", [[type: "NUMBER"]]
	command "setTemperature",      [[type: "NUMBER"]]
	command "setVariable",         [[type: "string"]]
	command "smokeClear"
	command "smokeDetected"
	command "wet"
	command "sync"
}

}

/*
sendEvent for each Device Info page's button

*/
def accelerationActive() { parent.sendDeviceEvent(device.deviceNetworkId, "acceleration", "active") }
def accelerationInactive() { parent.sendDeviceEvent(device.deviceNetworkId, "acceleration", "inactive") }
def arrived() { parent.sendDeviceEvent(device.deviceNetworkId, "presence", "arrived") }
def close() { parent.sendDeviceEvent(device.deviceNetworkId, "close", "close") }
def COClear() { parent.sendDeviceEvent(device.deviceNetworkId, "carbonDioxide", "clear") }
def CODetected() { parent.sendDeviceEvent(device.deviceNetworkId, "carbonDioxide", "detected") }
def departed() { parent.sendDeviceEvent(device.deviceNetworkId, "departed", "departed") }
def dry() { parent.sendDeviceEvent(device.deviceNetworkId, "water", "dry") }
def motionActive() { parent.sendDeviceEvent(device.deviceNetworkId, "motion","active") }
def motionInactive() { parent.sendDeviceEvent(device.deviceNetworkId, "motion", "inactive") }
def open() { parent.sendDeviceEvent(device.deviceNetworkId, "open", "open") }
def setCarbonDioxide(val) { parent.sendDeviceEvent(device.deviceNetworkId, "setCarbonDioxide", [val]) }
def setIlluminance(val) { parent.sendDeviceEvent(device.deviceNetworkId, "setIlluminance", [val]) }
def setRelativeHumidity(val) { parent.sendDeviceEvent(device.deviceNetworkId, "setRelativeHumidity", [val]) }
def setTemperature(val) { parent.sendDeviceEvent(device.deviceNetworkId, "setTemperature", [val]) }
def setVariable(val) { parent.sendDeviceEvent(device.deviceNetworkId, "setVariable", [val]) }
def smokeClear() { parent.sendDeviceEvent(device.deviceNetworkId, "smoke", "clear") }
def smokeDetected() { parent.sendDeviceEvent(device.deviceNetworkId, "smoke", "detected") }
def wet() { parent.sendDeviceEvent(device.deviceNetworkId, "water", "wet") }

/*
installed

Doesn't do much other than call initialize().

*/
def installed()
{
initialize()
}

/*
updated

Doesn't do much other than call initialize().

*/
def updated()
{
initialize()
}

/*
initialize

Doesn't do much other than call refresh().

*/
def initialize()
{
refresh()
}

/*
uninstalled

Reports to the remote that this device is being uninstalled.

*/
def uninstalled()
{
// Report
parent?.sendDeviceEvent(device.deviceNetworkId, "uninstalled")
}

/*
parse

In a virtual world this should never be called.

*/
def parse(String description)
{
log.trace "Msg: Description is $description"
}

/*
refresh

Refreshes the device by requesting an update from the client hub.

*/
def refresh()
{
// The server will update status
parent.sendDeviceEvent(device.deviceNetworkId, "refresh")
}

/*
sync

Synchronizes the device details with the parent.

*/
def sync()
{
// The server will respond with updated status and details
parent.syncDevice(device.deviceNetworkId, "ContactSensor")
sendEvent([name: "version", value: "v${driverVersion.major}.${driverVersion.minor}.${driverVersion.build}"])
}

Thanks, Alan

My connection to my SmartThings has become very inconsistent lately then I noticed this in my logs:

My ST will show online but if I click into the HC app, it shows offline and says I must continue setting up the remote hub but the ST hub is setup correctly in the app. Unfortunately, it's affecting the Ecobee integration on my ST hub and I am not able to control it consistently. The Ecosmart Zigbee remotes that I have paired to ST seem to work ok in HE.