SpotifyPlus Custom Integration

Hi @thlucas,

i’d like to use the seek function to rewind or fast-forward for e.g. 10 seconds. Is there a way to do that? Like using the current track position and add 10 seconds?

@meiser
You would have to issue a call to get the current playstate service, scrape some return values, and then issue a call to the seek service.

If you would, add a feature request on the SpotifyPlus wiki, and I will see if I can get it added soon. It might be a couple of weeks, as I’m getting ready to release a SpotifyPlus Card UI soon and am putting some final touches on things.

Calling Player Activate Devices, I get this error message.

SAM0001E - An unhandled exception occured while processing method “PlayerActivateDevices”. SpotifyZeroconfApiError.init() missing 3 required positional arguments: ‘message’, ‘methodName’, and ‘reason’

@Swordnut
You need to specify your Spotify LoginId, Username, and Password in the integration configuration options. Activating a Spotify Connect device requires these values.

Thank you for reporting this, as the error message is totally unclear! I am making changes to correct that.

FYI - just released a new version of the SpotifyPlus integration

[ 1.0.60 ] - 2024/10/04

  • Added service player_media_seek to seek to the given absolute or relative position in the user’s currently playing track for the specified Spotify Connect device.
  • Updated service get_show_favorites to include the exclude_audiobooks argument, which allows you to limit the results to only podcast items (by default). For some reason, the Spotify Web API returns both audiobook and podcast items.
  • Updated Spotify Connect device processing to only require the userid and password configuration options when authenticating to devices that require user and password values. Some devices only require a loginid value (e.g. spotifyd, Spotify Connect AddOn, librespot, Sonos, etc). The user should not have to specify userid and password options if they are not required!
  • Updated service description strings to correct HASSFest validation errors on GitHub.
  • Updated underlying spotifywebapiPython package requirement to version 1.0.106.
1 Like

I have set up SpotifyPlus but I have an issue that the integration does not display my Chromecast Devices only two standalone TV connections and Web Player (Chrome) after I installed SpotCast.

I have looked in Spotify and there are two TV devices and a heading called “Google Cast Devices” that when I drill down on contain all of my devices in the Google Cast integration are present,

In SpotCast sensor.chromecast_devices I have all 5 of the appropriate devices.

Any help in resolving would be appreciated.

@SIW1973
Regarding ChromeCast devices and SpotifyPlus, you will still need to utilize SpotCast to play to those devices. I have not tested SpotifyPlus with ChromeCast, as I do not have any ChromeCase devices to test with.

As @fondberg Niklas Fondberg sadly passed away a couple of years ago and the Spotify Card has been static since, but the community have been patching Spotcast to keep it alive.

Would a tie up be possible?

Spotify card has the ability to use Spotcast GoogleCast device list to drive through a connection to Spotify that then means it then appeard on the SpotifyPlus Configuration screen (below)

I’ll look at a some sort of Google Cast polling to Spotify using Spotcast to make the devices visible, but a more integrated solution would be amazing.

To add the ability to broaden out SpotifyPlus to Google device owners would be amazing especially as you are now building out a Lovelace card for your extended functionality.

TBH I"m willing to chip in the cost of a Google Nest Mini for the work :rofl::rofl:

@SIW1973
I think it would make more sense to fix / maintain the Spotcast integration than to try and integrate cast functionality into the SpotifyPlus player. It looks like (per github) there have been 97 forks of the repository, which would lead me to think that there must be someone out there that could maintain it.

I would take a crack at it if I had a chromecast device(s), and I appreciate the offer to chip in on the cost, but I simply don’t have the time right now for the effort. All my efforts right now are directed at the SpotifyPlus Card UI.

I will re-visit once the SpotifyPlus Card UI is released, which should be within the next month or so.

1 Like

Yes, Spotcast is being maintained, but Spotify Card does not seem to be.

Thanks for all your hard work on this, it is very much appreciated, if you ever have the bandwidth it’d be great if you could look again at pulling from Spotcast for Google Cast devices.

FYI - just released a new version of the SpotifyPlus integration

[ 1.0.61 ] - 2024/10/22

  • Added service get_audiobook_chapters to get Spotify catalog information about an audiobook’s chapters.
  • Added service get_chapter to get Spotify catalog information about a single audiobook chapter.
  • Added service check_playlist_followers to check to see if the current user is following a specified playlist.
  • Added service get_album_tracks to get Spotify catalog information about an album’s tracks.
  • Added service get_artist_info to get artist about information from the Spotify Artist Biography page for the specified Spotify artist ID.
  • Added service get_playlist_items to get full details of the items of a playlist owned by a Spotify user.
  • Updated service get_spotify_connect_devices to return a SpotifyConnectDevices instead of a list of Device instances. This contains more detailed information about the device, as well as when the list was last refreshed from real-time queries.
  • Updated underlying spotifywebapiPython package requirement to version 1.0.112.

Hi,

I setup Spotify Plus and obviously made a mistake. Now there is no chance to reconfigure Spotify Plus. Even after deleting and reinstalling it directly opens the webpage and throws a client error. There is no way to get to the page where I setup Client and Oauth settings.

This is like a loop I cannot escape anymore. Is there a change to delete something on file level manually as otherwise I have no chance to reconfigure and make it work.

Thx for any help
René

I found the place to delete the settings in files and was able to amke it work.

1 Like

Can I ask what you did to fix the error? Anything I can do to make it easier for you or someone else?

Sure. I deleted the Spotify Plus entry here: /homeassistant/.storage/application_credentials

