SpotifyPlus Integration

Hmm… intresting :slight_smile: same result :slight_smile: Only 10 playlist from my favourites

1 Like

@mackbeth
OK, I think I know what’s going on. The Spotify Web API will only return user-defined playlists in the results. It will not return any Spotify Algorithmic playlists (e.g. “Daily Mix 1”, “Discover Weekly”, and other “Made For You” playlists). It will also not return playlist folders.

Can you compare some of the items in your online list that are missing from the SpotifyPlus service results to see if they are playlist folders or “Made For You” content? If all of them are like that, then it explains it (Spotify Web API will not return them).

If the missing items are truly playlists, can you provide the Spotify Playlist URI (e.g. spotify:playlist:xxxxxx) value? or the url link to the spotify.com page of the playlist? It could be something to do with country / market limitations on what can be returned via the API as well. For example, if content items in the playlist are for US-based consumers only, it may not return it since you have a PL country / market designation.

Ok, here is list by creator:)

I added one more list from some user, na voile - 11 results:)
image

You are right… only non by- Spotify created are returned… i thought that all of them will be… :slight_smile: - I think it is worth to mention on your integration documentation :slight_smile: So there is no chance to display my favorited lists… which is main fucntionality which I’m searching :slight_smile:
So API doesn’t return any Spotify created things… I noticed this also i.e. when I search some Spotify list… This was change by Spotify recently, right? So sad to me, as user who pay for this content created by spotife… This change have no sense to me at alll…

Before API changes I use Fondberg Spotify Lovelace Playlist card… but… card died recently after API changes…

But what about my favourite tracks? Is any chance to got all of my 825 track on card? :slight_smile:

Btw… thanks for help and a lot of patient to me:)

1 Like

But there is trick…

I noticed, that via User Preset I can add Spotify playlist…

Also noticed, that daily mix and other generated for user list have fixed uri … I check URI saved 1 year ago, when I put it to browser or to user preset, it will play current Daily mix list…

So now script to get from web app URI to all favorite playlist URi’s, and copy them to json User Preset file:) - an way tro execute to sync :slight_smile:
Unfortunately I don;t have any coding skills (especially web - never) now after years in corpo as Test Architect … :frowning:

@mackbeth
I updated the SpotifyPlus Get Playlist Favorites documentation with our findings. Thanks for bringing that to my attention; the Spotify Development team removed that functionality without warning, and I had not had time to revise the docs until now.

I currently have a limit of 200 set for the maximum number of items to return. I can make this number configurable for each section type (e.g. tracks, albums, artists, playlists, shows, audiobooks, episodes), which will be available in the next release of the SpotifyPlus Card. Just keep in mind that the larger the number you allow, the slower the response will be.

As for User Presets, you are correct - you can define presets in the JSON file (or in the card configuration itself via the userPresets option). This includes the various Spotify “Made For You” content items, as their playlist ID’s do not change. Check out the How do I find the Spotify “Daily Mix n” playlist id wiki FAQ page for instructions on how to find the playlist URI value for a Spotify playlist. You can also use the “Copy Playlist Preset Info to Clipboard” action item from the Search Playlists details (see screen capture below) to format the userPreset config entry for you. Note you will have to modify the output a little for the userPreset.json format. I am going to add another action item to “Copy Playlist Preset JSON to Clipboard”, which will format the JSON for you; just haven’t had the time to do that yet.

image

Hope it helps!

@mackbeth

Sorry, but I can’t provide a script for this as it violates Spotify’s Terms of Service (no screen scraping). Check out the How do I find the Spotify “Daily Mix n” playlist id wiki FAQ page for instructions on how to find the playlist URI value for a Spotify playlist. Then it’s a matter of building the userPreset.json entries; I know it’s a little bit of work up front, but a one-time thing for your initial playlists.

Thanks a loooooot!!!

I know that such harvesting spotify web is prohibited… anyway, looking for next release of card - it will really be useful for me then:)

1 Like

@mackbeth
FYI - just released a new version of the SpotifyPlus Card Dashboard that addresses some of your concerns.

