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

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.

Getting this same error. Was on 1.6, upgraded this morning to 2.0 using the universal drivers found on hubconnect.to in the Hubconnect 2.0 RC1/Universal Drivers folder.

Adding the device. prefix on line 249 fixed it for me.

@csteele I'm also not seeing this code snippet on line 262. Is there a newer version of this driver somewhere that's not on the hubconnect.to site?

EDIT: @srwhite I imported the thermostat code using the import link found on hubitat.to. However if I download the file, it gives me a different driver than what the import link below the file gives. The downloadable file gives me the code that @csteele mentioned, but the import link gives me the code @Sebastien has.

One Device?
That would indicate the child device is orphaned from the Parent (Remote Client). Memorize Used By for the virtual device from Remote, then Delete the virtual device. Then pseudo select it again on Server and Done out. The child gets recreated. Restore the Used By.

v2.0 has half a dozen checks for Orphans and will log a message when detected.

No, nothing newer. I just downloaded it again, checked it, deleted it from my computer and downloaded it a 3rd time and checked it. All three times now, I've gotten the driver with the correct lines.

Screen Shot 2020-04-01 at 7.58.24 AM

I clicked the download symbol to the left of the filename.

I'd suggest deleting the file you've been using from your computer and then download it again. It could be landing in a different location than your fingers are expecting. :slight_smile:

But should I still be able to see its status on the remote?

Is there something specific I can look for in the logs? I'll do a search for it and post what I can find.

Also, @csteele, I've logged a ticket in HubConnect - You may be able to get more information from there if it helps...