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

@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"
    }
]
}

same error (and I killed my fill and made a new one with your code.

Registering platform 'homebridge-hubitat-hubconnect.Hubitat-HubConnect'

[10/08/2019, 20:14:58] ---

[10/08/2019, 20:14:59] Loaded plugin: homebridge-script2

[10/08/2019, 20:14:59] Registering accessory 'homebridge-script2.Script2'

[10/08/2019, 20:14:59] ---

[10/08/2019, 20:14:59] Loading 1 platforms...

[10/08/2019, 20:14:59] [Hubitat Coord] Initializing Hubitat-HubConnect platform...

uncaughtException: Unexpected token ` in JSON at position 0

[10/08/2019, 20:14:59] **SyntaxError: Unexpected token ` in JSON at position 0**

**at JSON.parse (<anonymous>)**

**at Object.init (/usr/local/lib/node_modules/homebridge-hubitat-hubconnect/lib/util_http.js:99:36)**

**at Object.init (/usr/local/lib/node_modules/homebridge-hubitat-hubconnect/lib/api-homebridge-hubitat-hubconnect.js:14:19)**

**at new HE_ST_Platform (/usr/local/lib/node_modules/homebridge-hubitat-hubconnect/index.js:103:15)**

**at Server._loadPlatforms (/usr/local/lib/node_modules/homebridge/lib/server.js:337:32)**

**at Server.run (/usr/local/lib/node_modules/homebridge/lib/server.js:90:36)**

**at module.exports (/usr/local/lib/node_modules/homebridge/lib/cli.js:59:10)**

**at Object.<anonymous> (/usr/local/lib/node_modules/homebridge/bin/homebridge:17:22)**

**at Module._compile (internal/modules/cjs/loader.js:689:30)**

**at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)**

**at Module.load (internal/modules/cjs/loader.js:599:32)**

**at tryModuleLoad (internal/modules/cjs/loader.js:538:12)**

**at Function.Module._load (internal/modules/cjs/loader.js:530:3)**

**at Function.Module.runMain (internal/modules/cjs/loader.js:742:12)**

**at startup (internal/bootstrap/node.js:283:19)**

**at bootstrapNodeJSCore (internal/bootstrap/node.js:743:3)**

uncaughtException: Unexpected token ` in JSON at position 0

Are you using a single quote around your key? I see the error

Unexpected token ` in JSON at position 0

Make sure that you use a double quote. If easier, you can also PM me your full config with key and I see what is going on

I think I had an extra character somewhere there. I reformatted the bracketing and for giggles looked to see if it ran and it did with my key. It seems my editor can do that from time to time. what do you use to edit linux files? I am a noob and using nano.

I am old school and use vi but that can be a bit overwhelming if you are not use to it.

Glad you got it running though

Yes, clearly it was a control character in nano that I could not see. Thank You! THANK YOU!! for the extra set of eyeballs and brain you saved my day.

jsonlint.com is a great place to test it out for those simple syntax, extra/missing chars.

1 Like

believe it or not I parsed it several times through there and it didn't catch the extra character at the start of the file. :-/

hmmm.. I've been trusting it all this time to be:

"dead on balls accurate." "that's a industry term"
-- Mona Lisa Vito

I was reading through the last few posts and was just about to post the exact same thing.

1 Like

I wish it had been able to catch my error, but I think the issues was that I was cutting and pasting into nano and that was causing the issue. I never saw what was actually hanging it up. I just decided to fix the formatting to something more easier for me to read and I opened it up in vi to look at it, and then wrote it back out and then it worked.

I just setup HubConnect between hubs on my local LAN - now I want to connect hubs that I have at a remote location. Before I start creating a VPN, I see that I should be able to --->

  • Flexible oAuth endpoints; Hubs do not need to be on the same LAN or even same location.
  • Remote hubs can be located anywhere with an internet connection.

But setting up a hub requires "Private LAN IP Address of Client Hub:" - is VPN the only way, or am I missing something?

Thanks, SImon