Spotify Custom Tile

Hi @Greg_Shepperd , welcome to the community. See below for my comments to your questions, and feel free to let me know if this helps or additional details are needed.

Does this happen every time or do you know a specific pattern how to reproduce it? Can you test out the following things to help me troubleshoot?

  1. when this issue occurs, if you click on the “available devices” and select another device, then try to change the track again, does this error go away? I am wondering if there is an edge case that the “active” device" from Spotify and this custom tile is out of sync. ex: the device “ABC” is playing now and considered as the “active device”, but this demo Spotify is sending track control command against to another device “EFG”, and received 403 Forbidden error. Some Spotify Player API returns 403 when missing premium plan, so this can be confusing in terms of the cause.

  2. If the previous step doesn’t help, can you refresh the page, then select a device, then try the track control again?

Do you mean 2 out of 20 devices are not showing up? What type of the devices are they? Did they never show up?

The access_token in’t required to be input by the user because the code will get it automatically using the refersh_token and stores in userSettings.token.

May i ask something all features play playlist and do other stuff i must have spotify premium?

What features i have without premium and what with premium from this tile?

Hi @Valantis_Levas , welcome to the community. For this specific Spotify demo tile, you won’t be able to do much without Spotify premium account. According to the Spotify APIs, pulling the available devices and playlists doesn’t require Spotify premium, but every other control in this demo tile requires the Spotify premium, such play/pause, skip, prev, and shuffle.

Thank you JAMES !..this is rocking now in my Mac Dashboard…Love it !

2 Likes

Hello James,

What a great tile! Absolutely love it!

Everything worked well for me from the first try. However, does the tile provide the possibility to select a particular song (drop down menu with songs) under a playlist? As I am able to select only playlist at a time and change the songs with the forward/back controls.

Is this feature not working for me or it is not included in the demo? Thanks!

1 Like

@Empire_Home Glad to hear that you liked this demo tile. No, the song list is not currently included in this demo. I can take a look when I have a chance. May be play the playlist and show the song list when a playlist is selected, and allow user to go back to the playlist menu by tapping a back button somewhere?

1 Like

Hello James - that would be a great feature indeed! If the selection a particular song in a playlist is not feasible, having the visibility of the underlying song playlist would be super helpful! :slight_smile:

1 Like

Is it possible to hide Playlists? And just have the player part?

You could probably modify the code to hide that part. I think you would still need some way to select which device to play on (which shares that same list space), but that could probably be done in a pop-up using stio.showList().

If you or another community developer want to give a try, please share your results! :slight_smile:

Ah I thought the selection was part of the player part.

I’ll see if I can, shorten the list at, least

Edit:

Making it less then three tiles, keeps the player while hiding the list :wink: I have to scroll inside it to select which player but then it works fine!

3 Likes

Hi, I was trying to set up this tile but the link doesn’t work!!

Which link doesn’t work? I just tried the import link and the authorization link (Glitch) from the first post and they both work for me.

Lots of discussion but can’t really understand the basics of Spotify tile. Someone could clarify for me couple of things.

  1. Being able to search streaming devices from tile, spoitfy application has to be installed to that laptop/tablet?
  2. User has to be logged to that account which “refresh token” was used?
  3. Tile doesn’t update any other streaming devices than device itself…or max one streaming device if it used at the moment in Spotify application?

So I’m not able to get anything else to device list than my laptop and if I manually stream music to one of the google homes in my spotify app, then custom Spotify tile can see that particular streaming devicde.

It’s all done through Spotify’s API, so you don’t need anything installed on the device that’s displaying the dashboard. That being said, the API is pretty limited with what is considers an ‘active’ device that’s available in the API.

I’m not sure exactly what you mean by this, but yes, it’s all based on what the authenticated user has access to. So you’ll want to make sure to use the same Spotify account on your devices as well as when authenticating this Custom Tile.

The tile can control a single ‘device’ at a time, but you can switch which device you are controlling and control other devices. I find the Spotify API a bit odd though – if you open up the Spotify app, it finds all the different devices on your network including Google Cast devices, etc… but the API seems to be more limited. In my experience, most of my devices that show up as ‘Spotify Connect’ in the Spotify app, like my Onkyo AV Receiver, are always available as targets, but the various Google devices in my house don’t show up through the API. :worried:

What type of device(s) were you trying to target?

Well then I got an issue with it. I followed “easy” instructions and can’t get device list in tile if Spotify app isn’t running background. I need to have spotify app open and I have to be logged in with that same account which was used in custom tile authenticating. Otherwise tile doesn’t list any devices.
I just tested this with other pc too and it¨s behaving same way.

When I’m getting that refresh token there is an option to test device list. That does not list anything either.
I have 6 google home’s and couple of chromecasts and it only lists max 2 devices at time depending if I’m streaming with app to that particular device.
image


Device button doesn’t do anything…and if I click “play” it says:

If I open spotify app to background then I’m able to get device that I’m using at the moment.

My spotify app shows these:

If I start to stream one of those devices in spotify app:
image

Then I’m able to get that particular device to show up on tile but nothing else:

That’s just the nature of the Spotify API and is what I was linking to in the previous post:

Devices not Appearing on Device List

Connect Web API relies on local network connections to discover and interact with some devices.

For example, when:

  • A new device is added to the network
  • A device is in “sleep” mode
  • A device on the local network is currently tied to another user account, or
  • Other reasons specific to the device

As a result, some devices that appear in the Connect picker within the Spotify application may not always be visible or available on the Connect Web API Endpoints.

Their concept of “sleep” is really limiting. The only devices that I see as always available for me are things like my Onkyo AV Receiver that have the native ‘Spotify Connect’ integration. All my Google devices, my desktop, and things like PS5 only show up if they very recently played something.

Depending on what you are trying to accomplish, if your hub has a Google Cast integration, you might be able to use that as a starting point?

My plan was to create spotify tile which would allow me to choose what music to play and with what google home or chromecast device. I guess that will not happen because of all the examples listed.

Hi James, I wonder if you can help create a customer tile like this for Sonos from smartthings or Hubitat. Can you please let us know?

Hi @rog889! Have you seen the Create a Jukebox thread James put together?

You can put together some cool jukebox style dashboards with the Sonos integration for SmartThings or Hubitat:

1 Like

I’m assuming you have to have a device such as Sonos to run this and we can’t just use the app without owning a device?