SpotifyPlus Custom Integration

@Diegocampy The HA 2025.5 release broke some things with the SpotifyPlus and SoundTouchPlus integrations, but the latest update fixes them.
Thanks!

1 Like

I have finally found some time to set up this integration. The installation and configuration is way quicker and more straight-forward than I expected based on the length of the documentation.

I have Yamaha Musiccast R-N402D. Everything seems to be working well. Great job on the integration!

4 Likes

This integration sound like what I’m looking for for my spotify on sonos speakers In Ha for queues. However it doesn’t seem to update. I set it uo correctly even got spotify extras to show me attribute data…but when I run the service or update the sensor nothing udates.

Also, should this replace the spotify Integration ot in addition to? I ask because I was getting some ha log errors about exceeding pool?

In the end I was hoping to be able to show my now playing queue.

@Littlejoe
Are you referring to the “spotify_plus” integration? If so, it’s a different integration than “SpotifyPlus” (no underscore).

Well shat I see tha now, sure sounds like it’s the same

1 Like

So, I’ve been using this integration for a little while now. I haven’t really used any of the advanced features the integration brings, to be honest, just using it with mini media player card to play and browse spotify.

There’s one problem I have. I can’t start playback when another spotify account is controlling the device. It seems like it cannot take over (or join the other’s account session). Is there a way around it?

@Fanful
You could issue a call to the spotifyplus.player_transfer_playback service, which should transfer Spotify Connect playback to the designated device id. This only works if the device is listed in the Spotify Connect device list. Note that just playing something via Mini Media Player (or any other player for that matter) will not transfer the playback for some devices; Spotify Connect has to be told to transfer playback to a device, which is what the spotifyplus.player_transfer_playback service does.

Examples:
Transfer playback to the “Bose-ST300” Spotify Connect Player device id.

service: spotifyplus.player_transfer_playback
data:
  entity_id: media_player.spotifyplus_john_s           # Bose-ST10-1 device
  device_id: 6f66ef4fbf687bbba393d8c38599aad484b30901  # Bose-ST300 device id
  play: true

Transfer playback to the “Bose-ST300” Spotify Connect Player device name.

service: spotifyplus.player_transfer_playback
data:
  entity_id: media_player.spotifyplus_john_s           # Bose-ST10-1 device
  device_id: "Bose-ST300"                              # Bose-ST300 device name
  play: true
1 Like

Thanks! I just tested this with windows app and it moves the transfer back to the main device with no issues. The service even has full GUI support with description for all fields, you are really spoiling us!

I’ll test this with a second spotify user later, but this is great. I think I’ll simply add this call to my start script.

By the way, is Spotify API also offering song lyrics and if yes, do you plan to add this feature? I just started using GitHub - robert-alfaro/genius-lyrics: Home Assistant custom component for fetching song lyrics from Genius.com and it’s great, but it has no way to sync the text to the music.

1 Like

@Fanful
The underlying Spotify Web API does not support song lyric retrieval. I thought that was kind of odd myself, since the Spotify web app supports it. I have no plans to add song lyric support at this time, though I will if the underlying Spotify Web API adds support for it.

1 Like

Unfortunately this is not working when a different spotify account took over the device.

To be precise:

  1. My wife is playing music on our Yamaha through Spotify.
  2. I issue player_transfer_playback service call, using our Yamaha device ID or device name. Neither works, I get an error “Device not found”.
  3. I can see the device on the list in my Spotify app. And I can switch to it (it asks me if I want to join my wife’s session or take over the speaker).
  4. After I take over the speaker through the Spotify app, issueing the same transfer playback service call doesn’t generate any errors.

@Fanful
I believe it’s because you and your wife have separate Spotify accounts, and her account does not have access to your Spotify Developer Application account. The SpotifyPlus integration uses the Spotify Developer Application account for access.

Note that the Spotify Developer Application account is different than your Spotify.com / Spotify Mobile App account; even though you and your wife probably share your accounts for Spotify.com, they are not shared with the Spotify Developer Application account.

With that said, you will need to add your wife’s name and email (same email she logs into Spotify with) to your Spotify Developer Application User Management settings. Use the following steps to do that:

Update User Management

  • browse to your Spotify Developer Dashboard settings.
  • click on the Home Assistant Spotify Plus Integration Home app (or whatever you named it during SpotifyPlus setup).
  • click on Settings button to view app settings.
  • click on User Management tab (next to Basic Information tab - see Figure 1).
  • enter your wife’s name and email address - note that the email address must be the same email address she uses to login to Spotify with.
  • click the Add User button to save your changes.
  • not sure if it’s needed, but you might restart Home Assistant as well.

Figure 1 - Spotify Developer Application User Management Form

Once that is complete, try the player transfer again.

Please let me know if this does or does not work. If it does, I will add it to the documentation.

Actually I already have my wife added there. Her account is listed in the app settings.

I’m using the same app that I created and am using with the regular Spotify integration (well, not really using it anymore, but I haven’t removed it).

In the regular Spotify integration I have two services, one for my account and one for my wife’s.

I only have one service in the SpotifyPlus integration though. Should I try to create a second one for my wife?

Update: additional info that might be relevant. I think this might be some limitation of Spotify web api. Their article here:

says:

[Web player] On the web player you can only use devices you’ve already logged into, or Google Cast devices on your current network (if using Chrome). If your device isn’t showing, try using the Spotify app instead.

