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

Also possible to play it on Sonos and google Home speakers ?

Not that Iā€™m aware of. This is basically a way to do multi-room audio through Home Assistant by way of Snapcast. But if youā€™re trying to do it through Sonos, you might want to check out forked-daapd.

Well, my first experiment didnā€™t go like I thought it would. Basically you can run multiple servers, but that doesnā€™t help with streaming audio. I tried taking an old Pi with HA and running the Snapcast client plugin from @raphii on it, but I couldnā€™t get configured to connect to the Snapcast server plugin. I know itā€™s probably just a configuration error on my end, but thereā€™s not a lot of documentation on the Snapcast plugin. I think I may just try to just run Snapcast on the client end from the Pi using the Raspian setup. Iā€™m shopping for a surround sound setup in the living room that will interface with my HA PC, and I plan on running Pi Snapcast clients in the office, bathroom, and bedroom.

Hey guys!
Summer is over, and iā€™m rebuilding my whole hass setup (including snapcast).
Iā€™ve switched over to a RPi 4 with SSD, which outperforms my Syno DS918+.
Iā€™m still tweaking my zigbee stuff and automations.
In about 1-3 weeks iā€™ll be at the stage ā€œsnapcast refactorā€ :slight_smile:

1 Like

The android client is always good for testing. I also have it running on my homeassistant dashboard.

I have a guide somewhere on how I set it up in the past, but need to search for it. Iā€™ll post it in case I can find it.

2 Likes

I would be very interested in that guide also @Burningstone! I have been reading and clicking around for hours, installing from various sources: Mopidy, MPD, Snapcast server and client. But all the descriptions of the process seem to refer to client configuration-files that Iā€™m unable to find, and in general I just have lots of things to click on, but no clue how/where/when to start diagnostics, and checking basic functionalityā€¦

Could you share what you config looks like in the addons please?
I have the edge addon for mopidy installed and the snapserver addon from raphii, but I canā€™t seem to get them connected. My modipy page shows disconnected.

Thanks

I would also be very interested to see the guide if you can locate it!

1 Like

Do you have both the snapserver and the snapclient installed?

Itā€™s possible to send TTS messages to the clients? To all or selected clients?

Something like this:

I do, but I canā€™t figure out how to do the config in the addons. All the guides I have found tell you to go to a config file and edit and save, but I donā€™t know how to translate that into something that the addons can use.
Any chance you could post your configuration of the mopidy, snapcast server and client addons so I can see how to enter the info?

Thanks,
Dan

1 Like

Iā€™d like to create an Multi-Room audio system in which I can have 1 or multiple sources to play on one or many audio devices.
These devices will mainly be an Onkyo soundsystem with (among others) an Android TV (Nvidia Shield) connected to it (optionally can add an Pi Zero), an auxillary speaker plugged into a Windows PC, and if possible multiple google home miniā€™s and hubā€™s.

Source will be mainly from Spotify, but would be interesting if for example even every sound coming from the Shield could be used as ā€˜sourceā€™.

What is currently the best way to start with this? Is it possible to run all server-related stuff in an VMware machine? Or even better, inside Home Assistant?

Thanks in advance.

I canā€™t get snapcast to work, it alwas shows as disconnectedā€¦

Is the snapserver running and working correctly? Does it work from your phone?

Iā€™m running the server side and client side on my VM where my Hassio is (running from within Hassio). Iā€™ve forwarded the ports 1780, 1704 and 1705 in my router but still nothingā€¦

The client shows this in log:

2021-01-17 09-15-26 [Error] (worker) Exception in Controller::worker(): resolve: Host not found (authoritative)
2021-01-17 09-15-26 [Error] (stop) Error in socket shutdown: Bad file descriptor

this is the config of the server:

stream:
  streams:
    - >-
      pipe:///share/snapfifo/librespot?name=SpotifyConnect&sampleformat=44100:16:2
    - 'pipe:///share/snapfifo/mopidy?name=Mopidy&sampleformat=44100:16:2'
  buffer: '1000'
  codec: flac
  send_to_muted: 'false'
  sampleformat: '48000:16:2'
http:
  enabled: 'true'
  doc_root: ' '
tcp:
  enabled: 'true'
logging:
  enabled: 'true'
server:
  threads: '-1'
  datadir: /share/snapcast/

Why do you open ports in your router???

Again, can you connect to the snapserver from your phone (you can use the snapcast app to test)?

I thought the port forwarding will help.
Tried via the app from my phone and it doesnā€™t connect.

Shows: error unknown host

Iā€™m dying, you know that you poke a hole in your system every time you forward a port from your router?

Anyway, what did you enter in the field for the host? Should be the IP of your machine running Snapserver.

When I use my duckdns link it doesnā€™t work but when I placed my actual hassio local IP it connected via phone app.