[ 1.0.18 ] - 2024/12/11

  • This release requires the SpotifyPlus Integration v1.0.69+ release; please make sure you update the SpotifyPlus integration prior to updating this SpotifyPlus Card release.
  • Added albumFavBrowserItemsLimit config option that specifies the maximum number of items to be returned by the Album Favorites media browser.
  • Added artistFavBrowserItemsLimit config option that specifies the maximum number of items to be returned by the Artist Favorites media browser.
  • Added audiobookFavBrowserItemsLimit config option that specifies the maximum number of items to be returned by the Audiobook Favorites media browser.
  • Added episodeFavBrowserItemsLimit config option that specifies the maximum number of items to be returned by the Episode Favorites media browser.
  • Added playlistFavBrowserItemsLimit config option that specifies the maximum number of items to be returned by the Playlist Favorites media browser.
  • Added showFavBrowserItemsLimit config option that specifies the maximum number of items to be returned by the Show Favorites media browser.
  • Added trackFavBrowserItemsLimit config option that specifies the maximum number of items to be returned by the Track Favorites media browser.
  • Added “Copy X Preset JSON to Clipboard” action for all section detail displays that contain a “Copy X Preset Info to Clipboard” action. This will create a user-preset JSON format configuration entry for the selected media and copy it to the clipboard; the entry can then be pasted into the userPresets.json file, which will create a user preset for the media item.

@Grandmasterseven
FYI - just released a new version of the SpotifyPlus Card Dashboard

[ 1.0.18 ] - 2024/12/11

  • This release requires the SpotifyPlus Integration v1.0.69+ release; please make sure you update the SpotifyPlus integration prior to updating this SpotifyPlus Card release.
  • Added playerVolumeControlsHideLevels config option that hides volume level numbers and percentages in the volume controls area of the Player section form. Volume slider control is not affected by this setting.

Thanks, it’s working. I just needed to clear the browser cache.

One more question:

Is it possible to modify the ha-md-button-menu font type to a custom type.?

1 Like

@Grandmasterseven
Not sure on that, as those are Material Design controls. There might be something in the link above, but not sure.

You might also be able to use card-mod, but not for sure on that either.

@thlucas You did my day better:
image

Thank a loooot for you great work!!

1 Like

One more question.

To wake up device I use service to transfer playback.

What is specials:

My Spotify device is Android TV box with Spotify application. It is always accessible via Spotify application, I can always transfer playback when I use SPotify app on moible.

I noticed, that sometimes, i got such erroe (.169 is IP of this Android device) :slight_smile:

Error: SAM0001E - An unhandled exception occured while processing method “GetInformation”. HTTPConnectionPool(host=‘192.168.1.169’, port=52721): Max retries exceeded with url: /zc?action=getInfo&version=2.7.1 (Caused by NewConnectionError(‘<urllib3.connection.HTTPConnection object at 0x7f05037ec140>: Failed to establish a new connection: [Errno 111] Connection refused’))

Could you explain a little bit more logic behind starting playback?

Let assume… spotify was not playing over night.
Steps:
Turn on Spotify integration via. spotify card.
Click play… and then I got message “Device not found”
So I have script, that when I turn On integration, I call this service to “force” connect or wake up mu Spotify app on this Android device…

@mackbeth
Does your Android TV use Chromecast to play Spotify on the TV? Chromecast devices are currently not fully supported by the SpotifyPlus integration. You can perform player functions (e.g. pause, resume, next track, etc) if the device is the currently active player, but you can’t wake up a device or initiate play of tracks / context.

Also, do you have the Devices section enabled in the SpotifyPlus Card configuration? If so, does the Android TV show up there? It will look something like this:

From the Devices section form, you can click and hold on a device to view its details. The following are details for my “Bose-ST10-1” device:

If your Android TV shows up in the list, view it’s details and reply with a screen capture. That should tell me if it uses Chromecast or not.

No, in SPotify App I set this device as Spotify connect. type:


