Hi @cab938 , I understand you’re trying to make bluetooth work with home-assistant, though I am not sure about your exact use case but let me help clear your doubts about the blocks and bluetooth connectivity.
I see that there is a balenablock for bluetooth for the rpi4, but I don’t really understand what a block means or how it gets deployed on the underlying device.
blocks are basically drop-in chunks of functionality built to handle the basics so you focus on solving your main problems, for ex: the audio block allows you to route the audio from different sources to different sinks without you worrying about underlying complex audio architecture (ALSA, Pulseaudio, DACs etc)
Are blocks each in their own docker containers?
Yes each blocks are separate containers in itself which interacts with your main application container to achieve the overall functionality one is trying to get. It is not recommended to change the code of the blocks (start script), however with the help of ENV variables set in the dashboard, we can tweak the functionalities of some blocks wherever needed.
You can read more about the blocks on this blog post
Coming to the experiments you’ve tried, so far from your modified docker-compose file, everything looks okay to me, the network_mode
is set to host
which is needed for BT, read more here the privileged
is set to true
which will allow access to host devices/interfaces by the container and you did mention that the adaptor is now visible which is great.
For instance, if I deploy the bluetooth block from here: GitHub - balenablocks/bluetooth: Optimized bluetooth agent for balenaOS. Based on BlueZ 5.0. as another service in my docker compose file (e.g. this one balena-homeassistant/docker-compose.yml at master · balenalabs-incubator/balena-homeassistant · GitHub ) does this somehow make available to the homeassistant service the bluetooth adapter?
The bluetooth block basically ease pairing and connection to other bluetooth devices and has following functionalities:
- Handle bluetooth pairing and connection with other devices
- Support for any bluetooth interface (built-in or USB)
- Uses DBus to communicate with balenaOS bluetooth daemon
- Reconnect on boot to known and trusted devices
but doesn’t deal with data transport which you need to handle in your main application container only (home-assistant in your case) using the desired bluetooth profiles. So I’m not really sure if bluetooth block is really what you need to make it work with home-assistant, since you already can access the interface. I also wonder why running cli commands accessing BT interface killed the web interface of your home-assistant.
I hope you now have a better understanding of blocks and multi-container workflow, let me know if it still doesn’t work and will definitely help you proceed forward, cheers!