core: Sonos integration cannot start Spofify playlists
The problem
Since 2021.7.0 Sonos integration doesn’t start Spotify playlist on my devices with the same service call it used to work on 2021.6.6.
Tried calling it with media_content_type: music or media_content_type: playlist, but both results in the same UPNP error 800, which only rarely occurred before, now all the time.
What is version of Home Assistant Core has the issue?
2021.7.0
What was the last working version of Home Assistant Core?
2021.6.6
What type of installation are you running?
Home Assistant Supervised
Integration causing the issue
Sonos
Link to integration documentation on our website
https://www.home-assistant.io/integrations/sonos/
Example YAML snippet
service: media_player.play_media
target:
entity_id: media_player.sonos_kitchen
data:
media_content_type: music
media_content_id: spotify:user:spotify:playlist:37i9dQZF1DX7KNKjOK0o75
Anything in the logs that might be useful for us?
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/sonos/helpers.py", line 25, in wrapper
return funct(*args, **kwargs)
File "/usr/src/homeassistant/homeassistant/components/sonos/media_player.py", line 539, in play_media
share_link.add_share_link_to_queue(media_id)
File "/usr/local/lib/python3.9/site-packages/pysonos/plugins/sharelink.py", line 174, in add_share_link_to_queue
response = self.soco.avTransport.AddURIToQueue(
File "/usr/local/lib/python3.9/site-packages/pysonos/services.py", line 207, in _dispatcher
return self.send_command(action, *args, **kwargs)
File "/usr/local/lib/python3.9/site-packages/pysonos/services.py", line 503, in send_command
self.handle_upnp_error(response.text)
File "/usr/local/lib/python3.9/site-packages/pysonos/services.py", line 556, in handle_upnp_error
raise SoCoUPnPException(
pysonos.exceptions.SoCoUPnPException: UPnP Error 800 received: from 192.168.8.195
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/aiohttp/web_protocol.py", line 422, in _handle_request
resp = await self._request_handler(request)
File "/usr/local/lib/python3.9/site-packages/aiohttp/web_app.py", line 499, in _handle
resp = await handler(request)
File "/usr/local/lib/python3.9/site-packages/aiohttp/web_middlewares.py", line 119, in impl
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 60, in security_filter_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 77, in forwarded_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 24, in request_context_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 78, in ban_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 144, in auth_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 135, in handle
result = await result
File "/usr/src/homeassistant/homeassistant/components/api/__init__.py", line 376, in post
await hass.services.async_call(
File "/usr/src/homeassistant/homeassistant/core.py", line 1491, in async_call
task.result()
File "/usr/src/homeassistant/homeassistant/core.py", line 1526, in _execute_service
await handler.job.target(service_call)
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 213, in handle_service
await self.hass.helpers.service.entity_service_call(
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 658, in entity_service_call
future.result() # pop exception if have
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 811, in async_request_call
await coro
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 695, in _handle_entity_call
await result
File "/usr/src/homeassistant/homeassistant/components/media_player/__init__.py", line 691, in async_play_media
await self.hass.async_add_executor_job(
File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/src/homeassistant/homeassistant/components/sonos/helpers.py", line 34, in wrapper
raise HomeAssistantError(f"Error calling {function}: {err}") from err
homeassistant.exceptions.HomeAssistantError: Error calling play_media: UPnP Error 800 received: from 192.168.8.195
Additional information
Perhaps related to #51866 ?
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 1
- Comments: 28 (21 by maintainers)
Can you please try with pysonos 0.0.53? One way to do that is to install the current 2017.7.x integration as a custom component and then change the
requirementsfield inmanifest.json.The dynamic lookup was added here: https://github.com/amelchio/pysonos/pull/97 – we used hardcoded identifiers before that.
It was supposed to be an improvement because the wrong service would never be used but obviously it is not an improvement for those affected by this issue.