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.
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
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!