Win 10 Docker Desktop + Zigbee Success Story

Wanted to post a successful deploy I had after struggling (along with seeing other folk’s post issues trying with a similar setup) hope if anyone thats trying similar things, comes across this and finds it helpful!

I am running Docker Desktop on Windows 10 with HAS running in a container, with a sonoff zigbee dongle that is successfully interfacing with a few sonoff temp sensors and ikea smart plugs. A huge issue i see and had is that Docker Desktop does not allow USB passthrough. I found a work around that if you share the USB through WSL (my default is the docker-desktop wsl, you might have to specify dd if its not your default) and then share it in your container, HAS will see it and be able to use it.

in a privledged powershell

usbipd list
usbipd bind --busid <busid of your zigbee dongle>
usbipd attach --wsl --busid <busid of your zigbee dongle>

then in your wsl you can see it under /dev I update my perms just in case chmod 666 /dev/ttyUSB0 and you should see it in lsusb as well.

Heres my docker compose.yaml I deploy from docker compose up -d

version: '3'
services:
  homeassistant:
    image: ghcr.io/home-assistant/home-assistant:stable
    container_name: home-assistant
    privileged: true
    volumes:
      - home-assistant-config:/config
    ports:
      - "8123:8123"
    devices:
      - /dev/ttyUSB0:/dev/ttyUSB0
    restart: unless-stopped
    environment:
      - TZ=America/Denver

volumes:
  home-assistant-config:
    external: true  # Reference existing volume

I have seen on Windows restarts that I lose connection to the zigbee dongle. I dont have a self healing solution (yet), but have success repeating the usbipd attach, chmod, and reloading my container docker compose up -d

1 Like