ESP32 with Bluetooth Speaker as Media Player for Music Assistant

Perhaps have a look at ESPHome documentation ? :wink: Media Player Components — ESPHome

1 Like

That’s asking a lot from a tiny little ESP32…

You can try Squeezelite-esp32, but keep in mind that wifi-to-esp32-to-bluetooth streaming is still considered experimental and is not fully supported:

Note that streaming to a Bluetooth speaker is not the main purpose and remains experimental, so your mileage will vary. We will not work on improving or fixing that feature, please don’t open issues about that.

2 Likes

Thanks. I wanted to avoid using a spare Raspberry Pi 3B+ as it seems a bit overkill. Seems like a job for a Raspberry Pi Zero W to me - bang a DLNA client on there and maybe a script in HA to reboot it if needed.

Any news on this topic so far?

I mostly find ESP32 solutions to build a bluetooth speaker out of a conventional speaker, but almost none if you want to build a Wifi speaker out of a bluetooth speaker. Don’t get me started on how to get it in Home Assistant afterwards :sob:

1 Like

I’m using this for my amplifier:

Hope this is what you are looking for

1 Like

Have you managed to find a solution yet ??

I am looking for a solution to Marshall speakers to integrate with HA… but am not sure if the SqueezeESP work with it.

What is your use case?

Me: Home Assistant → WiFi → ESP32 → Bluetooth → Bluetooth amplifier with speakers / Bluetooth speaker. I want the option of streaming from my phoen youtube / internet radio or from Home Assistant.

I won’t be pursuing this until spring time as my speakers are outside in a ceiling over a table and it is winter here.

Almost same as your use case.

I simply want to use the Marshall Bluetooth amplified speaker with Home Assistant to play Local music files, Internet radio.

And hopefully in the future make it work with Rhasspy voice control.

I’ve found couple possible solutions but I don’t really want to risk it without an easy to follow step by step guide.

Edit: It also has a 3.5 AUX input option, which I might actually use with Makerfab’s ESP 32 Wrover audio player. Lets hope it gonna work out :wink:

I’m using ESP32s around the house for light/temp/motion detection.
I’d like to use the bluetooth proxy feature to connect a bluetooth speaker (eg. Band & Olufsen A1 2nd Gen) to stream music/message on the bluetooth speaker (in the shower for instance).

Connection flow looks similar to @chchrlam : Home Assistant > WiFi > ESP32 > Bluetooth proxy > Bluetooth speaker. So virtually, it’s like connecting a bluetooth speaker directly to Home Assistant.

Bluetooth proxy works as I see new bluetooth devices (eg. oral toothbrush) popping in the device/integration dashboard.

But what integration supports bluetooth speakers and would handle the configuration/connection to the bluetooth device? (I’m using Home Assistant docker, so I don’t want to manually install/configure anything inside the container)

From what I’ve read in other posts, it looks like we need a “media_player” type integration.

Is the above correct? any ideas/reactions/pointers?
Thanks!

I am looking for exactly the same integration. To be able to integrate some bluetooth speakers I have.
So far no other ideas as to go with rather extensive (or at least seem to be complex) Squeezelite-esp32 - which should connect to BT speaker from ESP32. But then I am afraid this ESP32 cannot act as Proxy ? - not sure about it…
Anyhow maybe the other scenario is to look for ESPHome media player which can utilise BT speaker as an output ? ESPHome already has media.player component…

1 Like

I’m looking for a solution for a similar use case, but ideally with a bluetooth headphone instead of speakers. Walking around and handing over between BT proxies would even be cooler if that could work.

Thanks - I had a look at Squeezelite-esp32 and found this mention:

Note that streaming to a Bluetooth speaker is not the main purpose and remains experimental, so your mileage will vary. We will not work on improving or fixing that feature, please don’t open issues about that.

The alternative seems to be an ESP speaker (ie. with the speaker integrated to the ESP board), like https://raspiaudio.com/produit/esp-muse-luxe. But that’s not exactly the use case I’m after.

