I created a backend integration and a very simple frontend plugin to allow Spotify playlist to be integrated into home assistant.
The backend integration turns given playlists into media players that will play to a given Spotify source.
the user_prefix is an optional variable I use it because I have multiple users and the users both want to use playlists with the same name e.g. “Daily Mix 1” so with the user prefix it will become “john Daily Mix 1” and “larry Daily Mix 1” for the friendly names you would see in home assistant.
This looks great, but I’m having trouble getting it configured. I’ve installed it via HACS by adding it as a custom repository. It looks like configuration is supposed to be done via the UI (Integrations tab), but the process keeps failing. Here is the error message:
Error occurred loading configuration flow for integration spotify_metafy: No module named 'custom_components.spotify_metafy.config_flow'
the user_prefix is an optional variable I use it because I have multiple users and the users both want to use playlists with the same name e.g. “Daily Mix 1” so with the user prefix it will become “john Daily Mix 1” and “larry Daily Mix 1” for the friendly names you would see in home assistant.
Yes, I use that integration for a while now. Unfortunately it stopped working as of two days ago for everyone, probably due to changes on the token backend of Spotify. So I was hoping an alternative came to rise
It sucks Spotify Connect doesn’t support group speakers, otherwise I would have used Spotify Connect on all my speakers
Possibility to chose the playing device dynamically
I just updated the back end and front end, now you can double tap or hold a playlist icon to change source.
Possibility to play shuffle
I don’t know how to make UI for this I feel like it should be part of the hold/double tap flow but I don’t have control over that UI
Start playing even if the player is idle
this might be a bug, can you give me more info about your setup? I aim to select the source and start playing music on click/tap, which should get the target device to turn on.
2020-05-31 16:41:00 ERROR (MainThread) [homeassistant.components.media_player] Error while setting up spotify_metafy platform for media_player
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/spotipy/client.py", line 172, in _internal_call
except requests.exceptions.HTTPError:
File "/usr/local/lib/python3.7/site-packages/requests/models.py", line 941, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: https://api.spotify.com/v1/playlists/37i9dQZF1E36buj8U8F3MT?additional_types=track
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 178, in _async_setup_platform
await asyncio.wait_for(asyncio.shield(task), SLOW_SETUP_MAX_WAIT)
File "/usr/local/lib/python3.7/asyncio/tasks.py", line 442, in wait_for
return fut.result()
File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/spotify_metafy/media_player.py", line 80, in setup_platform
spotify_playlist_info = spotify_media_player._spotify.playlist(uri)
File "/usr/local/lib/python3.7/site-packages/spotipy/client.py", line 494, in playlist
File "/usr/local/lib/python3.7/site-packages/spotipy/client.py", line 207, in _get
def _post(self, url, args=None, payload=None, **kwargs):
File "/usr/local/lib/python3.7/site-packages/spotipy/client.py", line 187, in _internal_call
except requests.exceptions.RetryError:
spotipy.exceptions.SpotifyException: http status: 401, code:-1 - https://api.spotify.com/v1/playlists/37i9dQZF1E36buj8U8F3MT?additional_types=track:
The access token expired
So all my sensors are gone while other integrations of Spotify are still working good.
How to fix?