Now I tried another thing. In car using mobile I played spotify around 3hr ago.
Now at home I check card state. No album cover. but media control buttons visble - looks like Spotify is in Idle state, and integration is not turned off (btw, when Integration will be turned Off ? ) - so I click play.
I got error something like (forgot to picture :frowning: ) : “restriction violated”.
I go to device section and click on MiBox device to transfer playback - same error…hmmm… I realize that I didn’t click “refresh” button there…
So I clicked. Then I tried to click on MiBox around 4 times more - same error.

I checked logs:

Warnings visible (A55 is my mobile phone, and at this moment spotify app was disabled, so it was not visible on device list after refresh) :

Spotify Connect device ‘Maciek A55’ could not be resolved; please ensure that the specified device is powered on and available on the local network

And this is true - no Spotify app on mobile phone.
Second error just after this:

Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by ‘ProtocolError(‘Connection aborted.’, ConnectionResetError(104, ‘Connection reset by peer’))’: /v1/me/player/play?device_id=Maciek%20A55

And third error


> [139659589602032] Unexpected exception
> Traceback (most recent call last):
>   File "/config/custom_components/spotifyplus/media_player.py", line 5976, in service_spotify_player_media_play_context
>     self.data.spotifyClient.PlayerMediaPlayContext(contextUri, offsetUri, offsetPosition, positionMS, deviceId, delay)
>     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>   File "/usr/local/lib/python3.13/site-packages/spotifywebapipython/spotifyclient.py", line 11448, in PlayerMediaPlayContext
>     self.MakeRequest('PUT', msg)
>     ~~~~~~~~~~~~~~~~^^^^^^^^^^^^
>   File "/usr/local/lib/python3.13/site-packages/spotifywebapipython/spotifyclient.py", line 825, in MakeRequest
>     msg.ResponseData = self._CheckResponseForErrors(msg, response)
>                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^
>   File "/usr/local/lib/python3.13/site-packages/spotifywebapipython/spotifyclient.py", line 629, in _CheckResponseForErrors
>     raise SpotifyWebApiError(errCode, errMessage, msg.MethodName, response.reason, _logsi)
> spotifywebapipython.spotifywebapierror.SpotifyWebApiError: SAM1001E - Spotify Web API returned an error status while processing the "PlayerMediaPlayContext" method.
> Status: 404 - Not Found
> Message: "Device not found"
> 
> During handling of the above exception, another exception occurred:
> 
> Traceback (most recent call last):
>   File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 245, in handle_call_service
>     response = await hass.services.async_call(
>                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>     ...<7 lines>...
>     )
>     ^
>   File "/usr/src/homeassistant/homeassistant/core.py", line 2802, in async_call
>     response_data = await coro
>                     ^^^^^^^^^^
>   File "/usr/src/homeassistant/homeassistant/core.py", line 2845, in _execute_service
>     return await target(service_call)
>            ^^^^^^^^^^^^^^^^^^^^^^^^^^
>   File "/config/custom_components/spotifyplus/__init__.py", line 1274, in service_handle_spotify_command
>     await hass.async_add_executor_job(entity.service_spotify_player_media_play_context, context_uri, offset_uri, offset_position, position_ms, device_id, delay)
>   File "/usr/local/lib/python3.13/concurrent/futures/thread.py", line 58, in run
>     result = self.fn(*self.args, **self.kwargs)
>   File "/config/custom_components/spotifyplus/media_player.py", line 273, in wrapper
>     result = func(self, *args, **kwargs)
>   File "/config/custom_components/spotifyplus/media_player.py", line 5991, in service_spotify_player_media_play_context
>     raise HomeAssistantError(ex.Message)
> homeassistant.exceptions.HomeAssistantError: Device not found

Then I go to services and I call just:

action: spotifyplus.player_media_play_context
metadata: {}
data:
entity_id: media_player.spotifyplus_xxxbeth1
context_uri: spotify:playlist:37i9dQZEVXcNILzkLv0HSy
device_id: MiBox

And like nothing happend else, my playlist was played without any warnings or errors…

If I may suppose something, maybe starting playing from card causes troubles?

As I said, on MiBox (android TV) Spotify app is always active, and device is always in network…

Now I checked MiBox data (nothing is played now)

image

image

