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

Thanks! Yes, I meant Mode. Good catch!

Okay, so if I understand this correctly, in order for Modes to work correctly, it has to be enabled to receive at both locations, even though I really only need the Server to receive from the remote. I will make the change! I'll also enable HSM on both as well.

I've opted to use EventSockets, but not NodeJS Server - I only have 2 hubs... for now...

Not exactly--sorry, I was describing my own setup, where the server is the only one that makes mode changes, and I want those sent to my remote hub. There are options for sending/receiving on both server and client; you'll just want to set the appropriate spend/receive options on both ends according to what you really want (at least if you're using websockets). Srwhite described this above in better detail after I wrote that post.

Still broken after update to RC1. Any ideas?

This is great! Kudos to @srwhite

Anyone working on a docker container for the proxy server? That would make spinning this up super easy.

3 Likes

Update! Just over 11 days later with hubconnect removed and my hub is still grinding to halt so it was not hubconnect in anyway.

2 Likes

Turns out "modeStatus" is a reserved word by Hubitat. It will need to be changed in a 'next' release.

@srwhite purchased and setting up a new hub for my "LAN" devices like my thermostats. I installed your thermostat driver on my coordinator hub and getting the following error:

groovy.lang.MissingMethodException: No signature of method: user_driver_shackrat_HubConnect_Thermostat_705.currentValue() is applicable for argument types: (java.lang.String) values: [thermostatMode] on line 251 (refreshLRM)

Typo since it is missing "device." prefix so that line needs to be:
def tm = device.currentValue("thermostatMode")

While we are on the topic of Thermostat errors... I am also getting a thermostat error:

groovy.lang.MissingMethodException: No signature of method: user_driver_shackrat_HubConnect_Thermostat_350.currentValue() is applicable for argument types: (java.lang.String) values: [thermostatMode] on line 249 (refreshLRM)

Same error thinking you may have an older version since it has a different line number. Add the "device." prefix to the currentValue() and it should fix it.

1 Like

Thanks @ritchierich! This had been bothering me for a while, I would have never known how to solve it... Made the change and hoping it gets fixed on the driver source code before my next update...

Also, seems I need to get an update for my App and Driver codes! :smiley:

1 Like

FYI.. This was fixed in 2.0 a while ago. There will be no further updates to HubConnect 1.6 as v2 is now in the Release Candidate stage and should be released as production code in a couple weeks.

2 Likes

To be clear, the issue is occurring in the V2.0, RC1 candidate.

the relevant code in RC1 Thermostat driver is:

void refreshLRM()
{
	// Update lastRunningMode based on mode and operatingstate
	String lrm = getDataValue("lastRunningMode")
	String tm = device.currentValue("thermostatOperatingState") ?: "" + device.currentValue("thermostatMode") ?: ""

It's Line 262

Thanks! Not sure why my version was different... I've updated to the latest version from:

https://raw.githubusercontent.com/HubitatCommunity/HubConnect/master/UniversalDrivers/HubConnect-Thermostat.groovy

and I have this in lines 247 - 249:
// Update lastRunningMode based on mode and operatingstate
def lrm = getDataValue("lastRunningMode")
def tm = currentValue("thermostatMode")

Is it possible that I am using an incorrect link? (Got it from one of the published RC1 documents, but can't recall exactly which one...)

Yes, all of the GitHub drivers are incompatible with version 2...

That's good to know! Where would I get the link to the latest versions?

There's a Download section in HubConnect.to and within there's a folder of Universal Drivers.. same as GitHub, but with the RC versions.

This is because RC1 doesn't (yet) replace v1.6.4 on GitHub.

When v2.0 is released, @srwhite has said that the Apps will reside on HubConnect.to and the Universal drivers will be updated on GitHub... and v1.6 will drift into the sunset.

1 Like

I'm trying to run node.js proxy server

 admin@SYNOLOGY:/var/services/web/hubconnect$ ls                                                                                
    config.json  package.json  proxy.js                                                                                            
    admin@SYNOLOGY:/var/services/web/hubconnect$ node proxy.js                                                                     
    /var/services/web/hubconnect/proxy.js:40                                                                                       
      consoleLog(`HubConnect Websocket Proxy Server v${appVersion.major}.${appVers                                                 
                 ^                                                                                                                 
    SyntaxError: Unexpected token ILLEGAL                                                                                          
        at exports.runInThisContext (vm.js:73:16)                                                                                  
        at Module._compile (module.js:443:25)                                                                                      
        at Object.Module._extensions..js (module.js:478:10)                                                                        
        at Module.load (module.js:355:32)                                                                                          
        at Function.Module._load (module.js:310:12)                                                                                
        at Function.Module.runMain (module.js:501:10)                                                                              
        at startup (node.js:129:16)                                                                                                
        at node.js:814:3  

what im doing wrong ?

what version of NodeJS are you running?

$ node -v
v12.14.1

1 Like

node -v
v0.12.18