@Richi
Please Open a New Issue on GitHub so we can track progress.
Not sure what is going on here, and will have to research it.
@Richi
Please Open a New Issue on GitHub so we can track progress.
Not sure what is going on here, and will have to research it.
When I want to play a playlist I get "could not play media item. validation error: device not found… What could be the problem ?
My God, it’s magnificent.
Is there a way to pick a section to which the card defaults on open? I’m usually headed straight to the user presets
@fmon
Thanks. There is no way to do that currently; I will add it to the list of feature requests though. Good idea!
@Faecon
The device not found
error is usually caused by a Spotify device being dropped from the Spotify Connect device list due to inactivity. Is is a Chromecast or Amazon Echo device perhaps? If so, then that is the issue. For those devices you must activate them via the Spotify app (e.g. mobile, desktop, web, etc).
I am currently working on a way to re-awaken Chromecast devices (without Spotcast), but am not ready to release it just yet.
No, they are a sonos devices.
when I look at the media_player.spotifyplus_oefenzaal, it is indeed inactive. Is there something wrong in de settings ?
@Faecon
Have you configured the SpotifyPlus OAuth2 Token for Sonos Devices option? The integration will not be able to awaken Sonos devices unless you have that configured.
Note that the configuration mentioned above cannot be configured via the SpotifyPlus integration configuration options; it involves running a python script, granting access, and creating a token which must then be placed in the HA config folder. If you follow the instructions it’s pretty straightforward, but can be intimidating if you are not familiar with running scripts and copying files to the HA config folder.
I wish it were a simpler process, but it’s what Spotify and Sonos require in order to make it work.
Player only shows the Power Button bottom center, no other controls showing.
Running Card V1.0.27, Integration V1.0.81
Dev Tools showing sp_user_product: premium
The music plays after selection just can’t control through the card. The media_player.spotifyplus_XXX ststus shows as “idle”, not sure if that is a cause?
@schwing
Is the power button blue in color? Or white?
What kind of device are you playing content on? The manufacturer and model of the Spotify Connect device I mean.
Also, what does the Spotify Web API Player State response sample look like when you click on “Try It”?
The power button is white.
Trying it on four different types of Sonos speakers (Arc, 3, Playbase, Move)
The response to “Try It” from the Web Player API state is “empty response”
@schwing
Have you configured the SpotifyPlus OAuth2 Token for Sonos Devices option? The integration will not be able to awaken Sonos devices unless you have that configured.
I believe so yes. I reran the test where I transferred between speakers and confirmed that the desktop Sonos app shows that the queue is not in use.
If I start music from my Spotify App and go to the SpotifyPlus card it shows the controls. If I then choose other music to play from the SpotifyPlus Card it reverts back to only showing the power button.
when running the script …Please visit this URL to authorize this application:
I get this : Firefox cannot make connection with server on 127.0.0.1:4381.
and step 8…Once all access tokens have been created, copy the Token Cache File (e.g. spotifyplus_tokens.json
) from the script current directory to your Home Assistant server configuration directory that contains persistent storage data.
how do I copy a file in ssh ?
@Faecon
When you ran the script, did it open up a browser window for you to authorize the access? It should have; I have only tested this with Chrome, but Firefox (or Edge, etc) should work the same. Note that the script will also display the Please visit this URL to authorize this application: ...
, in the event the browser did not automatically open.
As for copying a file via ssh, there are a few ways - check out this tutorial for more information. I do everything on Windows 11, then simply map a drive share to my HA config path. Another alternative would be to use the Home Assistant File Editor add-on to create the Token Cache File (e.g. spotifyplus_tokens.json
), copy / paste the contents, and then save.
Did the Python script create the spotifyplus_tokens.json
file? The contents should look something like this:
{
"SpotifyWebApiAuthCodePkce/65b708073fc0480ea92a077233ca87bd/31l77 ...": {
"access_token": "BQCs ...",
"expires_at": 1733776885.688733,
"expires_in": 3600,
"refresh_token": "AQAG ...",
"scope": [
"streaming"
],
"token_type": "Bearer"
}
}
It opens a spotify browser window, but when I press the button, it gives me the error
In my .storage map I don’t find the spotifyplus_tokens.json file …
@Faecon
To confirm, when running the AuthTokenGenerator.py
script …
It opens up Firefox and displays the Spotify authorization screen?
You then click on the Continue to the app
green button?
Did it display the following screen with the The authentication flow has completed ...
message?
Did it generate a spotifyplus_tokens.json
file in the same directory where the AuthTokenGenerator.py
file exists?
The spotifyplus_tokens.json
file will not exist in the HA /config/.storage
location.
You need to copy the spotifyplus_tokens.json
file from the AuthTokenGenerator.py
Python script directory to the HA /config/.storage
location.
@schwing
I see the problem.
It looks like I introduced a bug with the v1.0.76 release when I updated logic to correctly account for idle state.
The Spotify Web API returns an empty response for playerstate if a Sonos device is selected AND it is playing from its local queue. The Sonos device plays from its local queue when you select a media item to play via SpotifyPlus Card (control is transferred from Spotify to the Sonos device at that point).
It will be fixed in the next release, which should be today.
Thanks for bringing this to my attention, and apologies for the inconvenience.
Thank you so much for the fast response, really appreciate it. Will get to testing it.
I did get a mail from Spotify saying they had reset my password, guessing it’s due to all activity yesterday. Imagine I have to update various keys due to a password change.