ZwaveJS installation Control Panel

@mwav3

I tried with z-wave controller that had not been paired with any devices, and encountered the same problem.

Before first login to home-assistant:

View of home-assistant start screen:

After account creation in Home-Assistant

]

And, yet, if I set up the integration, it connects:

Here are the logs for this scenario (without a device paired to the controller):

2021-08-03 16:56:35.566 INFO APP: Listening on port 8091 host 0.0.0.0 protocol HTTP
2021-08-03 16:56:36.310 INFO MQTT: MQTT is disabled
2021-08-03 16:56:36.512 INFO ZWAVE: Connecting to /dev/serial/by-id/usb-0658_0200-if00
2021-08-03 16:57:38.272 INFO ZWAVE: Zwave driver is ready
2021-08-03 16:57:38.277 INFO ZWAVE: Controller status: Driver ready
2021-08-03 16:57:38.300 INFO ZWAVE: Scanning network with homeid: 0xd8e81a8f
2021-08-03 16:57:38.317 INFO ZWAVE: Node 1: interview started
2021-08-03 16:57:38.758 INFO ZWAVE: Node 1: interview stage PROTOCOLINFO completed
2021-08-03 16:57:38.782 INFO ZWAVE: Node 1: interview stage NODEINFO completed
2021-08-03 16:57:38.791 INFO ZWAVE: Node 1: interview stage COMMANDCLASSES completed
2021-08-03 16:57:38.863 INFO ZWAVE: Node 1: interview stage OVERWRITECONFIG completed
2021-08-03 16:57:38.867 INFO ZWAVE: Node 1: interview stage COMPLETE completed
2021-08-03 16:57:38.886 INFO ZWAVE: Node 1 ready: Zooz - ZST10 (S2 USB Stick Controller)
2021-08-03 16:57:38.891 INFO ZWAVE: Controller status: Scan completed
2021-08-03 16:57:38.893 INFO ZWAVE: Network scan complete. Found: 1 nodes
2021-08-03 16:57:38.896 INFO ZWAVE: Node 1: interview COMPLETED, all values are updated
2021-08-03 16:57:38.905 INFO ZWAVE: Node 1 is alive
2021-08-03 16:57:39.360 INFO ZWAVE: Next update scheduled for: Wed Aug 04 2021 00:00:00 GMT+0000 (Coordinated Universal Time)
2021-08-03 17:08:28.257 INFO APP: GET /zwavejs2mqtt 200 107.683 ms - 1475
2021-08-03 17:08:28.441 INFO APP: GET /static/css/app.3ef71e230a7d149d2175.css 200 20.638 ms - 645097
2021-08-03 17:08:28.633 INFO APP: GET /static/js/app.41b94a256197955ca683.js 200 11.565 ms - 1832141
2021-08-03 17:08:31.266 INFO APP: GET /api/auth-enabled 200 19.771 ms - 29
2021-08-03 17:08:31.287 INFO APP: GET /static/favicons/favicon-32x32.png 200 5.806 ms - 1831
2021-08-03 17:08:31.503 INFO APP: GET /static/favicons/site.webmanifest 200 4.423 ms - 409
2021-08-03 17:08:31.604 INFO APP: GET /static/logo.png 200 5.853 ms - 10014
2021-08-03 17:08:31.741 INFO APP: GET /static/favicons/favicon-32x32.png 304 6.324 ms - -
2021-08-03 17:08:31.966 INFO APP: GET /api/settings 200 348.358 ms - 11807
2021-08-03 17:08:32.034 INFO APP: GET /static/fonts/MaterialIcons-Regular.fa3334f.woff2 200 43.622 ms - 82492
2021-08-03 17:08:32.222 INFO APP: GET /api/auth-enabled 304 60.665 ms - -
2021-08-03 17:11:00.269 INFO APP: GET /api/settings 304 133.057 ms - -
2021-08-03 17:11:00.415 INFO APP: GET /api/auth-enabled 304 4.937 ms - -
2021-08-03 17:11:28.191 INFO APP: GET /control-panel 200 9.523 ms - 1475
2021-08-03 17:11:28.354 INFO APP: GET /static/css/app.3ef71e230a7d149d2175.css 304 6.693 ms - -
2021-08-03 17:11:28.362 INFO APP: GET /static/js/app.41b94a256197955ca683.js 304 10.953 ms - -
2021-08-03 17:11:28.776 INFO APP: GET /api/auth-enabled 304 5.096 ms - -
2021-08-03 17:11:28.892 INFO APP: GET /static/favicons/favicon-32x32.png 304 3.877 ms - -
2021-08-03 17:11:28.997 INFO APP: GET /static/favicons/site.webmanifest 304 3.014 ms - -
2021-08-03 17:11:29.115 INFO APP: GET /static/logo.png 304 6.916 ms - -
2021-08-03 17:11:29.129 INFO APP: GET /static/fonts/MaterialIcons-Regular.fa3334f.woff2 304 2.606 ms - -
2021-08-03 17:11:29.265 INFO APP: GET /static/favicons/favicon-32x32.png 304 31.147 ms - -
2021-08-03 17:11:29.291 INFO APP: GET /api/settings 304 131.591 ms - -
2021-08-03 17:11:29.400 INFO APP: GET /api/auth-enabled 304 5.945 ms - -
2021-08-03 17:12:24.958 INFO APP: GET /control-panel 304 7.150 ms - -
2021-08-03 17:12:25.102 INFO APP: GET /static/css/app.3ef71e230a7d149d2175.css 304 2.457 ms - -
2021-08-03 17:12:25.183 INFO APP: GET /static/js/app.41b94a256197955ca683.js 304 2.384 ms - -
2021-08-03 17:12:25.549 INFO APP: GET /api/auth-enabled 304 4.446 ms - -
2021-08-03 17:12:25.641 INFO APP: GET /static/favicons/favicon-32x32.png 304 3.228 ms - -
2021-08-03 17:12:25.828 INFO APP: GET /static/logo.png 304 2.103 ms - -
2021-08-03 17:12:25.925 INFO APP: GET /static/favicons/site.webmanifest 304 2.398 ms - -
2021-08-03 17:12:26.010 INFO APP: GET /static/fonts/MaterialIcons-Regular.fa3334f.woff2 304 8.684 ms - -
2021-08-03 17:12:26.131 INFO APP: GET /api/settings 304 122.860 ms - -
2021-08-03 17:12:26.250 INFO APP: GET /static/favicons/favicon-32x32.png 304 4.204 ms - -
2021-08-03 17:12:26.314 INFO APP: GET /api/auth-enabled 304 5.499 ms - -
2021-08-03 17:12:30.003 INFO APP: GET /control-panel 304 7.548 ms - -
2021-08-03 17:12:30.164 INFO APP: GET /static/css/app.3ef71e230a7d149d2175.css 304 4.968 ms - -
2021-08-03 17:12:30.169 INFO APP: GET /static/js/app.41b94a256197955ca683.js 304 8.353 ms - -
2021-08-03 17:12:30.390 INFO APP: GET /api/auth-enabled 304 4.017 ms - -
2021-08-03 17:12:30.459 INFO APP: GET /static/favicons/favicon-32x32.png 304 2.256 ms - -
2021-08-03 17:12:30.516 INFO APP: GET /static/favicons/site.webmanifest 304 2.162 ms - -
2021-08-03 17:12:30.642 INFO APP: GET /static/logo.png 304 2.228 ms - -
2021-08-03 17:12:30.696 INFO APP: GET /static/favicons/favicon-32x32.png 304 25.505 ms - -
2021-08-03 17:12:30.797 INFO APP: GET /api/settings 304 129.500 ms - -
2021-08-03 17:12:30.909 INFO APP: GET /api/auth-enabled 304 5.298 ms - -
2021-08-03 17:13:12.530 INFO APP: GET /control-panel 304 8.543 ms - -
2021-08-03 17:13:12.808 INFO APP: GET /static/css/app.3ef71e230a7d149d2175.css 304 2.867 ms - -
2021-08-03 17:13:12.843 INFO APP: GET /static/js/app.41b94a256197955ca683.js 304 2.588 ms - -
2021-08-03 17:13:13.346 INFO APP: GET /api/auth-enabled 304 5.390 ms - -
2021-08-03 17:13:13.490 INFO APP: GET /static/favicons/favicon-32x32.png 304 2.521 ms - -
2021-08-03 17:13:13.615 INFO APP: GET /static/favicons/site.webmanifest 304 2.882 ms - -
2021-08-03 17:13:14.013 INFO APP: GET /api/settings 304 190.826 ms - -
2021-08-03 17:13:14.031 INFO APP: GET /static/fonts/MaterialIcons-Regular.fa3334f.woff2 304 6.112 ms - -
2021-08-03 17:13:14.068 INFO APP: GET /static/logo.png 304 2.605 ms - -
2021-08-03 17:13:14.133 INFO APP: GET /api/auth-enabled 304 6.000 ms - -
2021-08-03 17:13:26.601 INFO APP: GET /api/store 200 34.599 ms - 1527
2021-08-03T16:56:36.519Z DRIVER   β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•—    β–ˆβ–ˆβ•—  β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—  β–ˆβ–ˆβ•—   β–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—             β–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—
                                  β•šβ•β•β–ˆβ–ˆβ–ˆβ•”β• β–ˆβ–ˆβ•‘    β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•— β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•”β•β•β•β•β•             β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•”β•β•β•β•β•
                                    β–ˆβ–ˆβ–ˆβ•”β•  β–ˆβ–ˆβ•‘ β–ˆβ•— β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—   β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—      β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—
                                   β–ˆβ–ˆβ–ˆβ•”β•   β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•‘ β•šβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•”β• β–ˆβ–ˆβ•”β•β•β•   β•šβ•β•β•β•β• β–ˆβ–ˆ   β–ˆβ–ˆβ•‘ β•šβ•β•β•β•β–ˆβ–ˆβ•‘
                                  β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β•šβ–ˆβ–ˆβ–ˆβ•”β–ˆβ–ˆβ–ˆβ•”β• β–ˆβ–ˆβ•‘  β–ˆβ–ˆβ•‘  β•šβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•  β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—        β•šβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β• β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•‘
                                  β•šβ•β•β•β•β•β•β•  β•šβ•β•β•β•šβ•β•β•  β•šβ•β•  β•šβ•β•   β•šβ•β•β•β•   β•šβ•β•β•β•β•β•β•         β•šβ•β•β•β•β•  β•šβ•β•β•β•β•β•β•