I’m hoping that the latest bluetooth proxy update from 2023.7 enables exploring this use case further!

Is there any progres with bluetooth integration of any speakes, is there any chance to integrate JBL bar 1000 into HA?

I am diving into this pretty new to doing anything of value in HA and certainly new to ESPHome… but I think that speakers are not BLE devices and I think BTProxy only supports BLE devices currently… and more specifically BLE devices that have direct device integration in HA.

It is my understanding that the Squeezelite ESP, or people who have forked or taken the code for BT speakers within it is the only thing anyone has done to get BT speakers working to stream audio… and there is a bunch of limitations.

I am beginning to believe this is not the right platform for this and hoping one of you all will tell me I am wrong. From my reading, using the internal DAC for audio out is cracklie too and even wiring a headphone jack into it and using an analog in on the BT speaker over i2c is also highly limited due to the resource constraints of the platform.

Please someone tell me I am wrong and if you have a good direction for (ideally) BT speaker support over BT Proxy, BT speaker support for HA… or recommended direction as mine seems to be currently flopping… it would be awesome.

1 Like

ESP platform has functionality to work with bluetooth A2DP, it is described in the API:
Bluetooth® A2DP API - ESP32 - — ESP-IDF Programming Guide latest documentation.
I also found these developments:
GitHub - pschatzmann/ESP32-A2DP: A Simple ESP32 Bluetooth A2DP Library (to implement a Music Receiver or Sender) that supports Arduino, PlatformIO and Espressif IDF
I am not a programmer or a developer, but in my understanding there is a potential possibility of realization of this idea.
I guess, we need to modify the existing ESP media player component so that it could broadcast media and TTS received from HA not to i2s audio device as it is now, but via A2DP.

Although, I see a simpler hardware solution - on Aliexpress and other stores there are cheap bluetooth audio transmitter boards that can be easily connected to the i2c outputs of the audio module. If there will be two-way support (after all, most BT speakers can work as headsets), then the return channel can probably also be fed through i2c or otherwise to use the voice assistant.

I’ll bring up the topic! Has anyone made any progress in this direction? I’m waiting for the esp32 wrover, it will be more powerful than the wroom.

Since you just want to use bluetooth for sound you don’t have to do much of this basically just follow how to connect the bluetooth device to your HAOS.

Not an answer to the original question but some ideas on how I use media players where 1 is BT.
I have not looked into Music Assistant so I have no idea on how extensive the possibilities are with that.

I’m using LMS (Lyrion Music Server, formerly known as Logitech Music Server) for about 10y and for me, this is the ideal music server.
Although my HA is rock solid, I would not attribute the function to play music to it since with updates, restarts, music would be less available then it is now. (and music is playing A LOT here, being radio streaming of from own collection)
I would not add services that have nothing to do with HA to it and make that the main platform for everything that is running here.

I’m running Proxmox with 10 containers and 1VM; one of the containers is the music server.
LMS is integrated with HA so I have quite some automations to control volume, playback, (un)muting, and content.

1 of my players (piCore) on a RPi0 connects a JBL GO over BT.
Mostly, the players in the house are synced so they play the same media perfectly in-sync.
In some occasions I use a player for an announcement and the are also controlled by motion for some areas like for instance the kitchen.

So this is how it’s possible to play music over BT.

1 Like

FYI, Music Assistant is not Home Assistant. Music Assistant is an entirely separate program that you could run on your Proxmox server as your 11th container.

Additionally, Music Assistant implements almost the entire LMS API, so it would work out-of-the-box with your existing devices. They would be auto-discovered and playable immediately through a much nicer UI and with better HA control.

1 Like

My HAOS is a vm with no bluetooth capability. I’ve been interested in using a device with bluetooth as an audio gateway outside of the “just passthrough bluetooth usb device to vm” since my VM vmotions.