Multi-room audio with Snapcast, Mopidy, and Home Assistant

You shoud check out the custom component here:

This allows media browser integration with mopidy in HA.
I was never able to get this to work all inside HA due to reasons mentioned above in this thread, but did it in a ubuntu lxc.
Two issues with TTS that I’ve had.

  1. If you have SSL then you can’t use a different internal URL. I haven’t had time to figure this out yet. Basically if internet is out…no TTS.
  2. For whatever reason I miss the very beginning of the TTS if one hasn’t been sent in a while.
    Spotify connect does not work with this for me. I have to use some mopidy frontend (usually Iris).
    The custom mini media player card does a nice job of making a card that will integrate your snapcast and mopidy media players so you can choose what plays where and independently control volume.
    TTS will stop music, but the component I posted above will allow you to pause and resume with an automation.
    I’ve read of a way to have TTS play over the top of the music, but that involves using pulse audio and I don’t have the time to mess with that so can’t give advice on that.
1 Like

Thanks for the information!

I think I am going to go this route, but in my LMS/Squeezelite ecosystem. I find mopidy/volumio/snapcast to be too disconnected/separate and hard to control for my family members. The apps in the LMS ecosystem are ugly as sin, but they work. You can also have multi-account Spotify Connect which is a bonus.

I’m going to setup a simple mpd/snapcast setup, retrofit it into picoreplayer using pulseaudio so that snapclient and squeezelite can use the sound card at the same time. That’s my plan at least.

Please document and post somewhere if you’re successful!

1 Like

I doubt if this is the right location to post this question but I have searched the forum and other sources for an answer to this and I am either missing something fundamental or am not searching for the right things.
I currently have a desktop computer running debian. Traditionally this computer has had the audio output jack on the sound card physically connected to an amplifier that drives some speakers in my house, all music (online and local) passes through this soundcard then to the amplifier and I have whole house audio. My goal is to migrate this to snapcast and achieve the following.

  • Redirect (all) the desktop audio to a snapserver that I have running on a second machine in docker.
    This will provide me the benefit of adding snapclients to various locations and devices in my house while maintaining the same desktop computer system for audio. This will make things more or less transparent to the other members of the household as they can continue do do what they have always done. So basically I want to change the physical audio output of my sound card that goes to my amplifier to a named pipe that the snapserver handles. Can this be done?

I think this is what you are asking about:

So it looks like the answer is yes, but this is just a theoretical yes. No clue on how to help you with it.

1 Like

The alsa and pulseaudio sections look like they may have what I need. I will play and see if I can get it to work.
I really appreciate you digging this out for me.

For those who are interested I thought I would update this thread with my setup and solution based on @danbutter providing the rabbit hole for me to venture into. My end goal was to push all the audio that is played on a desktop computer to a snapcast server. I attempted to do this various ways but then discovered the TCP connection option. Here is my final configuration for those who may be interested.

2 Likes

Whether what will work? This a longish thread.

Hi, all, very promising results above. I only wonder what is the best followup step for my current situation to get the “Sync” option available within Home Assistant.

I currently have the following installation:
HA running on a VM
Logitech Media Server (Squeezebox) running on another VM
Different HifiBerry’s with Max2play connected to speakers in different rooms, and connected to the Logitech Media Server VM.

I control the multi room speakers through the Logitech Media Server web interface and its app.

The reason for me using LMS, is the sync function that allows me to easily select multiple rooms to play the same music. But as I am trying to integrate all into HA, I am stuck on the LMS integration.

I am able to connect HA to LMS and control the music for the different rooms, but I cant find anyway how to use the Sync option in the Lovelace UI so to select multiple rooms to play the same music.

So, now I am wondering what do I need to install/configure so that I can quickly select in the Lovelace UI the devices to play the same musix. Just in a similar way as using Sync in LMS.

Any feedback appreciated. :slight_smile:

2 Likes

I’m in the process of writing a series of blogs around multi-room audio with Snapcast documenting moving away from proprietary solutions like Google Home / Sonos to open source solutions like Snapcast. I’ve only written the introduction so far but I plan to also detail how I have integrated Chromecast, AirPlay, Music Player Daemon and my turntable for a complete multi-room solution all with Home Assistant as the main control interface.

https://scoot-technology.github.io/

2 Likes

Sorry I missed this. Sync is dealt with easily in the mini-media-player card. GitHub - kalkih/mini-media-player: Minimalistic media card for Home Assistant Lovelace UI

For building your own ui, see the service calls join and unjoin here Media Player - Home Assistant

1 Like

Thanks! I will have a look at this.

Those of you that run snapcast…do you try to bring it into home assistant?
I tried this in the past and it seemed that every time anything rebooted it would rediscover and make a new entity. I ended up with tons of dead snapcast entities and gave up.

Just wondering if I did something wrong.

There are two things:
1: Snapcast groups are dynamic and thus in my opinion pretty useless: When you add a client to a group, the original group of that client will be deleted. If you then remove that client from that group a new group for this one client only will be created with a new ID.
2. The snapcast integration is/was really outdated and buggy. It did not handle any updates from the server like added/removed clients/groups. State updates had issues as well. Some of this improved last fall and this spring (HA2023.5), but the biggest issue still persists.

I have added a PR for this: Fix Snapcast connection issues by luar123 · Pull Request #93010 · home-assistant/core · GitHub
And in the meantime you can use this custom component with HACS: GitHub - luar123/snapcast_custom_component: Testing repo for the snapcast integration

1 Like