Media player all of a sudden no longer available

I have installed 2021.7.1. Every since 2021.7 and 2021.7.1 I noticed that the mediaplayer is no longer available.
I removed the integration SONOS and restarted HA; by discovery I added the SONOS speakers again. I do see the integration but don’t see the two speakers in the list. They should be there…?

I then added a media.player_name It works for 2 minutes but then it prompts me its no longer available. I did update the SONOS speakers to the latest firmware. No luck thus far.

What do I do wrong. Did check the Breaking Changes, but did not find anything there.

Is there anything interesting in your logs?

Edit: just installed 2021.7.2 (Which also tells about SONOS updates) Somehow the media player is now still available.
I just leave this post for now. Will clean it up later on. Perhaps this helps some folks.

Nope, before the update to 2021.7.2 I did not see anything interesting in the logs. Again, it appears that 2021.7.2 is resolving some issues. Will update once again when it stays normal as I see now.

Sonos speaker discovery got an overhaul behind the scenes in 2021.7.0 and after some research was improved in 2021.7.2. Certain networks were causing lost discovery messages (and unavailable speakers).

@jjlawren thanks for the extra info. Good to hear they improved the whole process. Bit by bit the software is improving.

I’m still having this issue after updating to 2021.7.2. The speakers disappear less, but it still happens frequently.

I don’t know what to do. The ticket has been closed, but without success for me.

This is how frequently the drop outs occur…

To me the speakers do not become unavailable, but I have generally a similar problem.
I am currently running 2021.7.3 and all Sonos speakers, which are permanently powered run flawlessly (as prior to this update).
It is just the Living room, where the Soundbar and Sub are connected to a switchable outlet, that powers off over night and whenever no one is home, which causes problems. It’s state is not updating correctly.
Currently it always shows as playing on the source TV when powered and unavailable when the switch is not powered.
The second state is as expected, but when powered, I cannot see the right state. It should be Idle, after it gains power, but instead it immediately jumps to playing.

One of the reasons: devices/entities I downgraded my HASS to 2021.7.2!
Sonos not working proper, sure might be my mistake(why was it then working fine before 2021.7(?)), but also the media player and Zigbee/Conbee connected devices don’t behave proper after this update.

I tried to dig through the several posts and breaking things, but no luck thus far. Again a lot will be might part, but hopefully more beside me are also facing, odd issues regarding this update.
Perhaps this update show my config is completely a mess and should be rebuild. Strange that 2021.7 is making so many changes to the core that is somehow difference from the 2021.6 versions.

@hfeenstra Is you’re Sonos still stable after downgrade to 2021.7.2?

I also see the same problem as you and @linus1412 all my 4 Sonos speakers frequently disappears.
My HA setup is with split network configuration, multiple network interfaces connected.

  • nic MGMT - def gw and web interface access
  • nic WIFI - Sonos speakers (and users)
  • nic IoT - Sensors

This has been stable for several years until 2021.7… Not sure if I should try to downgrade to 2021.6.6?

When I prepared downgrade to 2021.6.6 and read the release notes I noticed a new Network integration feature. This configuration is for multicast traffic if you have multiple network adapters

https://www.home-assistant.io/blog/2021/06/02/release-20216/#network-integration

After I changed this setting to all my network adapters Sonos seem to ble stable!

Hi @slags I have 2021.7.4 installed, on purpose!
I then noticed the player is paused and 3,5 minutes later no longer available. This happens every hour once on exactly the same time. So paused and the 3,5 minutes later no longer available.

I then checked the network integration you mentioned. I do not understand what you mean by: I changed the settings. I checked the settings and have it default so it should be fine?
By having it default it worked fine in 2021.6 versions but please help me to understand what I should change so I can better understand this network setting.

@hfeenstra How is your Home Assistant setup? Do you have 1 or multiple network adapters on the HA host?
If you only have 1 adapter and ip-network at home I don’t think you need to change this setting.
Maybe it could be other failures in your network? What kind of network do you have?

As I understand this new network integration it’s only necessary to change from default if you have multiple network adapters on your Home Assistant host. This is for enabling multicast on multiple network adapters.

My home network has firewall and several vlan/ip-networks for different purposes.
Home Assistant has 3 network adapters connected eth0, eth1, eth2.
After upgrade only eth0 was configured for multicast.
I changed it to all adapters:

  • eth0 - default web interface
  • eth1 - WiFi, this network my Sonos speakers are connected. It works stable now after this Adapter was activated
  • eth2 - IoT network sensors, temperature, movement, camera, etc…

By having it default I think it worked fine in 2021.6 versions at my system also.
I’m not sure why I haven’t seen this Sonos problem before I upgraded to 2021.7… Could be other changes in this version as @linus1412 mentions in this ticket ?

Hi @slags thanks for taking the time and replying to my response!

Before 2021.6 I never had any issues regarding this problem/challenge.
My network hasn’t changed. The core HA is running on a Proxmox VM environment. It runs smoothly and again no issues were made on my network.
I have a Unifi network behind my ISP router. USG, Switch, APs. The Proxmox is LAN connected, so no wifi connection.

I only see 1, one, network adapter. So on default or on adapter: eth0 I have the same IP address. The Sonos speakers are on the same IP address range as my HA is.

I also have a Home Assistant Blue instance running since this January 2021 and this one has a different IP address and does not have a connection with the Sonos speakers.

@slags What ultimately worked for me was connecting one of my Sonos Play Ones to ethernet instead of my (original) Sonos connect.

See my comment here, wonder if you had a setup similar to mine.

Martin

@linus1412 My Sonos Playbar has always been connected to ethernet before and after this issue.

So I don’t think I had the same issue as you. Stable for a couple hours now, only activated adapter eth1 for multicast

I have three Sonos speakers and just recently they started having really bad dropouts. The outages seem to be nicely aligned which makes me think that it isn’t a WiFi access type of thing – it’s something from the other end. Anyway, this is what my speakers look like for the last 24 hours:
image

More analysis

I use opnsense as the router for my network and I have my Sonos speakers on a separate VLAN from my Home Assistant system. Because of this I have meticulously mapped out all the packets that go between the speakers and Home Assistant (and Plex as well). It gives me great control and visibility over what is allowed into and out of each network.

With this recent problem happening so frequently, I decided to take a few hours and monitor ALL packets being dropped from and to all my Sonos speakers and my Home Assistant machine. I was hoping that I could correlate the HA dropouts with packet drops. I did find that there were some packets being dropped which I enabled via tweaks to my firewall rules.

However! I enabled all dropped packets and continued to monitor the network traffic and the speakers still dropped from Home Assistant for about one and a half minutes and no packets were dropped by the router at this point. This analysis leads me to believe the problem doesn’t exist in my home network but on the server side (within the cloud). Possibly the Sonos service that Home Assistant is using to get the speaker status is going away or something. This is likely what you all are experiencing as well…

Interestingly, many of the drop outs are VERY consistent. A very high percentage of them are 1 minute 27 seconds long. Here’s a capture from about the last 24 hours of one of my speakers showing the dropouts and their consistency:

There is no cloud involved, the integration relies on UPnP/SSDP and zeroconf/mDNS discovery to find the speakers. Both of these rely on multicast UDP packets which must be specially handled if you have them on a separate subnet from HA.