And so I tried their web player and indeed, it does not show my Yamaha device. I can see it on the Spotify app, but not in the web player. And so maybe that’s why SpotifyPlus also can’t see it.

You could try setting up another SpotifyPlus integration service for your wife’s account. I assume you setup 2 Application Credentials when you setup the original Spotify integration? If so, you can use the same Application Credential for her account (and yours too for that matter) for the SpotifyPlus integration service.

To be honest, I have never tried what you are attempting as I only have one Spotify Premium account. I’m sure there is “special processing” in the Apps written by Spotify for account “takeover” and such - it’s just probably not built in to your Yamaha (or other) devices. For example, my Bose SoundTouch gear only allows one Spotify account defined for any device in the network and a Spotify Premium account is required (free accounts not supported).

If the above does not work, then I would say that it probably won’t work - unless you issue the “takeover” via the Spotify App first (which is a pain).

1 Like

I don’t think it’s a limitation of the Spotify Web API, but rather the manufacturer device (in this case, your Yamaha MusicCast). I saw the following in a Yamaha MusicCast App article on the Yamaha web-site:

Bear in mind that when using Spotify Connect with your MusicCast-enabled device, you have to connect directly from the Spotify app (not the MusicCast Controller app).

Note: There may be times when your MusicCast device will not appear in the “devices available” menu within the Spotify app, even when the phone and receiver are connected to the same network. This can generally be corrected by unplugging AC power for a few seconds.

It sounds like you control the player through the Spotify Mobile App, rather than the Yamaha MusicCast app? It’s similar to my Bose SoundTouch, in that I use the SoundTouch App to configure the Spotify account on the device, which then can be “seen” by any Spotify Connect enabled player (mobile app, web app, desktop app, Home Assistant, etc).

@Fanful & @thlucas thought I’d chime in here since I’m using this integration along with my house full of MusicCast devices. I also have two accounts and had issues getting both of them to work. In the end I gave up. I am using my “family” account for the integration, but only to get the benefits from it. My wife and I both primarily use our phones with the Spotify App on it to call up our music and play it in the house. In the end, I made a dashboard and I have a dedicated, stand-alone MusicCast Pre-amplifier sitting on my network that does literally nothing. It’s just called “Media Player”. Whenever my wife or I wish to listen to music we just play to that device all the time. Then in each room I have a dashboard setup which allows us to link the “Media Player” to the dedicated room. That tablet also gives us local volume control of that room, but we can change the overall volume of the entire house with our phone volume controls. The dashboard just adjusts the level balance from room to room. This method has worked flawlessly and best and it requires WAY less intervention on my part with regards to my wife (or anyone else who wishes to play music).

Now where the Spotify Plus integration comes in is the local control as well as displaying the “Now Playing” information embedded within a Mini Media Player. Switching from the standard Spotify integration to this new one has sped up that response time immensely and it is completely agnostic to which account we are playing music from. It just simply doesn’t seem to care. Not sure if this is related to this integration or not, but I’ve noticed improvements to everything since I removed the standard integration in favor of this one.

Hope this info is of some help

1 Like

No, I believe it’s just reusing the same application credentials. I can only see 2 application credentials on the list in HA (for spotify and spotifyPlus integrations, both using the same oAuth).

In any case, I managed to add my wife to SpotifyPlus. Should you need this for your documentation, here are the steps I had to take:

  1. Log out of spotify.com
  2. Open the integration in HA and clicking “add service”
  3. Log in on the spotify page with my wife’s credentials.

It then created a new service for my wife’s account in spotifyPlus.

Unfortunately, this didn’t help at all.

It sounds like you control the player through the Spotify Mobile App, rather than the Yamaha MusicCast app?

Yes, exactly. It’s all managed by Spotify.

You are right that this might be Yamaha issue, though it’s a bit weird that the spotify android or windows apps can still deal with it (but spotify own web player can’t).

Anyway, for now I give up.

Thanks for info about your setup. I’m not sure I understood correctly, you have a separate musiccast device in each room in addition to that pre-amplifier? Or what is actually playing the music (I mean physically)?

I have 4 Bose SoundTouch ST-10’s and 1 Bose SoundTouch ST-300 sound bar (not musiccast devices). They all can play Spotify independently (or as a group), but share the same Spotify account configuration (I think that happens via a cloud interface). I can only define one Spotify account for ALL devices, since they share the configuration.

They sometimes lose connectivity to Spotify Connect as well; the only way to get them back is to reboot the device unfortunately. I have been looking high and low for a workaround for that, as the reboot takes about 2 minutes before the device shows back up in the Spotify App.

@fanful yes that is correct. I have a pair of WX-010 speakers in my living room (configured as a stereo pair), I have an RX-V481 multi-channel surround receiver in my home theater, a R-N602 stereo amplifier in my enclosed patio and an R-N402 amplifier in my garage. To control all of this, I bought a Yamaha WXC-50 MusicCast Preamplifier to be used just as a master device to link the other rooms to. So either myself or my wife will play from any Spotify device (primarily our iPhones, but I occasionally will use my laptop in my office) and then I link which ever room I’m using to the master “Media Player” (the WXC-50). I couldn’t figure out a way to use the Mini Media Player speaker grouping function and have the ability to choose which player was my master player, so I dedicated one for that task. The WXC-50 isn’t hooked up to any speakers so it’s strictly the master player.

If anybody has something like this working- please post!

Thanks for the integration Lucas!

1 Like