To be honest, for me (as I don;t know logic behind card) from GUI throw errors, nothing else I did, from service like just nothing strat playing :smiley:

Anyway, I hope that may troubles help whole community (of course after your great investigation) to get finally good spotify support in AH, it is prtoblematic that most popular way to listen music is not supportd by Spotify company in case of home automations…

@mackbeth
I don’t think it’s an issue of “starting playing from card”, as the card calls the integration service to play the media context.

The Spotify Connect device ‘Maciek A55’ could not be resolved; please ensure that the specified device is powered on and available on the local network indicates the device was not registered to zeroconf on the network, or that the device is in a “deep sleep” mode. This is proven by the fact that the Spotify Mobile App could not find the device either.

I think what is happening is that the device went into a “deep sleep” mode. You then went to the card Device section and clicked on MiBox to transfer playback. This caused the MiBox device to log back in (or try to anyway) to Spotify Connect, but it received an error during that process. You then issued the call to the player_media_play_context service (via developer tools \ actions) and it started to play immediately with no error. It worked for the service call, as the transfer playback call (issued from the card, that failed) woke the device up from “deep sleep” and it was awake and ready when the player_media_play_context service request was processed.

It sounds like there is some extra initialization communication happening between the MiBox device and the Spotify Connect process. I have seen some similar activity with TCL Roku TV devices, and have code logic in place to account for those devices. Note that the special code logic only applies to TCL Roku devices, and not other devices (e.g. Android TV, etc).

The TCL Roku logic contains extra code to wait for certain responses from the device in the Spotify Connect login process. I wonder if something similar is taking place for Android TV devices maybe? I would need you to run some detailed Wireshark network traces to see if the Android TV is doing something similar, as I don’t have an Android TV device to test with.

Hi, this sound very interesting :slight_smile:
Could explain what seevice call is made when I clicknplaynon cars, when I select devixe ? it may help me to test different scenario:)

Today morning ( 6HRS after yesterday testing) i woke up… and just call sercice exactly the same as above. Spotify starts to play on MiBox without any errors…

but in SpotifyPlus history i see, that 1hr before it somehow spotify play something…when I was sleeeping, i did nothing:

refcarriwnis mybservice call, but… something happend a litle eralier and it was fornsure not my interaction :slight_smile:

And now I got another test :slight_smile:
I was drive by car, so music was played through my A55 mobile phone.

I come to home, stop playing.
Go to spotify card - click “Play” - and error “Unknown device”
SO I go to devices section, and noticed, that in title I have “A55” - so integration still stick to last device which was in use.
So this is unknown device, as mobile app is closed on phone.

So I click on MiBox - I got error “unkown device”
Then I go to player section and click play - now music is played through MiBox, so context was switched to this device…

In logs:

31m2024-12-13 08:49:01.900 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [139659762505408] Unexpected exception
Traceback (most recent call last):
  File "/config/custom_components/spotifyplus/media_player.py", line 7280, in service_spotify_player_transfer_playback
    self.data.spotifyClient.PlayerTransferPlayback(deviceId, play, delay, refreshDeviceList=False)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/spotifywebapipython/spotifyclient.py", line 12739, in PlayerTransferPlayback
    self.PlayerMediaResume()
    ~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/local/lib/python3.13/site-packages/spotifywebapipython/spotifyclient.py", line 11830, in PlayerMediaResume
    self.MakeRequest('PUT', msg)
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/spotifywebapipython/spotifyclient.py", line 825, in MakeRequest
    msg.ResponseData = self._CheckResponseForErrors(msg, response)
                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/spotifywebapipython/spotifyclient.py", line 629, in _CheckResponseForErrors
    raise SpotifyWebApiError(errCode, errMessage, msg.MethodName, response.reason, _logsi)
