Trying to get (USB) bluetooth tracker working with HA/docker

I am trying to get a bluetooth_tracker device working on my HA 0.65.0 setup, but HA is not detecting connected bluetooth devices. I suspect it’s because I’m running HA in a docker container, and the container isn’t accessing the USB bluetooth adapter correctly. Does anyone know what I need to do to get my docker container to use the USB bluetooth adapter?

I’m running HA on a Lubuntu guest running on an ESXi host. The Lubuntu OS recognises the USB bluetooth adapter, and I can pair my phone with it, so I now just need my docker HA container to recognise the USB adapter connected to the host OS.

Do you use host networking? Can you copy and paste your Docker run command (or your compose file) here?

If you use host networking, any attached network devices should be visible inside your container.

Here’s my Docker run command:

docker run -d --name="home-assistant" -v ~/homeassistant:/config -v /etc/localtime:/etc/localtime:ro --net=host homeassistant/home-assistant

Sorry I don’t know what you mean by host networking (I’m a Docker novice and not a Linux expert either!)

docker run -m 500m --restart=always --device=/dev/zwave0 -v /hostmachine/config:/config -p 8123:8123 --name=hass_0573 homeassistant/home-assistant:0.57.3

You need to add “–device=/dev/yourzwavedevice”
I created file /etc/udev/rules.d/99-usb-serial.rules for mounting my specific model zwave devices but is not necessary. file only makes sure device mount location dont change after reboot host

SUBSYSTEM=="tty", ATTRS{idVendor}=="10c4", ATTRS{idProduct}=="ea60", SYMLINK+="zwave"

SUBSYSTEM=="tty", ATTRS{idVendor}=="0658", ATTRS{idProduct}=="0200", SYMLINK+="zwave0"

There is Host and Bridge networking in docker that is mainly used, as well as some other ways but ignore others for now

When docker container is created it exposes ports that are used to connect to container from outside.
HA uses 8123 for frontend and maybe other but I forget. Maybe 22 as well for ssh.

If you use HOST all ports defined to be open by container are opened on the host on specified port. So 8123 will be opened on your host machine in this case.

Bridge networking allows you to specifically define the ports to be open to access container and where they will be. So maybe you dont want HA on 8123 you can use -p 8888:8123 to say I want HA port 8123 to be on Host Machine port 8888. Or if port 22 was open you can just not define a port for this and block port 22 access for the container

Anyway this is a roundabout explaination and likely misses a lot. Take a look at the docs every so often. As you learn it starts to make more sense. Also after a ton of reading, bridge or host dont seem to matter. I prefer bridge as I run several containers and dont want to run into port conflicts

Thanks for all the feedback. It turns out that rebooting the server and restarting HA a few times resolved the problem - I’m now seeing bluetooth devices being tracked. Hopefully it will continue!