2021-08-03T16:56:36.525Z DRIVER   version 8.0.6
2021-08-03T16:56:36.528Z DRIVER   
2021-08-03T16:56:54.055Z CONFIG   version 8.0.6
2021-08-03T16:57:36.689Z CONFIG   Priority device configuration directory /usr/src/app/store/config not found
2021-08-03T16:57:36.830Z CNTRLR   beginning interview...
2021-08-03T16:57:36.831Z CNTRLR   querying version info...
2021-08-03T16:57:37.728Z CNTRLR   received version info:
                                    controller type: Static Controller
                                    library version: Z-Wave 6.04
2021-08-03T16:57:37.729Z CNTRLR   querying controller IDs...
2021-08-03T16:57:37.771Z CNTRLR   received controller IDs:
                                    home ID:     0xd8e81a8f
                                    own node ID: 1
2021-08-03T16:57:37.772Z CNTRLR   querying controller capabilities...
2021-08-03T16:57:37.821Z CNTRLR   received controller capabilities:
                                    controller role:     primary
                                    is in other network: false
                                    is SIS present:      true
                                    was real primary:    true
                                    is a SUC:            true
2021-08-03T16:57:37.822Z CNTRLR   querying API capabilities...
2021-08-03T16:57:37.863Z CNTRLR   received API capabilities:
                                    serial API version:  2.3
                                    manufacturer ID:     0x027a
                                    product type:        0x0401
                                    product ID:          0x02
                                    supported functions: 
                                    Β· GetSerialApiInitData (0x02)
                                    Β· FUNC_ID_SERIAL_API_APPL_NODE_INFORMATION (0x03)
                                    Β· ApplicationCommand (0x04)
                                    Β· GetControllerCapabilities (0x05)
                                    Β· SetSerialApiTimeouts (0x06)
                                    Β· GetSerialApiCapabilities (0x07)
                                    Β· FUNC_ID_SERIAL_API_SOFT_RESET (0x08)
                                    Β· UNKNOWN_FUNC_UNKNOWN_0x09 (0x09)
                                    Β· UNKNOWN_FUNC_UNKNOWN_0x0a (0x0a)
                                    Β· SerialAPISetup (0x0b)
                                    Β· SetRFReceiveMode (0x10)
                                    Β· UNKNOWN_FUNC_SET_SLEEP_MODE (0x11)
                                    Β· FUNC_ID_ZW_SEND_NODE_INFORMATION (0x12)
                                    Β· SendData (0x13)
                                    Β· SendDataMulticast (0x14)
                                    Β· GetControllerVersion (0x15)
                                    Β· SendDataAbort (0x16)
                                    Β· FUNC_ID_ZW_R_F_POWER_LEVEL_SET (0x17)
                                    Β· FUNC_ID_ZW_GET_RANDOM (0x1c)
                                    Β· GetControllerId (0x20)
                                    Β· UNKNOWN_FUNC_MEMORY_GET_BYTE (0x21)
                                    Β· UNKNOWN_FUNC_MEMORY_PUT_BYTE (0x22)
                                    Β· UNKNOWN_FUNC_MEMORY_GET_BUFFER (0x23)
                                    Β· UNKNOWN_FUNC_MEMORY_PUT_BUFFER (0x24)
                                    Β· UNKNOWN_FUNC_FlashAutoProgSet (0x27)
                                    Β· UNKNOWN_FUNC_UNKNOWN_0x28 (0x28)
                                    Β· GetNVMId (0x29)
                                    Β· ExtNVMReadLongBuffer (0x2a)
                                    Β· ExtNVMWriteLongBuffer (0x2b)
                                    Β· ExtNVMReadLongByte (0x2c)
                                    Β· ExtExtWriteLongByte (0x2d)
                                    Β· undefined (0x2e)
                                    Β· undefined (0x2f)
                                    Β· undefined (0x37)
                                    Β· undefined (0x38)
                                    Β· UNKNOWN_FUNC_ClearNetworkStats (0x39)
                                    Β· UNKNOWN_FUNC_GetNetworkStats (0x3a)
                                    Β· UNKNOWN_FUNC_GetBackgroundRSSI (0x3b)
                                    Β· undefined (0x3c)
                                    Β· UNKNOWN_FUNC_RemoveNodeIdFromNetwork (0x3f)
                                    Β· GetNodeProtocolInfo (0x41)
                                    Β· HardReset (0x42)
                                    Β· FUNC_ID_ZW_REPLICATION_COMMAND_COMPLETE (0x44)
                                    Β· FUNC_ID_ZW_REPLICATION_SEND_DATA (0x45)
                                    Β· AssignReturnRoute (0x46)
                                    Β· DeleteReturnRoute (0x47)
                                    Β· RequestNodeNeighborUpdate (0x48)
                                    Β· ApplicationUpdateRequest (0x49)
                                    Β· AddNodeToNetwork (0x4a)
                                    Β· RemoveNodeFromNetwork (0x4b)
                                    Β· FUNC_ID_ZW_CREATE_NEW_PRIMARY (0x4c)
                                    Β· FUNC_ID_ZW_CONTROLLER_CHANGE (0x4d)
                                    Β· undefined (0x4f)
                                    Β· FUNC_ID_ZW_SET_LEARN_MODE (0x50)
                                    Β· AssignSUCReturnRoute (0x51)
                                    Β· FUNC_ID_ZW_REQUEST_NETWORK_UPDATE (0x53)
                                    Β· SetSUCNodeId (0x54)
                                    Β· DeleteSUCReturnRoute (0x55)
                                    Β· GetSUCNodeId (0x56)
                                    Β· UNKNOWN_FUNC_SEND_SUC_ID (0x57)
                                    Β· UNKNOWN_FUNC_AssignPrioritySUCReturnRoute (0x58)
                                    Β· FUNC_ID_ZW_EXPLORE_REQUEST_INCLUSION (0x5e)
                                    Β· undefined (0x5f)
                                    Β· RequestNodeInfo (0x60)
                                    Β· RemoveFailedNode (0x61)
                                    Β· IsFailedNode (0x62)
                                    Β· ReplaceFailedNode (0x63)
                                    Β· UNKNOWN_FUNC_UNKNOWN_0x66 (0x66)
                                    Β· UNKNOWN_FUNC_UNKNOWN_0x67 (0x67)
                                    Β· UNKNOWN_FUNC_UNKNOWN_0x78 (0x78)
                                    Β· GetRoutingInfo (0x80)
                                    Β· UNKNOWN_FUNC_LOCK_ROUTE_RESPONSE (0x90)
                                    Β· UNKNOWN_FUNC_GET_PRIORITY_ROUTE (0x92)
                                    Β· UNKNOWN_FUNC_SET_PRIORITY_ROUTE (0x93)
                                    Β· UNKNOWN_FUNC_UNKNOWN_0x98 (0x98)
                                    Β· FUNC_ID_APPLICATION_SLAVE_COMMAND_HANDLER (0xa1)
                                    Β· UNKNOWN_FUNC_UNKNOWN_0xB4 (0xb4)
                                    Β· UNKNOWN_FUNC_WATCH_DOG_ENABLE (0xb6)
                                    Β· UNKNOWN_FUNC_WATCH_DOG_DISABLE (0xb7)
                                    Β· UNKNOWN_FUNC_WATCH_DOG_KICK (0xb8)
                                    Β· UNKNOWN_FUNC_UNKNOWN_0xB9 (0xb9)
                                    Β· UNKNOWN_FUNC_RF_POWERLEVEL_GET (0xba)
                                    Β· UNKNOWN_FUNC_GET_LIBRARY_TYPE (0xbd)
                                    Β· UNKNOWN_FUNC_SEND_TEST_FRAME (0xbe)
                                    Β· UNKNOWN_FUNC_GET_PROTOCOL_STATUS (0xbf)
                                    Β· FUNC_ID_ZW_SET_PROMISCUOUS_MODE (0xd0)
                                    Β· FUNC_ID_PROMISCUOUS_APPLICATION_COMMAND_HANDLER (0xd1)
                                    Β· UNKNOWN_FUNC_UNKNOWN_0xD2 (0xd2)
                                    Β· UNKNOWN_FUNC_UNKNOWN_0xD3 (0xd3)
                                    Β· UNKNOWN_FUNC_UNKNOWN_0xD4 (0xd4)
                                    Β· undefined (0xee)
                                    Β· UNKNOWN_FUNC_UNKNOWN_0xEF (0xef)
