Sonos does not work properly since 0.65

Mine seems to be working fine…

It might be the source. I happen to be streaming from Amazon at the moment.

Update: I also checked Spotify and a station off of TuneIn and they also worked fine.

Have you installed the latest sonos firmware? Some others fixed it that way.

Same result with Amazon, TuneIn, Pandora or Local Folder.

Yep, on the latest firmware:
Version: 8.4 (build 41350131)

Yes. I have also the latest Sonos firmware

Hmmm. I am also at the same level of Sonos code and 0.65.3 on Hass.io, but do not see this issue.
I checked through my configuration.yaml file and only saw one setting that I added in December. I can’t remember if this was related to something I saw on my Sonos or not.

frontend:
  javascript_version: es5

service: media_player.sonos_restore doesn’t seem to work either.

There was a big Sonos upgrade in 0.64 but only bug fixes in 0.65. Those of you with problems, did you skip 0.64?

If you have a firewall on Home Assistant, you now need to open TCP port 1400.

no I didn’t skip 0.64 and I also don’t have a firewall on my raspberry

I just added all ip adresses of my Sonos to the config
It seems to work now except of tunein as source

just found following message in my home assistant log

Mar 12 21:52:58 raspberrypi hass[3542]: Traceback (most recent call last):
Mar 12 21:52:58 raspberrypi hass[3542]: File “/usr/lib/python3.5/socketserver.py”, line 625, in process_request_thread
Mar 12 21:52:58 raspberrypi hass[3542]: self.finish_request(request, client_address)
Mar 12 21:52:58 raspberrypi hass[3542]: File “/usr/lib/python3.5/socketserver.py”, line 354, in finish_request
Mar 12 21:52:58 raspberrypi hass[3542]: self.RequestHandlerClass(request, client_address, self)
Mar 12 21:52:58 raspberrypi hass[3542]: File “/usr/lib/python3.5/socketserver.py”, line 681, in init
Mar 12 21:52:58 raspberrypi hass[3542]: self.handle()
Mar 12 21:52:58 raspberrypi hass[3542]: File “/usr/lib/python3.5/http/server.py”, line 422, in handle
Mar 12 21:52:58 raspberrypi hass[3542]: self.handle_one_request()
Mar 12 21:52:58 raspberrypi hass[3542]: File “/usr/lib/python3.5/http/server.py”, line 410, in handle_one_request
Mar 12 21:52:58 raspberrypi hass[3542]: method()
Mar 12 21:52:58 raspberrypi hass[3542]: File “/srv/homeassistant/lib/python3.5/site-packages/soco/events.py”, line 247, in do_NOTIFY
Mar 12 21:52:58 raspberrypi hass[3542]: subscription.events.put(event)
Mar 12 21:52:58 raspberrypi hass[3542]: File “/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/media_player/sonos.py”, line 260, in put
Mar 12 21:52:58 raspberrypi hass[3542]: self._handler(item)
Mar 12 21:52:58 raspberrypi hass[3542]: File “/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/media_player/sonos.py”, line 489, in process_avtransport_event
Mar 12 21:52:58 raspberrypi hass[3542]: self._refresh_radio(event.variables, track_info)
Mar 12 21:52:58 raspberrypi hass[3542]: File “/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/media_player/sonos.py”, line 634, in _refresh_radio
Mar 12 21:52:58 raspberrypi hass[3542]: if fav.reference.get_uri() == media_info[‘CurrentURI’]:
Mar 12 21:52:58 raspberrypi hass[3542]: File “/srv/homeassistant/lib/python3.5/site-packages/soco/data_structures.py”, line 831, in reference
Mar 12 21:52:58 raspberrypi hass[3542]: getattr(self, ‘resource_meta_data’))[0]
Mar 12 21:52:58 raspberrypi hass[3542]: File “/srv/homeassistant/lib/python3.5/site-packages/soco/data_structures_entry.py”, line 52, in from_didl_string
Mar 12 21:52:58 raspberrypi hass[3542]: item = cls.from_element(elt)
Mar 12 21:52:58 raspberrypi hass[3542]: File “/srv/homeassistant/lib/python3.5/site-packages/soco/data_structures.py”, line 492, in from_element
Mar 12 21:52:58 raspberrypi hass[3542]: DidlResource.from_element(res_elt))
Mar 12 21:52:58 raspberrypi hass[3542]: File “/srv/homeassistant/lib/python3.5/site-packages/soco/data_structures.py”, line 172, in from_element
Mar 12 21:52:58 raspberrypi hass[3542]: raise Exception('Could not create Resource from Element: ’
Mar 12 21:52:58 raspberrypi hass[3542]: Exception: Could not create Resource from Element: protocolInfo not found (required).

Thanks, I will fix that issue.

What did your configuration look like before you added individual IP addresses?

before

media_player:
   - platform: sonos

after

media_player:
   - platform: sonos
     hosts:
       - 192.168.200.24
       - 192.168.200.23

if you need more information or more logs or whatever please let me know
happy to help to fix the issue

No error’s in log, shows setup successful:

2018-03-12 22:17:37 INFO (MainThread) [homeassistant.components.media_player] Setting up media_player.sonos
2018-03-12 22:17:42 DEBUG (Thread-16) [homeassistant.components.media_player.sonos] Added 3 Sonos speakers

@Coolie1101Can you also confirm that it worked in 0.64.3 for you, you did not skip a release? Also, does it help for you to list players individually like shown above?

Yes, it worked in 0.64.3, and I did not skip any release.

Down graded to 0.64.3 and it works fine.
image

Thanks. Please also answer my other question so I know where to look.

Hello again.

I have a test version up now. Please copy this file to config/custom_components/media_player/sonos.py and restart.

Also set this logger configuration in configuration.yaml:

logger:
  default: warning
  logs:
    custom_components.media_player.sonos: debug
    homeassistant.components.media_player.sonos: debug

This should give you a debug log Ignoring invalid favorite ‘…’ that I would like to see. Thanks!

this is my log after applying your code and I tried to group my sonos player with home assistant

2018-03-13 22:51:11 DEBUG (Thread-6) [custom_components.media_player.sonos] Added 2 Sonos speakers
2018-03-13 22:51:18 WARNING (MainThread) [homeassistant.setup] Setup of homematic is taking over 10 seconds.
2018-03-13 22:53:00 ERROR (Thread-22) [custom_components.media_player.sonos] Error on join with UPnP Error 402 received: Invalid Args from 192.168.200.23

But at least it seems to work now

Hopefully fixed with version 0.65.5.