spotifywebapipython.spotifywebapierror.SpotifyWebApiError: SAM1001E - Spotify Web API returned an error status while processing the "PlayerMediaResume" method.
Status: 403 - Forbidden
Message: "Player command failed: Restriction violated"

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 245, in handle_call_service
    response = await hass.services.async_call(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<7 lines>...
    )
    ^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2802, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2845, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1007, in entity_service_call
    single_response = await _handle_entity_call(
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^
        hass, entity, func, data, call.context
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1079, in _handle_entity_call
    result = await task
             ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/media_player/__init__.py", line 889, in async_select_source
    await self.hass.async_add_executor_job(self.select_source, source)
  File "/usr/local/lib/python3.13/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/spotifyplus/media_player.py", line 273, in wrapper
    result = func(self, *args, **kwargs)
  File "/config/custom_components/spotifyplus/media_player.py", line 902, in select_source
    self.service_spotify_player_transfer_playback(
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
        source,
        ^^^^^^^
        play=True,
        ^^^^^^^^^^
        refreshDeviceList=True,
        ^^^^^^^^^^^^^^^^^^^^^^^
        forceActivateDevice=True)
        ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/spotifyplus/media_player.py", line 7333, in service_spotify_player_transfer_playback
    raise HomeAssistantError(ex.Message)
homeassistant.exceptions.HomeAssistantError: Player command failed: Restriction violatede[0m

and

e[31m2024-12-13 08:49:01.900 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [139659762505408] Unexpected exception
Traceback (most recent call last):
  File "/config/custom_components/spotifyplus/media_player.py", line 7280, in service_spotify_player_transfer_playback
    self.data.spotifyClient.PlayerTransferPlayback(deviceId, play, delay, refreshDeviceList=False)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/spotifywebapipython/spotifyclient.py", line 12739, in PlayerTransferPlayback
    self.PlayerMediaResume()
    ~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/local/lib/python3.13/site-packages/spotifywebapipython/spotifyclient.py", line 11830, in PlayerMediaResume
    self.MakeRequest('PUT', msg)
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/spotifywebapipython/spotifyclient.py", line 825, in MakeRequest
    msg.ResponseData = self._CheckResponseForErrors(msg, response)
                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/spotifywebapipython/spotifyclient.py", line 629, in _CheckResponseForErrors
    raise SpotifyWebApiError(errCode, errMessage, msg.MethodName, response.reason, _logsi)
spotifywebapipython.spotifywebapierror.SpotifyWebApiError: SAM1001E - Spotify Web API returned an error status while processing the "PlayerMediaResume" method.
Status: 403 - Forbidden
Message: "Player command failed: Restriction violated"

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 245, in handle_call_service
    response = await hass.services.async_call(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<7 lines>...
    )
    ^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2802, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2845, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1007, in entity_service_call
    single_response = await _handle_entity_call(
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^
        hass, entity, func, data, call.context
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1079, in _handle_entity_call
    result = await task
             ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/media_player/__init__.py", line 889, in async_select_source
    await self.hass.async_add_executor_job(self.select_source, source)
  File "/usr/local/lib/python3.13/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/spotifyplus/media_player.py", line 273, in wrapper
    result = func(self, *args, **kwargs)
  File "/config/custom_components/spotifyplus/media_player.py", line 902, in select_source
    self.service_spotify_player_transfer_playback(
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
        source,
        ^^^^^^^
        play=True,
        ^^^^^^^^^^
        refreshDeviceList=True,
        ^^^^^^^^^^^^^^^^^^^^^^^
        forceActivateDevice=True)
        ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/spotifyplus/media_player.py", line 7333, in service_spotify_player_transfer_playback
    raise HomeAssistantError(ex.Message)

and 3rd type:


e[31m2024-12-13 08:49:01.900 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [139659762505408] Unexpected exception
Traceback (most recent call last):
  File "/config/custom_components/spotifyplus/media_player.py", line 7280, in service_spotify_player_transfer_playback
    self.data.spotifyClient.PlayerTransferPlayback(deviceId, play, delay, refreshDeviceList=False)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/spotifywebapipython/spotifyclient.py", line 12739, in PlayerTransferPlayback
    self.PlayerMediaResume()
    ~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/local/lib/python3.13/site-packages/spotifywebapipython/spotifyclient.py", line 11830, in PlayerMediaResume
    self.MakeRequest('PUT', msg)
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/spotifywebapipython/spotifyclient.py", line 825, in MakeRequest
    msg.ResponseData = self._CheckResponseForErrors(msg, response)
                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/spotifywebapipython/spotifyclient.py", line 629, in _CheckResponseForErrors
    raise SpotifyWebApiError(errCode, errMessage, msg.MethodName, response.reason, _logsi)
spotifywebapipython.spotifywebapierror.SpotifyWebApiError: SAM1001E - Spotify Web API returned an error status while processing the "PlayerMediaResume" method.
Status: 403 - Forbidden
Message: "Player command failed: Restriction violated"

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 245, in handle_call_service
    response = await hass.services.async_call(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<7 lines>...
    )
    ^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2802, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2845, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1007, in entity_service_call
    single_response = await _handle_entity_call(
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^
        hass, entity, func, data, call.context
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1079, in _handle_entity_call
    result = await task
             ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/media_player/__init__.py", line 889, in async_select_source
    await self.hass.async_add_executor_job(self.select_source, source)
  File "/usr/local/lib/python3.13/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/spotifyplus/media_player.py", line 273, in wrapper
    result = func(self, *args, **kwargs)
  File "/config/custom_components/spotifyplus/media_player.py", line 902, in select_source
    self.service_spotify_player_transfer_playback(
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
        source,
        ^^^^^^^
        play=True,
        ^^^^^^^^^^
        refreshDeviceList=True,
        ^^^^^^^^^^^^^^^^^^^^^^^
        forceActivateDevice=True)
        ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/spotifyplus/media_player.py", line 7333, in service_spotify_player_transfer_playback
    raise HomeAssistantError(ex.Message)
homeassistant.exceptions.HomeAssistantError: Player command failed: Restriction violatede[0m

and
4th:

31m2024-12-13 08:48:27.789 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [139659762505408] Unexpected exception
Traceback (most recent call last):
  File "/config/custom_components/spotifyplus/media_player.py", line 273, in wrapper
    result = func(self, *args, **kwargs)
  File "/config/custom_components/spotifyplus/media_player.py", line 671, in media_play
    self.data.spotifyClient.PlayerMediaResume()
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/local/lib/python3.13/site-packages/spotifywebapipython/spotifyclient.py", line 11830, in PlayerMediaResume
    self.MakeRequest('PUT', msg)
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/spotifywebapipython/spotifyclient.py", line 825, in MakeRequest
    msg.ResponseData = self._CheckResponseForErrors(msg, response)
                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/spotifywebapipython/spotifyclient.py", line 629, in _CheckResponseForErrors
    raise SpotifyWebApiError(errCode, errMessage, msg.MethodName, response.reason, _logsi)
spotifywebapipython.spotifywebapierror.SpotifyWebApiError: SAM1001E - Spotify Web API returned an error status while processing the "PlayerMediaResume" method.
Status: 404 - Not Found
Message: "Device not found"

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 245, in handle_call_service
    response = await hass.services.async_call(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<7 lines>...
    )
    ^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2802, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2845, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1007, in entity_service_call
    single_response = await _handle_entity_call(
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^
        hass, entity, func, data, call.context
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1079, in _handle_entity_call
    result = await task
             ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/media_player/__init__.py", line 827, in async_media_play
    await self.hass.async_add_executor_job(self.media_play)
  File "/usr/local/lib/python3.13/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/spotifyplus/media_player.py", line 287, in wrapper
    raise HomeAssistantError(ex.Message)
homeassistant.exceptions.HomeAssistantError: Device not founde[0m

Hi!

is it possible to remove the marked items in css?

@Grandmasterseven
I cannot remove those without a LOT of work, as they are tied to various actions. For example:

  • the leading icons indicate what type of item it is (e.g. album, artist, track), and is also a clickable link directly to the Spotify web page for that item.
  • the “heart” icons allow you to add / remove the favorite for that item. An outline of the heart indicates it is not a favorite, while a solid red heart indicates it is a favorite / followed.
  • the “…” is an action items menu, which allows you to select additional options for that item.

With that said, you might be able to use card_mod to control the visibility of those items. I am not a card_mod expert, so you will have to tackle that one on your own.