IMO the docs don’t get to the docker-compose.yml information until the end. This what I use for an Aeotec stick You could just use /dev/ttyACM0, but as noted it can change and the newer sticks use USBX
services:
openhab:
image: "openhab/openhab:milestone"
restart: always
network_mode: host
volumes:
- "/etc/localtime:/etc/localtime:ro"
- "/etc/timezone:/etc/timezone:ro"
- "/etc/cont-init.d:/etc/cont-init.d"
- "./openhab_addons:/openhab/addons"
- "./openhab_conf:/openhab/conf"
- "./openhab_userdata:/openhab/userdata"
devices:
# Do not use /dev/ttyUSBX serial devices, as those mappings can change over time. Instead, use the /dev/serial/by-id/X serial device for your Z-Wave stick.
- '/dev/serial/by-id/usb-0658_0200-if00:/dev/zwaveoh'
environment:
CRYPTO_POLICY: "unlimited"
EXTRA_JAVA_OPTS: "-Duser.timezone=America/New_York"
OPENHAB_HTTP_PORT: "8080"
OPENHAB_HTTPS_PORT: "8443"
USER_ID: "1000"
GROUP_ID: "1000"
Four commands are most used by me
docker compose down
docker compose up -d // suppresses logging
docker compose pull && docker compose up -d //upgrade
docker exec -it openhab-openhab-1 /openhab/runtime/bin/client // karaf for openhab-openhab-1 container
It has been a long time since I set up my Docker deployment for openHAB and I use Ansible to do it, not docker run nor docker compose (though Ansible does call those itself). I also no longer have a USB dongle that needs to be directly passed into the container anymore. But I am 100% certain I have never had to run that command in the container nor have I ever had to use the group_add command.
Looking at the entrypoint, as I suspected, it adds the openhab user to all the dialout type groups for you.
As I understand it, neither the command from the docs nor the group_add option to docker run or docker compose are required.
great, then those warnings / instructions that openhab docker will not be able to access the usb without that dirty command on runtime should be removed from docs I guess
i even tried to verify it by googling, and indeed found some users on this forum complain their stick is not seen…but this was obviously so long ago before the entrypoint was improved to solve it