2021-08-03T16:57:37.865Z CNTRLR   querying serial API setup capabilities...
2021-08-03T16:57:37.919Z CNTRLR   supported serial API setup commands:
                                  Β· GetSupportedCommands
                                  Β· SetTxStatusReport
                                  Β· SetPowerlevel
                                  Β· GetPowerlevel
                                  Β· GetMaximumPayloadSize
2021-08-03T16:57:37.920Z CNTRLR   Enabling TX status report...
2021-08-03T16:57:37.955Z CNTRLR   Enabling TX status report successful...
2021-08-03T16:57:37.956Z CNTRLR   finding SUC...
2021-08-03T16:57:38.018Z CNTRLR   This is the SUC
2021-08-03T16:57:38.068Z CNTRLR   querying node information...
2021-08-03T16:57:38.196Z CNTRLR   received node information:
                                    controller role:            primary
                                    controller is a SUC:        true
                                    controller is a slave:      false
                                    controller supports timers: false
                                    nodes in the network:       1
2021-08-03T16:57:38.232Z CNTRLR   setting serial API timeouts: ack = 1000 ms, byte = 150 ms
2021-08-03T16:57:38.262Z CNTRLR   serial API timeouts overwritten. The old values were: ack = 1500 ms, byte = 15
                                  0 ms
