Bluetooth speaker as media player

Thanks,

Got access with port 22222.
It’s hard to find the right files.
(multiple asound.conf files found, all were 0 bytes but the read-only asound.conf file I found when using port 22 has content and is not 0 bytes )
Any idea how to get the right files?

nano /etc/asound.conf

Edit and add what I’ve posted above with your own Bluetooth speaker address.
( or vim instead of nano or whatever editor you prefer )

When I search for asound.conf (find / -name asound.conf) I get:

/mnt/data/docker/overlay2/11d4ecaacaa0eeea50ef1bf4169b440d2b4decfef2a3bb250f54fbb95397362b/merged/etc/asound.conf
/mnt/data/docker/overlay2/11d4ecaacaa0eeea50ef1bf4169b440d2b4decfef2a3bb250f54fbb95397362b/diff/etc/asound.conf
/mnt/data/docker/overlay2/5ab2741760faad74f4d3cbe442c777182cd0e0db48efd59307845f6500b80461/merged/etc/asound.conf
/mnt/data/docker/overlay2/5ab2741760faad74f4d3cbe442c777182cd0e0db48efd59307845f6500b80461/diff/etc/asound.conf
/mnt/data/docker/overlay2/da8334033556f741532d53ac8b10f3cbb2ca04d384562563a446a7f0ebd1e5ad/diff/etc/asound.conf
/mnt/data/docker/overlay2/4e913c57b8e7f916c8fe9c96e3d9ecd3b17ea3c6ef0bfcaebe52fef7b9861d5e/diff/etc/asound.conf
/var/lib/docker/overlay2/11d4ecaacaa0eeea50ef1bf4169b440d2b4decfef2a3bb250f54fbb95397362b/merged/etc/asound.conf
/var/lib/docker/overlay2/11d4ecaacaa0eeea50ef1bf4169b440d2b4decfef2a3bb250f54fbb95397362b/diff/etc/asound.conf
/var/lib/docker/overlay2/5ab2741760faad74f4d3cbe442c777182cd0e0db48efd59307845f6500b80461/merged/etc/asound.conf
/var/lib/docker/overlay2/5ab2741760faad74f4d3cbe442c777182cd0e0db48efd59307845f6500b80461/diff/etc/asound.conf
/var/lib/docker/overlay2/da8334033556f741532d53ac8b10f3cbb2ca04d384562563a446a7f0ebd1e5ad/diff/etc/asound.conf
/var/lib/docker/overlay2/4e913c57b8e7f916c8fe9c96e3d9ecd3b17ea3c6ef0bfcaebe52fef7b9861d5e/diff/etc/asound.conf

No /etc/asound.conf found here.

Create it in etc, it should override the docker ones as the one it etc is the main one (global one), it should be active after reboot.

Looks tricky…
All asoind.conf files found with the 22222 ssh session are empty files. The file found with 22 ssh session contains settings. So I wonder what will be the result of a new file on the etc map in the 22222 ssh session

The 22222 session is root session, 22 is not root but user session thus the lack of privileges there. Creating asound in etc should override any other asound created by HomeAssistant user, meaning that it should allow home assistant to use Bluetooth as main sound output. Installing mpd and then editing mpd configuration file in etc and adding Bluetooth there will allow mpd to use Bluetooth output that we put in asound. Once those two things are done, after you connect to your Bluetooth speaker, sound should come through it by using home assistant mpd integration.

Decided to give it a try…
But many commands like sudo, apk, apt-get are ‘not found’.

Welcome to Home Assistant OS.

Use `ha` to access the Home Assistant CLI.
# apk
-sh: apk: not found
# sudo
-sh: sudo: not found
# apt-get
-sh: apt-get: not found
#

So i get stuck …

For mpd try installing this addon then pick the audio output in the config of the add on in ha interface. If it was done right in etc for alsa config then ha should provide with that output.

Thank you for your continuou replies !!

Mopidy-Add-on seems not installable (anymore ?) Tried to add it as a repository, but that does not work:

https://github.com/hassio-addons/addon-mopidy is not a valid add-on repository

This one ??

@marcelhoogantink I’m going to try making ha os work on a spare sd card with this, there are a couple of angles I think might work, so if I succeed I’ll report my findings.

You can try this, different route but same goal.

@digitone I tried both already.

Mark Lewis Blog gave the same limits on HA-OS (see the replies below the blog), and Poeschl/Hassio-Addons tries also to load Mopidy, so it gives the same error :frowning_face:

really appreciate your efforts, thanks !!

@digitone Did you get any results?

@digitone I suppose you did not get any results?

1 Like

I did it a time ago. I’ve used Proxmox and installed HA there. Here you have how I connected Xiaomi Mi Compact Bluetooth Speaker 2 (XMYX02YM) to HA via BT:

Hi, First thanks so much for sharing this, I’ve been looking for a bluetooth speaker solution for months. The MPD etc. solutions are over my head. My setup is HA Blue with USP speakers directly connected to the HA Blue.

  • Can this work on an HA Blue (ODROID-N2+)?
  • If so, do you know what I need to modify from your github instructions to have HA output to the bluetooth speaker?
  • Will the USB speakers work concurrently with the bluetooth speaker or is HA only able to handle one or the other?
  • Am I correct is guessing that HA can only support one bluetooth speaker?

I’d like the bluetooth speaker in a separate room from the HA Blue.

Hi @HaEsphomeTstr

  1. Have no clue. The steps I’ve taken was related with HA installation via Proxmox. Check if you can log into the console (via ssh or via “Terminal & SSH” add-on). If yes check if you can execute the comments from point I.6-I.18) - this is the crucial binding.
  2. dunno
  3. dunno, yet via Proxmox installation I’d need to add USB-dev as pass-through to HA then (in theory) it should be recognised - check it out accordingly → II.1-4
  4. I believe that is one-at-the-time type of connection. if you could find the way to select the master-output via script/param only. I never try it.

Ok, thanks.

Got it to work following your instructions. From the “Terminal & SSH”:

bluetoothctl
scan on
pair (add MAC address here)
trust (add MAC address here)
connect (add MAC address here)
devices

5 Likes

Hello @HaEsphomeTstr ,

I’m struggling with this for so long (also with HA Blue) - I’m using the same commands and learnt even some more, but it just don’t show my devices at all or rarely just for a few seconds. I even bought a Bluetooth CSR 4.0 adapter (according to integration page recommendation for best performance), but it mostly won’t find it even when it’s sitting right on the speaker (I also tried many different speakers, all working great with other devices).

So I would like to ask you, what Bluetooth adapter exactly are you using? :slight_smile: (and where you bought it? - because most of these specifically listed on integration page are pretty difficult to find)