[APP][Pro] Spotify Connect (beta - ready for testers)

During development of the plug-in I’ve used my Macbook a few times and I was able to see the currently playing track and use the controls. First thing that comes to mind is that you obviously need both Homey and the macbook to use the same Spotify account and to have the macbook activated as output for your music (this enables it as the active speaker under your account).

I’ve just tested this and it still works for me, the steps I took:

  1. Start playing music on my Macbook
  2. Use Spotify Connect app to add my macbook device
  3. I instantly see the tile with the cover that’s playing the track

Especially if you have multiple Spotify accounts there is some odd behaviour. Odd as in whenever “on of the other” accounts take over the speaker the Homey account loses access until the device is manually activated again using phone / tablet / computer.

Hello pendojoshua

Are you still developing this app?

For me it would be very fine to be able to select playlists, albums or artist. Also a Widget for the dashboard would be nice.

Greetings Ronald

Hi Ronald,

Not as active as last year - time has become a bit scarce since being a dad. Haven’t touched the Homey as often as I had planned.

I did a few tests some months back but I quickly ran into my own limitations as a front-ender. While it isn’t too hard to get the API endpoints working, I was struggling heavily on creating a decent ui for the function. And that’s when it eventually ended up back on the shelf.

The dashboard widget is available as you can see in the post by Rembo and Bjursten:

@pendojoshua is it possible to add a function that I can add a item to the Playback Queue Web API Reference | Spotify for Developers

This way I can add a song to the queue for when my doorbell is ringing.

Wouldn’t it make more sense if you instantly started playing the song using the Start Playback method? Which accepts a song/playlist as parameter (see: Web API Reference | Spotify for Developers).

No because I’m already listening to music, maybe a certain playlist or radio of a song. When I instantly play the song that song will be stuck on repeat and replaces my queue. If I can add that song to the queue and then select next song, the queue will not be replaced.

Added Spotify Connect with correct Client ID and Client Secret, playback works when I am starting a song from e.g. my iPhone and sends to the playback device (Denon AVR X4000). But after a while, when stopped playing, the device in Homey Pro 2023 gets a red exclamation mark and “Device not available”. Is this Device Dependent, i.e. the Denon has an older implementation of Spotify Connect, or something else?

Btw. sending music to the Denon works from all phones, web app etc.

That could work, unless there is more than 1 song in the active queue?

Hard to tell. There is a chance the Denon device becomes inactive when you’re not using it. Is no other Spotify account using the speaker in between your own sessions? Whenever a speaker is transfered to another account it cannot longer be reached by the app.

No. Not used by any other account. I can play from all other devices via Spotify Connect to the Denon any time - even when the receiver is off (it will power on automatically). The red exclamation mark disappears as soon as I start playback from any other device using Spotify Connect to the Denon receiver. However, there is no way I can initiate and start/stop, skip songs etc. from the Homey Spotify Connect App - stating Device not available - unless playback is first started from another device.

The Spotify App - on the other hand - has access to the receiver.

Spotify has access to your network devices and most likely sees the receiver in that list where it is able to activate it as a speaker. Activating a speaker is not available in the API and my guess is that whenever your Denon speaker turns off (or isn’t used for a while) it disappears from the devices list in the API.

See this message in this thread for the info I found last year: [APP][Pro] Spotify Connect (beta - ready for testers) - #3 by pendojoshua . It might be worth a shot to look if any changes have been made to the Spotify API. But I think it’s highly unlikely this is even possible.

True. But like you say it’s a active queue. Most of the time you click play on a playlist and don’t really add a song to a queue, and if you do it will be the first song to be played in that queue and then it will continue playing your playlist. I’m not great at Javascript so I can’t help you with the code, but I already used this option of the Web API with Claris FileMaker to add this functionality in my program.

I’ll try to add this as a card as soon as possible, shouldn’t be too much work. But finding time is a bit hard at the moment as I’ve got a few spare-time projects running. I’ll keep you posted and add it to my todo.

Perfect. Thank you for creating the app btw :smiley:

I have another device using the Spotify WEB API (the device is the Rithum Smart Switch) and on this device I can 1: select a Spotify Connect Device to play to, 2. select playlists etc.

That remains the same (at least it did back when I created the app). There indeed is a list of devices, but also in that list the device gets removed as soon as it turns inactive. There is no way via the web api to activate a device again, that can only be done using the app as far as I can tell.