Sonos2mqtt on a separate Server in different subnet

Hi there,

I am a brand new Homeassistant User, switching over from fhem. I have several Sonos devices running in fhem which connects to a special Debian VM which runs Sonos2mqtt in the player Subnet.

The MQTT Broker is running on the fhem Server. Fhem discovers all my Players in the Player-Subnet and I do not have any issues with the routing due to the fact that only TCP packages are routed betwee the subnets.

I would like to do the same with HomeAssistant but not sure how this can be implemented. I guess I need the MQTT Broker as an plugin on the HomeAssitant Server, but how can I discover my players over the Sonos2MQTT-Application running on the Server in the different Subnet? Is there anyone who can support me to get this implemented?

Regards,
Spartacus

There is a native Sonos integration in Home Assistant, can you use it for your purpose?

Hi Christoph,

thanks for reply. The native Sonos integration does not find any player due to the fact, that the players are not in the same subnet as the HomeAssistant-Server. I have had the same issue with the fhem setup and therefore I used the Sonos2mqtt, as described above. I also tried Multicast routing between the different subnets via PIM but this works not really well. I use the sonos2mqtt Setup with fhem since 2 years and it works perfect across subnets.

Homeassistant supports sonos2mqtt but I do not have a clue how to connect the homeassistant server with the existing sonos2mqtt instance in the player subnet. I only found examples where sonos2mqtt is running as an integration on the Homeassistant server. What I am missing is the part on the Homeassistant Server asking the sonos2mqtt instance in order to add the players automatically in HA.

If there is anyone who can help or can give hints, I would be very happy!
Thanks,
Spartacus

Connection Home Assistant to an external MQTT service is easy using the MQTT integration. But obviously there is no MQTT Media Player entity defined yet, so you would need to configure a custom MQTT entity, mapping all the required commands to topics and stuff.

See GitHub - TroyFernandes/hass-mqtt-mediaplayer: Fill out your Media Player Entity with MQTT Topics

Thanks for reply.

I used the SONOS Build In functionality and it works fine if the different subnets are configured in the configuration.yaml. Also the TCP Port 1400 must be routed betweeen the subnets

Thanks for support,
Sparrtacus