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

This may be stupid...

But does it send the devices to the remote hub in groups, then wait for a response? So, dimmers, wait for response that they've been successfully added, switches, wait for response, etc.

Because the vast majority of my devices are switches (300+) and it seems that is where it is hanging. I'm wondering if I move 50 to 100 of those devices to another category (maybe a custom device that is the same as a switch? or change the virtual switches to virtual dimmers and ignore the level attribute), if it will then accept it?

I'll try tomorrow and see if that makes it go.

Also, in case I've messed anything up that is beyond repair, can I reinstall the app & components and then relink without deleting (or duplicating) the devices on the remote hub? I'm willing to fully reinstall, but it will be a mess if I have to manually delete (and then put back in rules/apps) all 300 devices. Not absolutely horrible, but probably a nights worth of work. I'll give this a try tomorrow as well (after making a backup!)

The backup path is what I'd do.

Make a backup and then after the testing, if you're not better off, then soft reset back to nothing and restore the backup.

@csteele Thanks for the help. I think I've found the solution specifically for me, though it is a hack.

I'm hoping it will help with debugging the code.

I added another device group, I called it "announcementSwitch", by copying two lines of code in the server instance..


and

Now the initial setup completes, with the number of devices in each category shown below. When all were in one category, the code failed as described in previous posts:

image

image

Also, as a side note - I tried creating a custom device for a second switch device and couldn't get it working. I could get the device to be added to the remote hub, and to display state changes from the server hub, but I could not get a change from the remote hub to be accepted by the server hub. The error was related to not being able to find the correct device ID.

I just wanted to take a minute and post my experience. I had lots of custom code running on my single hub. I was experiencing crashes frequently.

I now have a second hub running with all the custom code and a relatively clean hub running my z radio stuff. All connected with hubconnect.

I have experienced no lock ups in some time in either hub, despite the fact that I am running all the same stuff. I kind of expected to see problems on the non z radio hub. It however has been rock solid.

Thanks again to everyone for this app.

3 Likes

Hi, Thanks for this app. I've installed it and it's working well on my 2 HE hubs. I wanted to get some zigbee switches off my main hub, that I believe are not great repeaters.

Now I'm trying to move my home alarm. I've got it on the second hub, but am not sure how or where to modify the custom device driver under "custom devices" in order to get it onto my co-ordinator hub.

I need the device handler to set the alarm: strobe, off, arming, both.

Thanks in advance.

By the way, I have noticed my second hub is much faster in loading web pages than the first.

@csteele and @srwhite Ok, so I have found an issue with adding a group of bulbs to the RGB Bulbs group. The lights turn off and on and dim as expected but it does not sync the status back to the remote DH. I wouldn't care about this but the Echo device responds that the device isn't responding. If you need more info let me know. Thanks.

Groups and Scenes App ?? or does "group" mean "this recent batch of..." ??

How would I create device code for my custom device/attributes?

Stub Driver??

Stub drivers don't do a lot. They predominantly just capture the event and stuff it into the system...

Take the Siren universal driver as a sample.. it has the same Definition section as the real driver it mimics. The Capabilities, Attributes and Commands are defined the same. Then "on", "off", "strobe", "siren" and "both" are needed.. but all they do is send an event to the Parent (aka Remote-Client or Server-Instance) That event then gets sent to the connected hub and functions the same as pushing the same button in the Device Info page... causing the real device to do that action.

Thanks, not at home right now.

Do I need to create new devices on both parent and slave hub? The device in question is currently on the slave hub. I want to get the status of the device to the master hub.

Wow, that was pretty easy. Install device code on both hubs, and presto. Thanks

@csteele from the Groups and Scenes App

I just tested this myself and found the same problem: setColor doesn't seem to transfer back to the "real" hub (Alexa doesn't need to be part of this test; the HubConnect device page is enough). I think I'm on the latest version of everything.

Looking at the logs on the client hub, I see:

[error] groovy.lang.MissingMethodException: No signature of method: java.lang.String.call() is applicable for argument types: (java.lang.String, java.lang.String, java.util.LinkedHashMap) values: [10.0.x.x:758, setColor, [hue:33, saturation:100, level:100]]

Anyone here using this with Homebridge? I am about to loose it with my install of the config.json file. It should be a easy edit and I am having issues and need another set of eyeballs.

Post your config once and we’ll get you up and running

Thanks :slight_smile:


        "bridge": {
            "name": "Homebridge",
            "username": "CC:22:3D:E3:CE:30",
            "port": 51826,
            "pin": "031-45-154"
    },

    "description": "This is an example configuration file. yada yada",
    "ports": {
            "start": 52100,
            "end": 52150,
            "comment": "This section is used to control the range of ports that separate accessory (like camera or television) should be bind"
    },
    "platforms": [
    {
            "platform": "Hubitat-HubConnect",
            "name": "Hubitat",
            "hubconnect_key": "MY_KEY_IHAVE IT",
            "mode_switches": true
     }

]
}

this really should work but I am getting errors on loading Homebridge. I have confirmed Homebridge is working by removing the platforms section. but the moment I include the

 "platform": "Hubitat-HubConnect",
 "name": "Hubitat",
 "hubconnect_key": "MY_KEY_IHAVE IT",
  "mode_switches": true

it throws a

[Hubitat] Initializing Hubitat-HubConnect platform...

uncaughtException: Unexpected end of JSON input

[10/08/2019, 19:43:45] **SyntaxError: Unexpected end of JSON input**

You might just be missing a single { at the beginning of the file. Try this here:

{
"bridge": {
            "name": "Homebridge",
            "username": "CC:22:3D:E3:CE:30",
            "port": 51826,
            "pin": "031-45-154"
    },

    "description": "This is an example configuration file. yada yada",
    "ports": {
            "start": 52100,
            "end": 52150,
            "comment": "This section is used to control the range of ports that separate accessory (like camera or television) should be bind"
    },
    "platforms": [
    {
            "platform": "Hubitat-HubConnect",
            "name": "Hubitat",
            "hubconnect_key": "MY_KEY_IHAVE IT",
            "mode_switches": true
     }
]
}

I just missed it in my grab to you. And to be sure I copy and pasted you whole code there and replaced mine, just for grins. Same error.

Ok, here is a config that I just started up, just replace it with your key

{
    "bridge": {
        "name": "Homebridge",
        "username": "DC:22:3D:D3:CE:30",
        "port": 51831,
    "pin": "216-30-154"
    },
    "description": "This is an example configuration file with one fake accessory and one fake platform. You can use this as a template for creating your own configuration file containing devices you actually own.",

    "platforms": [
    {
            "platform": "Hubitat-HubConnect",
            "name": "Hubitat Coord",
            "mode_switches": true,
            "hubconnect_key": "YOURKEYHERE"
    }
]
}