I’m trying to develop a custom integration for a bluetooth device. The first step is getting a working environment where I can do Home Assistant development with bluetooth access. I tried creating a dev container on my Linux box, but when I add the Bluetooth integration it claims I have 0 bluetooth devices.
I have edited the devcontainer.json file to map /run/dbus, but either this is not enough, or I did it incorrectly, or there is something else completely I need to do. Or maybe it is not possible to do bluetooth development for HA in a Docker container?
I managed to get something working… At least the Bluetooth integration can see my HCI, so I guess it’s okay. Next step is to see if I can actually get my custom integration to see any BT connections as well.
What I did was to add the following to devcontainer.json: "mounts": ["type=bind,source=/run/dbus,target=/run/dbus,readonly"
but this was not enough. I also had to add "--privileged" under "runArgs". I’m not sure I quite fully understand the security implications of this, but I could not find any other way to get the permissions to work.