Docker Home Assistant /dev/ttyUSB0 not showing

I have just started using Home Assistant and am trying to use an EnOcean USB dongle by adding the device /dev/ttyUSB0. However when I try and use it as my device, I get the error No valid dongle found for this path and the home assistant container shows the warning:

 homeassistant  | 2025-05-29 15:54:21.400 WARNING (SyncWorker_0) [homeassistant.components.enocean.dongle] Dongle path /dev/ttyUSB0 is invalid: [Errno 2] could not open port /dev/ttyUSB0: [Errno 2] No such file or directory: '/dev/ttyUSB0'

If I check for the /dev/ttyUSB0 within my container it does not exist.

root@curtis-VirtualBox:~# docker exec -it homeassistant ls -l /dev/ttyUSB0
ls: /dev/ttyUSB0: No such file or directory

However, checking on my Ubuntu 20.04 host /dev/ttyUSB0 does exist so I’m not sure why it is not being passed through to the container.

root@curtis-VirtualBox:~# ls -l /dev/ttyUSB0
-rwxrwxrwx 1 root root 36 May 29 16:23 /dev/ttyUSB0

Below is my compose.yml file:

services:
  homeassistant:
    container_name: homeassistant
    image: "ghcr.io/home-assistant/home-assistant:stable"
    volumes:
      - ./config:/config
      - /etc/localtime:/etc/localtime:ro
      - /run/dbus:/run/dbus:ro
    restart: unless-stopped
    privileged: true
    network_mode: host
    devices:
      - /dev/ttyUSB0:/dev/ttyUSB0

Does anyone know how to resolve this?

Some USB devices are also added with /dev/ttyACMx (like my Z-Wave dongle). Check by comparing with and without dongle inserted.

Unplug the stick, then plug it back in, then execute:
docker exec -it homeassistant dmesg. At the end of all that output should be events showing how the operating system dealt with the stick being plugged in. It should also show what /dev/X it attached to.

Don’t ever use that type of path to use a device in Home Assistant. There is a chance that it will swap usb0 to usb1 or another device on boot and mess everything up. Go to the hardware page and find the /dev/serial/by-id address and use that. It will work no matter what actual device it connects to.
Open your Home Assistant instance and show hardware information.

… and please explain how to find that id for your device that you just bought.

I gave you a mylink to your hardware page and an example of what some of mine link like.

There is VERY little more that I can do.

This seems to work differently between a HA OS and a HA container installation. In a HA container installation you don’t get that information.

For a container installation, from a terminal run:

ls -l /dev/serial/by-id
1 Like

I know how to do that. The OP mentioned a docker installation and the advice was to hit a button which does not show this information.

My apologies. At least the OP knows how to do it now.

I’ve tried some of the suggestions posted here.

comparing the output of ls /dev with and without the dongle plugged in, gpiochip1 is added when plugged in. I added it to my compose file.

    devices:
      - /dev/ttyUSB0:/dev/ttyUSB0
      - /dev/gpiochip1:/dev/gpiochip1

The devices shows up when I do

docker exec -it homeassistant ls -l /dev/gpiochip1
crw-------    1 root     root      254,   1 May 30 09:34 /dev/gpiochip1

However when I try to use /dev/gpiochip1 as the USB dongle path presents the same error in the UI and a new error in the home assistant container logs.

WARNING (SyncWorker_6) [homeassistant.components.enocean.dongle] Dongle path /dev/gpiochip1 is invalid: Could not configure port: (22, 'Invalid argument')

I have also tried plugging and unplugging the USB dongle a few times and then running docker exec -it homeassistant dmesg

This results in the following output which to me suggests that it is ttyUSB0 that should be used:

[ 1390.801618] ftdi_sio ttyUSB0: FTDI USB Serial Device converter now disconnected from ttyUSB0
[ 1390.801648] ftdi_sio 3-2:1.0: device disconnected
[ 1392.590021] usb 3-2: new full-speed USB device number 9 using xhci_hcd
[ 1392.745234] usb 3-2: New USB device found, idVendor=0403, idProduct=6001, bcdDevice= 6.00
[ 1392.745241] usb 3-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1392.745244] usb 3-2: Product: EnOcean USB 300 DC
[ 1392.745246] usb 3-2: Manufacturer: EnOcean GmbH
[ 1392.745248] usb 3-2: SerialNumber: FT3ZRIUV
[ 1392.748944] ftdi_sio 3-2:1.0: FTDI USB Serial Device converter detected
[ 1392.748992] usb 3-2: Detected FT232RL
[ 1392.749510] usb 3-2: FTDI USB Serial Device converter now attached to ttyUSB0
[ 1461.782891] usb 3-2: USB disconnect, device number 9
[ 1461.783359] ftdi_sio ttyUSB0: FTDI USB Serial Device converter now disconnected from ttyUSB0
[ 1461.783392] ftdi_sio 3-2:1.0: device disconnected
[ 1463.275682] usb 3-2: new full-speed USB device number 10 using xhci_hcd
[ 1463.430988] usb 3-2: New USB device found, idVendor=0403, idProduct=6001, bcdDevice= 6.00
[ 1463.430995] usb 3-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1463.430999] usb 3-2: Product: EnOcean USB 300 DC
[ 1463.431001] usb 3-2: Manufacturer: EnOcean GmbH
[ 1463.431004] usb 3-2: SerialNumber: FT3ZRIUV
[ 1463.434753] ftdi_sio 3-2:1.0: FTDI USB Serial Device converter detected
[ 1463.434800] usb 3-2: Detected FT232RL
[ 1463.435381] usb 3-2: FTDI USB Serial Device converter now attached to ttyUSB0

So if this is the output from the command: docker exec -it homeassistant dmesg then this should be what the container sees, and things looks good to me. It got assigned to /dev/ttyUSB0 and a driver ftdi_sio was assigned to it so that apps can communicate with it. Why the container can’t open it I don’t know.

Hopefully its not a file permissions problem? If you are running your Docker container as a regular user, the /dev/ttyUSB0 may not give your HA Docker permission to access it (check using ls -l /dev/ttyUSB0)