UniFi and Sonos

I am using Ubiquiti UniFi for access points, switches, etc. Hubitat and Sonos are on the same subnet and work fine. I have all of the IoT devices on one subnet and everything else on another. Long story short, I can’t seem to get the Sonos app running on one subnet to be able to control my Sonos devices running on the other subnet.

I know this isn’t an actual Hubitat question and for that I apologize. This community has a lot of smart people, of which some likely are using UniFi devices as well, so I was hoping someone here might be able to help by sharing what they did to get it to work.

How did you get it to work?

Thanks,

John

Doesn’t this use a broadcast or multicast for device discovery?... If do you will need to be on the same subnet for it to work properly

1 Like

Yes it does. However, supposedly people have cracked this? Are you using UniFi? Multiple subnets?

I am using unifi.. This is the setting that might make it work for you:

2 Likes

That will help with device discovery across subnets..

1 Like

I have tried mDNS. This, by itself, hasn’t done the trick. Thank you for the suggestion.

Curiosity.. Why are you running multiple subnets at your home?... The main reason for this would be to reduce broadcast traffic... But by enabling settings like these it negates that benefit..

1 Like

Some suggest that best practice is to run IoT on a separate network from data-type devices.

I think the solution might be a firewall rule. While I have tried what I thought would work, nothing has. I know others have tried what I’m asking with respect to Sonos. I’m hoping someone who has experienced success with this may offer a suggestion.

Thanks again.

I'm not sure what you mean by that, but I don't think a firewall rule will work. You need some way to propagate SSDP across subnets. Like an SSDP relay.

This might help you get going:

Check this guideline https://vninja.net/2019/08/12/unifi-iot-networks. I have not tried myself.

Thanks. I didn’t know this, but it looks like setup using an android vs iOS is different. That might be my problem. I had setup a similar firewall rule, mDNS, and UPNP. I’ll need to explore this one further.

The firewall rule, in theory, allows for the Sonos devices’ UDP and TCP connections into the other network where the app is located.

Ah - that part is relatively easy. Its the discovery that is the issue. I went through this while getting Sonos to work over a VPN. Had to use SSDP relay and a tap interface.

2 Likes

Would you provide more details on how you set this up? Thank you!

I have UniFi and could not solve it directly either.. But you can manually set up your sonos speakers in Hubitat without using the Sonos connect app with just a little extra work..

Here's how...

  1. Make sure your Sonos speakers have DHCP reservations so the IP addresses do not change.

  2. Make a note of all of the IP addresses for your Sonos speakers.

  3. Go to this website and use the IP to HEX converter to convert each of the IP's into a hexadecimal format.

  4. Back on your Hubitat hub, create a virtual device for each of your Sonos speakers. Use the "Sonos Player" for the driver. Give them a name and paste the HEX IP into the DNI field and click save.

That's it. Your Sonos speakers should now work on your hub!

4 Likes

This is interesting - so the Sonos can be on a different subnet/Vlan to the Hubitat and still work with TTS?

Sure can. :slight_smile:

No problem but I don't know if this will translate to your Unifi setup. I have an Odroid running OpenVPN and I wanted to control my Sonos speakers at the other end of the VPN (using a Mac at work, or my friends house). I setup OpenVPN with a TAP tunnel (off course turned on IP forwarding), and setup ssdp-relay, which is configured to relay from the eth0 interface to the tap0 interface.

I think @srwhite's solution is far better for Hubitat.

1 Like

You need an IGMP proxy running on your router to pass multicast between the vlans.

1 Like

I’ve had similar problems with UniFi, google home devices, and separate subnets. I ended up adding parameters to my config.gateway.json file to enable mDNS repeating (this is in addition to turning on the mDNS services in the controller UI). See my response on the Ubiquiti forums. I also assigned static IP addresses to all google home devices. Occasionally I still have issues but since making this change it’s been pretty solid.

1 Like