Hydras got a new head – how to add a USB device to a docker container (homeassistant) on Linux
Plain and simple (or better in the case I forget it again). You can add the device when pulling and starting the HomeAssistant container. Make sure to adapt config path to yours.
Add “–device/dev/NameOfDevice”
docker run -dit --network=host --name homeassistant --device=/dev/ttyACM0 -v /home/pi/docker/homeassistant/config:/config -v /run/dbus:/run/dbus homeassistant/home-assistant
If you don’t know the path of the USB device you can see a list of them with this command:
pi@rpi4:/dev $ ls -l /dev/serial/by-id/
total 0
lrwxrwxrwx 1 root root 13 Aug 6 13:17 usb-ITEAD_SONOFF_Zigbee_3.0_USB_Dongle_Plus_V2_20240104112814-if00 -> ../../ttyACM0
I a using this as you probably guessed to be able to use a Zigbee dongle in the docker container of homeassistant (on a Raspberry).