Anybody has had some success with getting the spotty media player to play some special playlists? I want the Daily Mixes…
spotifyconnect:
alias: "Daily Mix 1"
sequence:
- service: media_player.play_media
data:
entity_id: media_player.spotify
source: "raspotify (automator)"
media_content_type: "playlist"
media_content_id: "spotify:station:user:<USERNAME>:cluster:6RAx8RRxoHeJIqD2d0EjOa"
This is my script where I try to call the playlist.
The url generated by spotify is: https://open.spotify.com/station/user/<USERNAME>/cluster/6RAx8RRxoHeJIqD2d0EjOa
so the URI should be correct.
However the spotify component says
Oct 31 13:17:44 automator hass[691]: 2017-10-31 13:17:44 INFO (MainThread) [homeassistant.core] Bus:Handling <Event call_service[L]: service_data=entity_id=media_player.spotify, media_content_id=spotify:station:user:<USERNAME>:cluster:6RAx8RRxoHeJIqD2d0EjOa, media_content_type=playlist, service=play_media, service_call_id=1973934416-131, domain=media_player>
Oct 31 13:17:45 automator hass[691]: 2017-10-31 13:17:45 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Oct 31 13:17:45 automator hass[691]: Traceback (most recent call last):
Oct 31 13:17:45 automator hass[691]: File "/srv/homeassistant/lib/python3.4/site-packages/spotipy/client.py", line 121, in _internal_call
Oct 31 13:17:45 automator hass[691]: r.raise_for_status()
Oct 31 13:17:45 automator hass[691]: File "/srv/homeassistant/lib/python3.4/site-packages/requests/models.py", line 928, in raise_for_status
Oct 31 13:17:45 automator hass[691]: raise HTTPError(http_error_msg, response=self)
Oct 31 13:17:45 automator hass[691]: requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://api.spotify.com/v1/me/player/play
Oct 31 13:17:45 automator hass[691]: During handling of the above exception, another exception occurred:
Oct 31 13:17:45 automator hass[691]: Traceback (most recent call last):
Oct 31 13:17:45 automator hass[691]: File "/usr/lib/python3.4/asyncio/tasks.py", line 233, in _step
Oct 31 13:17:45 automator hass[691]: result = coro.throw(exc)
Oct 31 13:17:45 automator hass[691]: File "/srv/homeassistant/lib/python3.4/site-packages/homeassistant/core.py", line 1026, in _event_to_service_call
Oct 31 13:17:45 automator hass[691]: yield from service_handler.func(service_call)
Oct 31 13:17:45 automator hass[691]: File "/srv/homeassistant/lib/python3.4/site-packages/homeassistant/components/media_player/__init__.py", line 408, in async_service_handler
Oct 31 13:17:45 automator hass[691]: yield from getattr(player, method['method'])(**params)
Oct 31 13:17:45 automator hass[691]: File "/usr/lib/python3.4/asyncio/futures.py", line 388, in __iter__
Oct 31 13:17:45 automator hass[691]: yield self # This tells Task to wait for completion.
Oct 31 13:17:45 automator hass[691]: File "/usr/lib/python3.4/asyncio/tasks.py", line 286, in _wakeup
Oct 31 13:17:45 automator hass[691]: value = future.result()
Oct 31 13:17:45 automator hass[691]: File "/usr/lib/python3.4/asyncio/futures.py", line 277, in result
Oct 31 13:17:45 automator hass[691]: raise self._exception
Oct 31 13:17:45 automator hass[691]: File "/usr/lib/python3.4/concurrent/futures/thread.py", line 54, in run
Oct 31 13:17:45 automator hass[691]: result = self.fn(*self.args, **self.kwargs)
Oct 31 13:17:45 automator hass[691]: File "/srv/homeassistant/lib/python3.4/site-packages/homeassistant/components/media_player/spotify.py", line 257, in play_media
Oct 31 13:17:45 automator hass[691]: self._player.start_playback(**kwargs)
Oct 31 13:17:45 automator hass[691]: File "/srv/homeassistant/lib/python3.4/site-packages/spotipy/client.py", line 913, in start_playback
Oct 31 13:17:45 automator hass[691]: return self._put(self._append_device_id("me/player/play", device_id), payload=data)
Oct 31 13:17:45 automator hass[691]: File "/srv/homeassistant/lib/python3.4/site-packages/spotipy/client.py", line 190, in _put
Oct 31 13:17:45 automator hass[691]: return self._internal_call('PUT', url, payload, kwargs)
Oct 31 13:17:45 automator hass[691]: File "/srv/homeassistant/lib/python3.4/site-packages/spotipy/client.py", line 126, in _internal_call
Oct 31 13:17:45 automator hass[691]: headers=r.headers)
Oct 31 13:17:45 automator hass[691]: spotipy.client.SpotifyException: http status: 400, code:-1 - https://api.spotify.com/v1/me/player/play:
Oct 31 13:17:45 automator hass[691]: Non supported context uri