Successfully Integrating USB Speaker with Raspberry Pi and Home Assistant

Hey everyone, I wanted to share my experience with integrating a USB speaker into my Raspberry Pi setup for Home Assistant. I know this might seem straightforward, but it had me scratching my head for a bit, so hopefully this helps someone else out there!

So, the goal was to get a USB speaker working for TTS announcements in Home Assistant. I use Mopidy-MPD for music, which works perfectly with the 3.5mm audio output, but I wanted the flexibility of USB for future projects. I picked up a cheap USB speaker from Amazon, and it worked fine with my laptop, so I figured it should work with the Pi too.

The first hurdle was getting the speaker recognized. I followed the usual steps: checking lsusb to confirm detection, which it did, but when I tried to set it as the default audio output, nothing happened. Running aplay -l was disappointing—it didn’t even list the device. I scoured forums and Google, but most solutions either didn’t apply or didn’t work for me.

Then I stumbled upon a YouTube video from the official Home Assistant channel demonstrating USB audio with a Blue device. It looked almost identical to what I was trying to do, but they were using a different hardware setup. I realized the issue might be with how the audio was being routed or how the USB device was handled in hassOS.

After some trial and error, I discovered that adjusting the ALSA configuration was the key. By editing /etc/asound.conf, I was able to force the system to recognize the USB speaker as the default audio device. It wasn’t the most elegant solution, but it got the job done!

Now, my USB speaker works seamlessly with Home Assistant for notifications and TTS. It’s such a relief to have this sorted out, and it opens up a lot of possibilities for future projects. If anyone else is struggling with USB audio on their Pi, I’d recommend checking your ALSA settings and ensuring the correct modules are loaded. A little persistence goes a long way!

Happy tinkering everyone! :rocket: