Fairly specific question, but I am in the process of moving all my self-hosted services to a docker swarm (running on 3 x NUCs). I am trying to get openHAB running with the Z-Wave binding, which needs access to a Z-Wave USB stick. I have plugged this into one of the NUCs and given that node a label in the cluster, and configured the openHAB stack to only run on that node. I am deploying with Ansible so the idea is if that NUC dies I can move the Z-Stick to another node, update the label and openHAB should spin up on the new node with very little downtime.
However, I can't figure out how to allow the /dev/ttyACM0 device to be visible inside the openHAB container. I have tried a myriad of different things but nothing is working. I was hoping that someone on here might have solved this problem already?!
I have tried setting up a UDEV rule which maps the USB device to /dev/zwave and than add a docker volume to the openHAB stack via;
services:
app:
image: openhab/openhab:latest
env_file: /var/data/config/openhab/openhab.env
volumes:
- /var/data/openhab/addons:/openhab/addons
- /var/data/openhab/conf:/openhab/conf
- /var/data/openhab/userdata:/openhab/userdata
- /etc/localtime:/etc/localtime:ro
- /dev/zwave:/dev/zwave # <------------ zwave usb stick mounted as a volume in the container
networks:
- internal
deploy:
placement:
constraints: [node.labels.zwave_usb == true]
I have given the device 666 permissions also. Running out of ideas...whenever openHAB starts it just doesn't *see* the device.