2021-08-03T16:57:38.263Z CNTRLR   Interview completed
2021-08-03T16:57:38.314Z CNTRLR   [Node 001] Beginning interview - last completed stage: None
2021-08-03T16:57:38.315Z CNTRLR   [Node 001] new node, doing a full interview...
2021-08-03T16:57:38.320Z CNTRLR Β» [Node 001] querying protocol info...
2021-08-03T16:57:38.755Z CNTRLR Β« [Node 001] received response for protocol info:
                                  basic device class:    Static Controller
                                  generic device class:  Static Controller
                                  specific device class: PC Controller
                                  node type:             Controller
                                  is always listening:   true
                                  is frequent listening: false
                                  can route messages:    true
                                  supports security:     false
                                  supports beaming:      true
                                  maximum data rate:     100000 kbps
                                  protocol version:      3
2021-08-03T16:57:38.777Z CNTRLR   [Node 001] Interview stage completed: ProtocolInfo
2021-08-03T16:57:38.778Z CNTRLR   [Node 001] not pinging the controller
2021-08-03T16:57:38.780Z CNTRLR   [Node 001] not querying node info from the controller
2021-08-03T16:57:38.785Z CNTRLR   [Node 001] Interview stage completed: NodeInfo
2021-08-03T16:57:38.793Z CNTRLR   [Node 001] Interview stage completed: CommandClasses
2021-08-03T16:57:38.861Z CNTRLR   [Node 001] Embedded device config loaded
2021-08-03T16:57:38.865Z CNTRLR   [Node 001] Interview stage completed: OverwriteConfig
2021-08-03T16:57:38.869Z CNTRLR   [Node 001] Interview completed
2021-08-03T16:57:38.887Z CNTRLR   [Node 001] The node is ready to be used
2021-08-03T16:57:38.889Z CNTRLR   All nodes are ready to be used
2021-08-03T16:57:38.907Z CNTRLR   [Node 001] The node is alive.