Then I restarted HA and then I was able to reconfigure. IMO you should give the user the ability to reconfigure, if the configuration fails for any reason.

René

1 Like

FYI - just released a new version of the SpotifyPlus integration

[ 1.0.62 ] - 2024/10/27

  • Added service get_track_recommendations to get track recommendations for specified criteria.
  • Added the following extra state attribute: sp_track_is_explicit - denotes the nowplaying track contains explicit lyrics (true) or not (false).

I’m trying to understand how to use this integration and maybe the documentation is just not registering. I was able to connect the account without issue but I can’t actually play anything. I get errors “SpotifyApiError: SAM1005E - The “SpotifyConnectLoginId” configuration option was not supplied, which is required in order to reactivate a Spotify Connect device.”

I see i can add a connect login id in the configuration but I’m not sure where I’m supposed to get that information? Is it just the spotify login? or is it a device specific login?

EDIT: I just gave it a try with my normal login and it worked fine. I think I’m understanding this a bit more. Thanks for this integration because I’ve been struggling with Music Assistant but its lack of UI customization has driven me mad!

1 Like

The device I would like use as default keeps giving issues with connection.
Tring to force a reconect / wake up, I preformed the ‘SpotifyPlus: Get Spotify Connect Devices’ and the SpotifyPlus entity that has been configured.

The results for the device in question shows an spotify error 8.

Will the wake up service enable the palyer or do I need to sort the spotify error 8 first?
I believe the error has someting todo with access and firewall. On my router, I have exposed the device, but that did not seem to help getting the error go away.

Any suggestions?

{% set action_response = {“user_profile”:{“country”:“NO”,“display_name”:“witno”,“email”:“[email protected]”,“id”:“witno”,“product”:“premium”,“type”:“user”,“uri”:“spotify:user:witno”},“result”:{“AgeLastRefreshed”:0.00019311904907226562,“DateLastRefreshed”:1730067568.330457,“ItemsCount”:4,“Items”:[{“Id”:“7b4228692f51dc20c8a516f57aaf77a8ea33693a”,“Name”:“ComoDuetto”,“Title”:“ComoDuetto (7b4228692f51dc20c8a516f57aaf77a8ea33693a)”,“WasReConnected”:false,“DeviceInfo”:{“SpotifyError”:8,“Status”:101,“StatusString”:“OK”,“ResponseSource”:null,“AccountReq”:null,“ActiveUser”:“”,“Aliases”:,“Availability”:“”,“BrandDisplayName”:“comoaudio”,“ClientId”:“36be90c7ec6e487a97a72ad26138d05c”,“DeviceId”:“7b4228692f51dc20c8a516f57aaf77a8ea33693a”,“DeviceType”:“SPEAKER”,“GroupStatus”:“NONE”,“LibraryVersion”:“3.166.69-g24821f73”,“ModelDisplayName”:“duetto”,“ProductId”:5,“PublicKey”:“mZ5BVMZFrAdff37Ob6UxUyvqvZmiu6btaMJ8Fk3qy94a7iRQ0DmqPJhQXdq1vBaPl2gdBKwVN3j58aV/KHcdMA44XGe76euVT7IA4APubODFAuL4+4fKn6cdjY+Z3MZG”,“RemoteName”:“ComoDuetto”,“ResolverVersion”:“0”,“Scope”:“streaming”,“SupportedCapabilities”:null,“SupportedDrmMediaFormats”:,“TokenType”:“accesstoken”,“Version”:“2.9.0”,“VoiceSupport”:null,“HasActiveUser”:false,“HasAliases”:false,“IsAvailable”:true,“IsBrandSonos”:false,“IsActiveDevice”:true,“IsInDeviceList”:true},“DiscoveryResult”:{“DeviceName”:“ComoDuetto”,“Domain”:“.local”,“HostIpAddress”:“192.168.1.122”,“HostIpAddresses”:[“192.168.1.122”],“HostIpPort”:80,“HostTTL”:120,“IsDynamicDevice”:false,“Key”:“comoduetto._spotify-connect._tcp.local.”,“Name”:“ComoDuetto._spotify-connect._tcp.local.”,“Priority”:0,“OtherTTL”:4500,“Server”:“ComoDuetto.local.”,“ServerKey”:“comoduetto.local.”,“ServiceType”:“_spotify-connect._tcp.local.”,“Weight”:0,“Properties”:[{“Name”:“CPath”,“Value”:“/goform/spotifyConfig”},{“Name”:“VERSION”,“Value”:“1.0”}],“SpotifyConnectCPath”:“/goform/spotifyConfig”,“SpotifyConnectIsInDeviceList”:false,“SpotifyConnectVersion”:“1.0”,“ZeroconfApiEndpointAddUser”:“http://192.168.1.122:80/goform/spotifyConfig?action=addUser&version=1.0",“ZeroconfApiEndpointGetInformation”:“http://192.168.1.122:80/goform/spotifyConfig?action=getInfo&version=1.0”,“ZeroconfApiEndpointResetUsers”:"http://192.168.1.122:80/goform/spotifyConfig?action=resetUsers&version=1.0”}},

@Bxsteez
More info on the configuration parameters can be found on the wiki documentation.

You can also click on the question mark icon at the top of the configuration options page to take you to the wiki docs as well:
image

Hope it helps!

@witno
please paste your response between 3 slanted tick marks so that it is formatted correctly. As you posted it, it all runs together and I cannot read it.

For example:
```
{% set action_response = {
“user_profile”:

```

would render:

{% set action_response = {
  “user_profile”: