Music Assistant with Sonos and VLANs, is it possible? Works elsewhere!

I have my home network set up with smart switches and VLANs. I have a few VLANs set up to manage traffic. The Sonos speakers are on the restricted IoT network while all my computers, phones and Home Assistant server are on the other networks. I only allow the required ports through either direction. It works pretty well but I recently installed Music Assistant and, surprisingly, the configuration for the SONOS player provider is … very basic:

For some reason, I never see the speakers show up in the Music Assistant players list. Watching the router logs, I don’t see any dropped packets when playing with the options on this configuration screen. Unfortunately, there doesn’t seem to be a way to force a detection. I’m not sure why this isn’t working but I have access to the speakers through Home Assistant, my Plex server, my phones, and computers. This seems to be specific to Music Assistant. Is there some way to increase debugging or something so I can tell why it’s not seeing my speakers?

Also, does anyone else have VLANs+SONOS+Music Assistant working well together? If so, any pointers? :smiley:

Oh, one last thing. I have it working well with the Home Assistant entities from the HA Sonos integration using the Home Assistant MediaPlayers option – I saw somewhere that maybe you aren’t supposed to use both HA integration and the Music Assistant SONOS player provider at the same time, is that my problem?

Do you have a Sonos YAML config in HA to hardcode an IP for initial discovery? If so you probably have not allowed SSDP (uPNP) or mDNS (zeroconf) protocols to traverse your VLANs. This takes special care as they’re UDP multicast and need a repeater to cross subnets (in addition to the proper firewall rules).

I am forwarding mDNS & SSDP across VLANs (using UDP Broadcast Relay), that’s why the Sonos app, Plex, Home Assistant all work. I am not using the YAML config in HA to hardcode the IPs, I think they actually disabled that functionality a few releases ago.

How are you running Music Assistant? If in Docker, make sure you have network_mode: host to allow the multicast traffic to flow.

I installed it from HACS. I’m not sure what kind of network_mode is used in that case. I did all the installation from within the Home Assistant config system. I’m not sure if there’s a way to change that with this method, do you know?

Apparently, Music Assistant isn’t supported on VLANs according to this post. :frowning:

I have isolated VLANs with my HA/MA host on one side and the Sonos speakers on the other. Both HA and MA work fine. It’s just tricky to get all the ports and protocols opened/relayed properly.

  1. Are you using the MA integration from HACS?
  2. Are you using the SONOS provider in MA?
  3. Are you also using the SONOS integration on HA at the same time?
  1. I’m using MA in a Docker container on the same host as HA. However, I just remembered I am using the 2.3.0 beta release which has quite different Sonos handling. It’s quite likely this is related. My experience has been good so far, but it is a beta release.
  2. Yes.
  3. Yes.
1 Like