@firstof9

The Device Diagnostic logs from balenaCloud have lots of information, but I’m not seeing anything indicating any problems with dev/serial/by-id/usb-0658_0200-if00. Any thoughts on what I should look for?

Not sure if this matters, but you shouldn’t specify any ports for Home Assistant in your compose. Once you are running in network_mode: host all connections between Host and the Home Assistant container are open and no additional ports need to or should be specified.

Nope you’re using a flavor of linux that’s not normal, it’s almost like you’re inside a VM rather than on the bare metal.

Yeah I have to agree with @firstof9 Balena is not a version of linux I’m familiar with. I’m just running docker on Ubuntu, I really have no experience with Balena. Not saying its bad and from a quick read it looks like its specialized to handle containers specifically, but I just don’t know much about it. I don’t know if it is somehow creating a barrier to configuration here, especially with needing access to a physical USB port.

I double checked on specifying ports in network host mode and it appears docker just discards the port info and issues a warning, but it shouldn’t impact the setup so that might be a dead end.

I’m assuming based on your logs Home Assistant comes up around 17:08. It looks like it is continuously trying to GET settings from the zwavejs integration, including the control panel. Not sure if it is stuck in a loop or what exactly is causing this, but it appears to make it crash somehow.

Maybe your Zstick is drawing too much power off the PI and causing issues? Do you have an externally powered USB hub to try?

As for the USB stick on my setup, I created a Symlink with a UDEV rule to name the stick ttyusb.zstick and mapped it to the ttyACM0 in the zwavejs2mqtt container. I think I followed directions at these websites for the UDEV rule. That seemed to help with the USB stick staying put and not driving around on me to different ports, and being easily found by the container.

This is my device config in my compose:

        devices:
            - '/dev/ttyusb.zstick:/dev/ttyACM0'

Thanks for the help. Makes sense that it would be related to Balena. Balena is great, but it does need atypical settings at times. I’ll see what I can figure out on that end.

If and when I have a solution, I’ll post it here.

Any additional suggestions/advice continue to be welcome!

I’m not entirerly sure where to look but check whatever logs you can for anything related to usb or /dev/serial/by-id....

I sought some clarification about the disconnected message from the zwavejs2mqtt devs, and it is not the connection to the zwave controller that is disconnected, it is zwavejs2mqtt’s websocket connection to the server. They suggested that the issue is with my nginx setup.

Here is my nginx setup:

map $http_upgrade $connection_upgrade {
    default upgrade;
    '' close;
}

server {
    listen 80 default_server;
    listen [::]:80 default_server;
    server_name *.balena-devices.com;

    location / {
        proxy_pass http://sh_homeassistant:8123;
        proxy_set_header Host $host;

        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
    }

    location /api/websocket {
        proxy_pass http://sh_homeassistant:8123/api/websocket;
        proxy_set_header Host $host;

        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
    }

    location /zwavejs2mqtt {
        rewrite '^/zwavejs2mqtt(/.*)$' $1 break;
        proxy_pass http://zwavejs2mqtt:8091;
        proxy_set_header X-External-Path /zwavejs2mqtt;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection $connection_upgrade;
    }
}

Any ideas why homeassistant would be preventing zwavejs2mqtt’s websocket connection from connecting?

Sounds like your websockets are getting overwhelmed or blocked. Aren’t home assistant and zwavejs running on the same machine? Unless I’m missing something about your network architecture the connection between them shouldn’t be going through the proxy.

My nginx proxy is only for external connections to Home Assistant or the zwavejs2mqtt config page outside the network. If you stop the nginx container and temporarily disable the proxy does everything work fine? Or do you need the proxy for internal connections as well? If so I have no experience with nginx on an internal network so someone else would have to chime in.

My nginx config for Home Assistant is in this post RPI - docker installed with external access HA,problem with fail2ban and external IP - #6 by mwav3

@mwave3

Sounds like your websockets are getting overwhelmed or blocked

Yes, I think this might well be the problem.

Aren’t home assistant and zwavejs running on the same machine? Unless I’m missing something about your network architecture the connection between them shouldn’t be going through the proxy.

Yes, they are on the same machine. This occurs before there is any connection between home assistant and zwavejs - just having both on the same machine with the integration not even set up causes the webssocket connection for zwavejs to fail to connect.

If you stop the nginx container and temporarily disable the proxy does everything work fine?

I can’t access either interface without the proxy, so I can’t tell. But I can disable the proxy for zwavejs, and then set up the integration, which would let me know if zwavejs is able to connect to the websocket server. Worth trying, certainly.

Or do you need the proxy for internal connections as well?

The proxy is just for ports 8123 (home assistant) and 8091 (zwavejs control panel), port 3000 isn’t using the proxy.

Ok i understand- so you need the proxy to get to the zwavejs control panel. Your config for zwavejs is setup as if it’s a websocket server (like homeassistant is) but the control panel on port 8091 just uses basic http. That misconfiguratuon probably overwhelms the websockets. I can access my zwavejs2mqtt control panel with just this basic http nginx config:

##########################################################
#################
### SUBDOMAIN 4 Zwave JS#######################################
#################
server {
        listen 443 ssl;

        root /config/www;
        index index.html index.htm index.php;

        server_name something.duckdns.org;

        include /config/nginx/ssl.conf;

        client_max_body_size 0;

        location / {
           #   auth_basic "Restricted";
          #    auth_basic_user_file /config/nginx/.htpasswd;
                include /config/nginx/proxy.conf;
                proxy_pass http://192.168.0.126:8091;
        }
}

@mwav3 I think zwavejs2 requires websocket connectivity.

I disabled the port 3000 websocket server to be sure it wasn’t involved, and still, when I attempted removing the websocket connectivity settings from the nginx config, I got the following error:

It requires websocket connectivity on port 3000 but not the admin control panel on port 8091. Access to the admin control panel is just http.

Not sure if it will work but just try removing these 3 lines from your nginx proxy under location /zwavejs2mqtt

proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection $connection_upgrade;

These are websocket configs that I think are jamming port 8091 open. They’re not necessary and I can access my zwave control panel through my nginx proxy without them. I’m using the Swag container that combines letsencrypt for secure https and also fail to ban so it could be a little different then your setup.

There is a websocket connection with the browser. It’s not http only.

The proxy settings posted above are also recommended by the zwavejs2mqtt docs for a subpath configuration. The only difference I see is a missing rewrite rule, not sure if that’s a problem.

I definitely can’t argue with the documentation. It’s just weird my reverse proxy to the control panel works just fine without those extra websocket settings. I even have http auth enabled with nginx for an extra password requirement to get to the config panel, which I’ve never had work with websocket connections. I just figured trying to post my config and what I did from a working setup could help, but unfortunately at this point I’m definitely in over my head and not really sure anymore what could be going wrong here.

I’m also using subdomains vs subpaths so that could be a difference too.

@mwav3 Another difference between your config and mine is that you are using ssl, which I am not. Unfortunately, with balena only port 80 can be made publicly accessible.

Switching to ssl may be the next thing to try.

@freshcoast The missing rewrite rule does not seem to affect the issue at hand. I added rewrite ^ $request_uri; and encountered the same problem. But thanks for pointing it out!

Any other ideas?

Unfortunately, I don’t have any other suggestions. I don’t proxy to zwavejs2mqtt with a subpath, I’m using a domain, and I also use Traefik which handles websockets automatically without any additional setup.

@freshcoast I was actually considering switching to Traefik to see if that helped resolve any of these issues. However, I’ve never used it before. Would you be willing to share the relevant bits of your Traefik setup for zwavejs2mqtt? (I completely understand if you don’t feel comfortable doing so).

Here’s a sanitized and simplified docker-compose file for my setup. It’s not necessarily conventional.

  • http requests are always re-directed to https
  • A DNS Challenge configures the certificates with my own custom domain
  • The zwave-js websocket server is proxied as a subpath, so my integration setup can use a wss url. I wouldn’t necessarily recommend doing this part, you can just expose port 3000 as usual. This is not very useful w/o authentication, but I just wanted to see if it worked, it does, and so I just left it. In HA I use wss://my.domain/ws as the integration server URL. This would obviously break if zwavejs2mqtt also used the /ws path, so a more unique path would be better, or a separate domain name.
  • https://my.domain therefore goes to zwavejs2mqtt
  • All containers proxied by Traefik use the frontend network
services:
  proxy:
    container_name: proxy
    image: traefik:v2.4
    restart: always
    command:
      - "--api=true"
      - "--log.level=INFO"
      - "--providers.docker=true"
      - "--providers.docker.exposedbydefault=false"
      - "--providers.docker.network=frontend"
      - "--entrypoints.web.address=:80"
      - "--entrypoints.websecure.address=:443"
      - "[email protected]"
      - "--certificatesresolvers.mydns.acme.storage=/letsencrypt/acme.json"
      - "--certificatesresolvers.mydns.acme.dnschallenge=true"
      - "--certificatesresolvers.mydns.acme.dnschallenge.provider=mydnsprovider"
    environment:
      YOUR_DNS_PROVIDER_API_VARS_FILE: "/letsencrypt/vars_file"
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - "./proxy/letsencrypt:/letsencrypt"
      - "/var/run/docker.sock:/var/run/docker.sock:ro"
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.http-catchall.rule=hostregexp(`{host:.+}`)"
      - "traefik.http.routers.http-catchall.entrypoints=web"
      - "traefik.http.routers.http-catchall.middlewares=redirect-to-https@docker"
      - "traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https"
    networks:
      - frontend

  z2m:
    container_name: z2m
    image: zwavejs/zwavejs2mqtt:5.4.5
    stop_signal: SIGINT
    stop_grace_period: 1m
    restart: unless-stopped
    environment:
       - "TZ=<MYTZ>"
    networks:
      - frontend
    devices:
      - "/dev/serial/by-id/usb-Silicon_Labs_CP2102N_USB_to_UART_Bridge_Controller_7a6bb087ac08ea11b486db812473482f-if00-port0:/dev/zwave"
    volumes:
      - ./z2m/data:/usr/src/app/store
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.zjs.rule=Host(`my.domain`) && Path(`/ws`)"
      - "traefik.http.routers.zjs.entrypoints=websecure"
      - "traefik.http.routers.zjs.tls.certresolver=mydns"
      - "traefik.http.routers.zjs.service=zjs"
      - "traefik.http.routers.z2m.rule=Host(`my.domain`)"
      - "traefik.http.routers.z2m.entrypoints=websecure"
      - "traefik.http.routers.z2m.tls.certresolver=mydns"
      - "traefik.http.routers.z2m.service=z2m"
      - "traefik.http.services.zjs.loadbalancer.server.port=3000"
      - "traefik.http.services.z2m.loadbalancer.server.port=8091"

networks:
  frontend:
    name: "frontend"