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

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

Your NodeJS version is horribly out of date. Offically, backtick support didn’t appear until Node v4 or v5.

For the server, only nodeJS v8 and higher are supported.

You’ll need to update your installed node release to get this to work.

try

Looks like I didn't notice that leading zero :slight_smile:

v12.14.1
v0.12.18

other way 12.18 is even better :grinning:

according to the NodeJS site...

Latest LTS Version: 12.16.1 (includes npm 6.13.4)

there is no v12.18 and the Latest Latest is...

Latest Current Version: 13.12.0 (includes npm 6.14.4)

I've only tested with v8 and v12.. so I wouldn't suggest v13 til you at least get v12 functioning.

The leading zero is significant. You are not even on version 1 of node. You need to update.

As csteele said, we’ve not tested on v13 so please stay with nodeJS 12.

Screen Shot 2020-03-31 at 11.43.54 AM

Node v0.12 is from 2017. Not long in Human years but in Node Years :slight_smile: it's ancient.

1 Like
admin@SYNOLOGY:~/hubconnect$ node -v                                                                                           
v12.14.0                                                                                                                       
admin@SYNOLOGY:~/hubconnect$ ls                                                                                                
config.json  package.json  proxy.js                                                                                            
admin@SYNOLOGY:~/hubconnect$ npm install -g                                                                                    
npm ERR! code Z_DATA_ERROR                                                                                                     
npm ERR! errno -3                                                                                                              
npm ERR! zlib: invalid distance too far back                                                                                   
                                                                                                                               
npm ERR! A complete log of this run can be found in:                                                                           
npm ERR!     /var/services/homes/admin/.npm/_logs/2020-03-31T18_54_08_220Z-debug.log    

Looks like too new for last synology os. I'll try v8

very exciting, v8 works
However, if proxy is in docker container version issues won't be problem

 admin@SYNOLOGY:~/hubconnect$ node proxy.js                                                                                     
    14:59:42  HubConnect Websocket Proxy Server v2.0.9700                                                                          
    Copyright 2019-2020 Retail Media Concepts LLC                                                                                  
    All Rights Reserved                                                                                                            
                                                                                                                                   
                                                                                                                                   
    14:59:42  Initializing configured hubs...                                                                                      
                                                                                                                                   
                                                                                                                                   
    14:59:42  Connection worker for Hubconnect online (PID 5511)                                                                   
    14:59:42  Connection worker for Zigbee online (PID 5512)                                                                       
    14:59:42  Connection worker for Zwave online (PID 5517)                                                                        
    14:59:42  Hubconnect: Initializing websocket server...                                                                         
    14:59:42  Hubconnect: Connecting to Hubitat websocket...                                                                       
    14:59:42  Zigbee: Initializing websocket server...                                                                             
    14:59:42  Zigbee: Connecting to Hubitat websocket...                                                                           
    14:59:42  Zwave: Initializing websocket server...                                                                              
    14:59:42  Zwave: Connecting to Hubitat websocket...                                                                            
    14:59:42  Hubconnect: Connected!                                                                                               
    14:59:42  Zigbee: Connected!
1 Like

Congrats!!

I cannot answer that question since don’t use docker myself. My instincts tell me it shouldn’t be an issue but perhaps someone with more experienced than I can offer more informed guidance.

Interesting, zigbee is connected but not configured in server instance
and zwave is configured to proxy but loosing connection.

admin@SYNOLOGY:~/hubconnect$ node proxy.js
15:53:12 HubConnect Websocket Proxy Server v2.0.9700
Copyright 2019-2020 Retail Media Concepts LLC
All Rights Reserved

15:53:12  Initializing configured hubs...                                                                                      
                                                                                                                               
                                                                                                                               
15:53:12  Connection worker for Hubconnect online (PID 18414)                                                                  
15:53:12  Connection worker for Zigbee online (PID 18419)                                                                      
15:53:12  Connection worker for Zwave online (PID 18420)                                                                       
15:53:12  Hubconnect: Initializing websocket server...                                                                         
15:53:13  Hubconnect: Connecting to Hubitat websocket...                                                                       
15:53:13  Zwave: Initializing websocket server...                                                                              
15:53:13  Zwave: Connecting to Hubitat websocket...                                                                            
15:53:13  Zigbee: Initializing websocket server...                                                                             
15:53:13  Zigbee: Connecting to Hubitat websocket...                                                                           
15:53:13  Hubconnect: Connected!                                                                                               
15:53:13  Zigbee: Connected!                                                                                                   
15:53:18  Zwave: New hub connection from Hubconnect (192.168.1.24); 1 connected.                                               
15:53:18  Zwave: Device Filter Update                                                                                          
15:55:20  Zwave: Connection error...                                                                                           
15:55:20  Zwave: Lost connection!                                                                                              
15:55:50  Zwave: Connecting to Hubitat websocket...                                                                            
15:57:57  Zwave: Connection error...                                                                                           
15:57:57  Zwave: Lost connection!                                                                                              
15:58:27  Zwave: Connecting to Hubitat websocket...                                                                            
16:00:34  Zwave: Connection error...                                                                                           
16:00:34  Zwave: Lost connection!                                                                                              
16:01:04  Zwave: Connecting to Hubitat websocket...

16:10:39 Connection worker for Hubconnect online (PID 21086)
16:10:39 Connection worker for Zigbee online (PID 21087)
16:10:39 Connection worker for Zwave online (PID 21092)
16:10:39 Zigbee: Initializing websocket server...
16:10:39 Hubconnect: Initializing websocket server...
16:10:39 Zigbee: Connecting to Hubitat websocket...
16:10:39 Hubconnect: Connecting to Hubitat websocket...
16:10:39 Zwave: Initializing websocket server...
16:10:39 Zwave: Connecting to Hubitat websocket...
16:10:39 Hubconnect: Connected!
16:10:39 Zigbee: Connected!
16:10:43 Zwave: New hub connection from Hubconnect (192.168.1.24); 1 connected.
/volume1/homes/admin/hubconnect/proxy.js:165
${hub.name}: New hub connection from ${socket.hub.name} (${socket._socket.remoteAddress}); ${socketServer.connectionCo unt} connected.
^

TypeError: Cannot read property 'name' of undefined
at WebSocketServer. (/volume1/homes/admin/hubconnect/proxy.js:165:60)
at emitOne (events.js:116:13)
at WebSocketServer.emit (events.js:211:7)
at /volume1/homes/admin/hubconnect/node_modules/ws/lib/WebSocketServer.js:91:14
at completeHybiUpgrade2 (/volume1/homes/admin/hubconnect/node_modules/ws/lib/WebSocketServer.js:284:5)
at completeHybiUpgrade1 (/volume1/homes/admin/hubconnect/node_modules/ws/lib/WebSocketServer.js:309:13)
at WebSocketServer.handleHybiUpgrade (/volume1/homes/admin/hubconnect/node_modules/ws/lib/WebSocketServer.js:337:3)
at WebSocketServer.handleUpgrade (/volume1/homes/admin/hubconnect/node_modules/ws/lib/WebSocketServer.js:173:26)
at Server.WebSocketServer._onServerUpgrade (/volume1/homes/admin/hubconnect/node_modules/ws/lib/WebSocketServer.js:89:12)
at emitThree (events.js:136:13)
16:10:43 Zwave: Device Filter Update
16:11:49 Zwave: Hubconnect disconnected; (0 connected)
16:12:46 Zwave: Connection error...
16:12:46 Zwave: Lost connection!
16:13:16 Zwave: Connecting to Hubitat websocket...

Would anyone know what would cause a device shared from the server hub to a remote hub to suddenly stop working? Is there a recommended approach to fix these situations? I know of a few (disconnect/reconnect the hub; do a device Resynchronization, maybe go through the "Select devices to synchronize" screen...), but I am not sure which one would work or if there are more or better ones. Would love to get a recommendation.

Some Background:

This morning, my wife complained that she could no longer turn on one of her lights... (not a good start of a day...) She uses a button controller that sends a toggle command to the Device on the remote hub using the HubConnect(ed) Switch. I tried it myself and got the same result both from a different button controller, then on a dashboard, then directly on the device page. Nothing worked.

I then went to the server hub device page and turned it on. Worked perfectly. So I can now conclude that the problem is that the device information is not going from one hub to the other, though the device state is being correctly reported on the remote hub's dashboard which I am finding odd... I am connected via EventSocket with no NodeJS Server and both are showing Online.

Check your server hub apps page- does it say "online" for your remote hub? Under the Hubconnect app is where you'll see it

Yes. Both the server and remote are showing online.

Sorry, I'm out of suggestions. If I have an issue, it's usually the device lost connection to the hub or the remote lost connection.
I'm sure the experts here will help you figure it out when they hop in.

Thanks @Rxich, I have had similar issues in the past where the remote hub would lose its connection, but as you said, you can quickly see this in its status and repair. This one is a bit different and I suspect may be caused by a bug. I'm leaving things as is for now (I'm going to turn on/off for my wife until then... :slight_smile: ) in case someone needs to check on a piece of information.