I turned old phone into a proxy for a Bluetooth speaker, so I can play music directly through Home Assistant

I recently tested out the Govee Table Lamp 2 Pro, which features a built-in Bluetooth speaker with audio from JBL. I lamented the lack of internet streaming capabilities for a smart speaker, given that Bluetooth audio was the only way to stream music to it. Well, I’ve worked out a solution, and it’s surprisingly perfect, if a bit overengineered. I’m using my old phone as a proxy with a Snapcast client, which in turn routes the audio to the speaker. And it all works through Home Assistant and Music Assistant.

I had previously toyed with the idea of using an ESP32 or an SBC for this, but neither worked perfectly. The ESP32 method, while possible with Squeezelite-ESP32, requires more PSRAM than I have available on my module. As for the SBC, I tried the Milk-V Duo S and spent far too long on it. I eventually got it partially working with incredibly crackly audio, so I threw in the towel to revisit it at a later date. It was in my research that I saw someone suggest using an old Android phone for this exact purpose, and to be honest… yeah, I hadn’t thought of that.

So, what I spent hours trying to work out was solved in less than ten minutes, even if it’s not the ideal solution I had wanted to use originally. You’ll need an old phone lying around, so I’m using the OnePlus 6, given it served as my Home Assistant dashboard on my desk until I replaced it with an ePaper panel. It’s already been wiped and is ready to go, so it just made sense. Plus, Squeezelite requires using Lyrion Music Server, whereas this solution requires nothing other than Music Assistant.

Setting up Music Assistant and a Snapcast client

This is one of the best add-ons for Home Assistant

Music Assistant is a great add-on for Home Assistant that serves as an offline and online media library manager. It combines multiple sources into one and can stream audio to any of your supported media player devices in Home Assistant. Supporting Spotify, YouTube Music, and more, it’s a fantastic add-on and one that I use every day, especially thanks to its Spotify Connect support, too. I can open Spotify on my phone, choose a device to stream to, and play music like any other “native” device using Spotify. That’s why I was disappointed when the Table Lamp 2 Pro didn’t support any kind of DLNA streaming, as I can use Music Assistant to stream to my Huawei Sound X speaker without any issues.

Music Assistant has another trick up its sleeve that makes this setup possible, though, and that’s a built-in Snapcast server. You can enable it by simply going to Settings and clicking Snapcast. The default settings are completely perfect, and I didn’t touch anything. Click Save, and this will then spin up a Snapserver that clients can connect to. You’re already ready to go, and you can install a Snapcast client on your old phone. I’m using Snapdroid for this, but you can use any that will run on an older phone.

Finally, the last step is to connect to the Bluetooth speaker on your Android phone. Make sure you’ve enabled Bluetooth audio streaming for the device (if it’s not enabled by default), and then go ahead and launch the Snapdroid app. It should automatically detect the Snapserver and offer to connect. Once you do, give it a moment, and your device should show up on the home page of Music Assistant, ready to stream music.

Related

I switched from Alexa to Home Assistant Voice — here’s how it went

The process wasn’t the smoothest, but it’s much better than Alexa.

You can do more than just stream music

Your device is added as a media player to Home Assistant

Snapcast client as a media player in Home Assistant

The additional beauty of this setup is that your Snapcast server in Music Assistant will add your phone as a media player to Home Assistant in general. That means you can stream any audio to it from anywhere, and it makes it perfect for automated announcements using TTS with Google, Piper, or any other service. If you don’t have a complete custom voice assistant setup, this can work great for at-home announcements. All you need to do is point an automation to use your device as the target media player entity for the audio to be played over, and it will work instantly.

In my testing, I also discovered something really cool with this exact setup. If you’re listening to music when an announcement is being played, the music will pause, and the speaker will play a chime to get your attention. It will then say the announcement, finish speaking, and then continue your music. I was concerned that my music would just… stop, but it didn’t, and it kept going as if nothing had changed. It’s a perfect way to turn a regular old Bluetooth speaker into a smart speaker, and you could even use your main phone for this, too, if you don’t have one lying around.

Of course, if you have an SBC that can do this with Squeezelite, then that’s going to be significantly better. A phone isn’t really designed to be left plugged in all of the time, and even the OnePlus 6 is arguably overpowered for this setup. Yet, it still works, and if you want to turn a dumb Bluetooth speaker into a smart speaker, this is a great place to start.

Continue Reading