SpotifyPlus Integration

@Diegocampy
Did you have your shuffle mode set to on maybe?

I used your service call (with my entity_id and Bose ST-10 device) from the developer tools \ actions menu, and it played the list of tracks in sequence except for the Moon River track. It would not play the Moon River track; I believe that might be due to country code restrictions on that specific track (I am in the U.S.), as it is greyed out in the Spotify Web display.

After the last track was played, it then started playing random tracks afterwards which is normal behavior if repeat is not enabled.

1 Like

Probably my wife. I use his account so as not to dirty my boring songs. I will check thanks. Or can I enter a command to remove random play before starting the playlist?

You can disable shuffle (i.e. random play) using the Player Set Shuffle Mode service:

action: spotifyplus.player_set_shuffle_mode
data:
  entity_id: media_player.spotifyplus_paintervale
  state: false
  device_id: Camera Linda
1 Like

You are always my savior. I try tonight. edit: it Work :wink:

1 Like

Nothing, I’m not lucky, every night some problems, and this automation I can never make it work.

Registratore: homeassistant.components.script.dormi_linda
Fonte: helpers/script.py:2067
Integrazione: Script (documentazione, problemi)
Prima occorrenza: 21:24:06 (2 occorrenze)
Ultimo accesso: 21:24:57

Dormi Linda: Error executing script. Error for call_service at pos 7: Device not found

This is the POS 7

action: spotifyplus.player_set_shuffle_mode
data:
  entity_id: media_player.spotifyplus_paintervale
  state: false

:face_with_diagonal_mouth::thinking:
Unable to perform action: script/dormi_linda Validation error: There is no active Spotify player device and a default player device has not been configured.

Did you specify the device_id: Camera Lida in the player_set_shuffle_mode service call?

You may also need to transfer playback to the device first, if it’s idle. Try the following script:

alias: Spotify Playlist with Transfer Playback and Shuffle Off
description: >-
  Transfer playback to specified device and start the playlist with shuffle
  disabled
sequence:
  - alias: Transfer playback to specified device
    action: spotifyplus.player_transfer_playback
    data:
      entity_id: media_player.spotifyplus_paintervale
      device_id: Camera Linda
      play: false
  - alias: Disable Shuffle Mode on the specified device
    action: spotifyplus.player_set_shuffle_mode
    data:
      entity_id: media_player.spotifyplus_paintervale
      device_id: Camera Linda
      state: false
  - alias: Start the playlist on the specified device
    action: spotifyplus.player_media_play_context
    data:
      entity_id: media_player.spotifyplus_paintervale
      device_id: Camera Linda
      context_uri: >-
        https://open.spotify.com/playlist/4ufyQwaLq1MR49KvGRCNAo?si=AbYrmWorRKeW7G20B4c44A&pi=kT5FCDevRke6T
mode: single
icon: mdi:music

You were quicker to reply to the message than I to change mine. I added en error that appears when I try to run the script I don’t understand why sometimes it works and sometimes it doesn’t, I don’t understand logic.Maybe Spotify Plus Paintervale is not ready? :thinking:

It sounds like the device has fallen out of the device list due to inactivity maybe?

What is the manufacturer of the Camera Linda device (e.g. Sonos, Alexa, etc)?

You might try the following, which adds a slight delay between the steps as well as force activates the device if needed:

alias: Spotify Playlist with Transfer Playback and Shuffle Off
description: >-
  Transfer playback to specified device and start the playlist with shuffle
  disabled
sequence:
  - alias: Transfer playback to specified device
    action: spotifyplus.player_transfer_playback
    data:
      entity_id: media_player.spotifyplus_paintervale
      device_id: Camera Linda
      play: false
      delay: 1
      force_activate_device: true
  - alias: Disable Shuffle Mode on the specified device
    action: spotifyplus.player_set_shuffle_mode
    data:
      entity_id: media_player.spotifyplus_paintervale
      device_id: Camera Linda
      state: false
      delay: 1
  - alias: Start the playlist on the specified device
    action: spotifyplus.player_media_play_context
    data:
      entity_id: media_player.spotifyplus_paintervale
      device_id: Camera Linda
      context_uri: >-
        https://open.spotify.com/playlist/4ufyQwaLq1MR49KvGRCNAo?si=AbYrmWorRKeW7G20B4c44A&pi=kT5FCDevRke6T
mode: single
icon: mdi:music
1 Like

I added this piece to my script and now it seems to work. Perhaps the transfer of the playback was needed. Thanks

1 Like

It’s been a while I installed that integration. I know it worked well, but suddenly (I don’t know since when, cause I don’t use it a lot last time) I get this error :

I already removed the integration and reinstalled it, but…

Must be something stupid :angry:

@Tsar
Spotify made some changes to their API again in early May, disabling the Spotify Web Player Cookie credentials. This means that Free / non-premium accounts can no longer initiate play via SpotifyPlus, which uses the Spotify Web API to control the player.

For Free accounts, you must now control the player with the official Spotify Apps. The SpotifyPlus integration can only be used to show what is currently playing, and to manage favorites.

Wish I had better news, but unfortunately my hands are tied due to Spotify constraints.

Glad to know I didn’t do something stupid :sweat_smile:

But no problem, I will work with the official Spotify Apps.

Thank you for you quick response !

Is the spotify API still limited to not being able to remove a song from the queue?

Given this “Jukebox” view, I have now built adding to the queue (middle table from search), but I want to remove the item from the queue (last column).

@kbrown01
Correct - the Spotify Web API can only add items to the play queue for Premium users. There is no clear queue, nor remove queue items.

Bummer. But fine. The add is great and people here love being able to add, Just need a “manager” to delete I guess.

1 Like

@kbrown01
Ya, I hear you. I requested more queue maintenance functions for the Spotify Web API on their developer forum (along with others), but with no response. Some requests for that functionality are over 3 years old. Wish I had better news, but unfortunately it’s up to them to update their API first.

I just moved this functionality out to make it easier on large screen. Here is how it looks.

RCJukebox-ezgif.com-video-to-gif-converter

1 Like

I’m encountering some strange behavior when trying to resume playback to a Chromecast speaker group that includes my KEF LS50 Wireless II speaker (“Parlor”). I have four Chromecast audio endpoints in total. Using spotifyplus.player_media_resume works perfectly for resuming playback on each speaker individually — including the KEF — and also for any speaker groups that do not include the KEF. However, when I try to resume playback on a speaker group that does include the KEF, I get a “device not found” error.

Note that I am not experiencing any issues when sending music directly from the Spotify app to speaker groups that contain the KEF speaker.

Possibly related: In the SpotifyPlus Lovelace card, any speaker group that includes the KEF (“Parlor”) appears duplicated. This doesn’t happen with other groups. Interestingly, the duplicated entries share the same device ID — for example, I see two instances of “Kitchen Parlor,” both with the same device ID.

Any thoughts would be greatly appreciated. Thanks so much for the incredible work on this integration — it’s one of the most-used features in my HA setup!

@rml
Sounds like it could be a bug; I have opened github issue #122 to track / work the problem. Please direct any responses related to this on the github issue.

I also listed instructions for a requested SmartInspect trace as well.

1 Like