Zwavejs2mqtt docker image with socat built in

Note: as pointed out, this is not necessary because the Zwavejs2mqtt supports tcp serial device connection natively.

I have been using the now deprecated ZWave integration for years and decided to switch over to the new ZwaveJS integration now that it has been available for a while.

However I have located my ZWave UZB stick remotely, attached to a raspberry pi, and have been using socat to connect my Home-Assistant instance to it. I’m running a Home-Assistant container in Docker on a Synology DS218+ which is placed in my basement: not ideal for network coverage.

I have been using Zigbee2mqtt for a while as well, in the same manner. For this integration I found a docker image which included socat and also checks if socat and Zigbee2mqtt are running. If not, they are (re)started.

Credits: mc303/zigbee2mqtt-socat: Multiarch zigbee2mqtt-socat (github.com) and forepe/zigbee2mqtt-socat (docker.com)

Because this was not available yet for Zwavejs2mqtt I decided to create the image myself, based on the aforementioned sources.

You can find it at koosvanw/zwavejs2mqtt-socat (docker.com). The image is automatically updated when a new release of Zwavejs2mqtt is published, so it should stay up-to-date.

Source for the image is available as well, just follow the links on docker.

I’m posting here in the hope that more people find this useful!

Maybe I have misunderstood what you’re accomplishing with this, but node-zwave-js natively supports serial tcp ports. https://zwave-js.github.io/node-zwave-js/#/api/driver?id=constructor

You can use tcp://<hostname>:<portnumber> for the serial port value instead of /dev/ttyACM0 (or whatever).

Hmm I didn’t know about that. But is this option also available/exposed in the default docker image of zwavejs2mqtt/docker at master · zwave-js/zwavejs2mqtt (github.com)?

If that is the case, than my image doesn’t add anything but some nice exercise for myself!

I assume you just enter a tcp path into the zwavejs2mqtt configuration. Nothing to expose in docker in that case, as long as the container has access to that host.

Never tried that, in the configuration panel it states to input the 'serial device’s, so I just assumed it wasn’t possible to input a tcp path.

I’ll definitely give it a try somewhere in the next days. I’ll update her with my findings. Untill then, I’m happy running my own container with socat, working flawless so far.

Update: just entering tcp://<host-ip>:<port> in the Zwavejs2mqtt configuration for the Zwave device works perfectly, thanks for pointing that out @freshcoast!