Sonos devices keep going "unavailable"

All my Sonos devices went “unavailable” a few days ago. I don’t know of any network or configuration change that caused them to break.

So yesterday I upgraded to Sonos S2, removed the integration and re-added it. The Sonos’s looked fine for a bit but now I look at it and they are all unavailable again. Anything I can try?

Do they also get unavailable in the sonos app or is it only home assistant?

Is there something related in the logs maybe?

They’re fine in the Sonos app.

Nothing at all in the logs related to Sonos.

I just tried making all the Sonos IPs static and then re-added the integration. I’ll see if that does anything…

Static IPs didn’t help… They went unavailable again overnight. Any thoughts on why that would happen?

Are the speakers powered off overnight? I sometimes lose mine when that happens.

Nope, nothing happens with the power overnight…

Still happening, it sees them for a little bit after restart, but sometime in the next couple hours it loses them

Manual config of the Sonos integration specifying the static IPs of the Sonos’s seems to have fixed it. Maybe I have some network config that’s breaking auto-discovery?

You may want to make sure your network isn’t blocking connections from the speakers → HA on port 1400. If this isn’t working it’ll fall back to periodic polling which is slower and less reliable. Check the advanced section in the docs.

You can tell for certain by enabling debug on the Sonos integration and looking for messages about polling.

I know this is a bit of an old topic, but i’m going to post anyway :wink: I’m experiencing the same issue as mentioned above. My Sonos devices keep going unavailable and I just don’t understand why.

My HA installation is running in a docker connected to the host network. Port 1400 is open if I scan it. When I reboot HA, the container, the Sonos devices report their status for a couple of minutes and after these minutes they become unavailable again. No logs, nothing.

I added, based on the solution per this topic, my devices to the yaml files, this action adds a line to the log: Automatic discovery is working, Sonos hosts in configuration.yaml are not needed. So I might as wel delete them again.

I know of some kind of ‘master’ Sonos device within the network, how can I figure out which one this is and can I change this? Maybe the current master is a wifi device and I have some wired sonos as well. Might make more sense to designate them as a master. But can’t find anything about this either. Might even mean I mix things up with other systems. I just don’t know what to look for.

I can just second here. I experience the same behavior as described earlier.

I am using HAOS running on a Intel NUC and have a really basic network setup.

Apps like Sonos and Spotify are showing the devices just fine.
I just saw that there are some open issues in regards of Sonos, do other people have it working currently in their setup?

https://github.com/home-assistant/core/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+sonos%22

The ‘master’ is called a coordinator, besides this, i haven’t learned more. There are a couple of issues raised, but all don’t really seem to have a clear explanation or solution. It stays a bit strange. And tbh I don’t even know if this is a HA issue or just plain network. For now it works again without having changed anything.

I’m using unifi network with multiple access points. My primary setup (arc + 2x sub + 2x one), my beam are all hardwired. My five and another one are wireless.

The main issue is not knowing how this closed system works (and I love Sonos, most of the time it just works and if it just works, I don’t mind closed ecosystems). I just don’t know how to troubleshoot this issues.

Super old question, but what’s the format to add static IPs in the core.config_entries file? Does it follow the format of other entries with "data": { "host": "192.168.XX.YY" } with a delineated list? My Sonos entry doesn’t list out the names of my Sonos devices at all, it’s just one entry.

You should absolutely not be editing that by hand.

See Sonos - Home Assistant for the proper config. Just adding a single speaker’s IP is sufficient as it will request the others in the network from that seed device.

My configuration.yaml file has no entries for Sonos since they were all added via the GUI. Would this require deleting the UI integration and adding the configuration.yaml entry?

Not sure I understand the issue you’re having. If you don’t need the config entry, then discovery is working properly. Do you see any errors or warnings around Sonos in your home-assistant.log?

I’m also having the log spamming thing. Every entity goes unavailable and comes back every two minutes. I just disabled the integration, but might troubleshoot more or try the static/DHCP reservation idea. If I do, I will post more about it. Right now, I really just want to plus-one the issue. There is a bug if a static IP + manual config fixes it, but I was guessing that Sonos is turning itself off when idle and checking in l itself in every two minutes before I saw that.

Yea, this is still an issue. I have noticed that it only happens to my Sonos speakers that are on WIFI. My wired ones never become unavailable in HA, just the wifi connected ones.

I also have this problem. Been working for a very long time.
EDIT: Found the solution. When running Unraid it is important that the docker container is running om “host” not my costum network!

All wifi connectet.
Tryed reboot Sonos speaker
Disable/enable integration
Reboot HA container.

Confirming that for me too, setting the speakers IPs as static and adding them to config fixed it immediately. Looks like this:

sonos:
  media_player:
    hosts:
      - 192.168.1.120
      - 192.168.1.121