[APP][Pro] Spotify Connect

He is unable to find songs

c3bcf6d9-99dc-4abb-8391-c727a7ed9427

I published another fix - it was now talking about data missing. Which is weird since it works with me - but AI suggested something that was worth a try! You can try again after updating.

Thanks for trying! Unfortunately without the result i was hoping for. Can it be because i have spotify directly playing on my reciever?

851d4abc-bcea-4809-a938-bf75b2afcb8d

Not sure - the error is still about the request to the search API. That should be an easy fix usually.

I’m gonna need to validate that it works on my end first. If that works or not hopefully gives a bit more context I can work with. I can’t tell you when I find the time to do so.

No problem!

Thanks for looking into it!

Hi @pendojoshua ,

I just received this mail from Spotify. Currently i’m using your App , especially your widget to quickly play music on my Spotify Connect device. Recently the widget is not working anymore, I see continously ā€œsearch failedā€

Today I received an email from Spotify. Do you think this will have impact on the app? And for me specifically the widget area?

I’ve thought about that too. It’s possible, but looking at the changelog there isn’t anything that can interfere with the app. But who knows. ā€œLuckilyā€, I get the error on my device too. So I can debug without any help. I’ll look into it asap.

/Edit:

There indeed have been updates to the search API. At first sight just a minor thing that feels like just bugging people: the search limit was decreased to max. 10 results per page. I’m currently changing the code to reflect that limit and hopefully that works.

/Edit 2:

Decreasing the limit worked - I’ve released a new version. I’m going to look into adding pagination to the results, since a limit on 10 results will prevent users from finding the song they’re after from time to time.

I’ve just published another version with a small suprise: a load more button at the end and filter options on top to choose track, artist, album or playlist as search target.

Awesome! I’m having something to play with tonight :hugs:

Thank you Joshua!

Thanks for the update! It’s working perfect :ok_hand:

Would it be possible to somehow make support for Sonos speakers? I mean they already have 2 Sonos apps, but this feature where you can search for songs is really needed.

Spotify is a music library with Spotify Connect (speaker) support, but doens’t support Sonos. While Sonos is a wireless speaker without it’s own music library. One way or another it would involve writing something that can control a music library and then connect a Sonos speaker. And the information we have is that the first won’t work and the second seems to be a pain in the butt to built (if even possible).

So I can’t tell for sure if it is possible or not, but I’m definitely not going to try and find out. I’d be open to any information regarding options, but sounds like a waste of my time for myself.

Found a few minutes to poke around and it turns out to be totally doable (in theory).

Instead of fighting with Spotify’s Web API for playback (which doesn’t support Sonos), I can:

  1. Keep my existing Spotify search widget

  2. Send Spotify URIs directly to Sonos via UPnP

  3. Sonos handles the streaming using the user’s linked Spotify account

The Spotify URIs from the Web API (spotify:track:xyz) work directly with Sonos UPnP commands - no translation needed. Just need the node-sonos library and the user to have Spotify linked in their Sonos app. Pretty elegant solution that bypasses the whole Spotify Connect limitation.

I’m just nog sure if this fits inside this app or that it’s better of in it’s own. There is a lot of shared code so I’m leaning towards adding it here.

Alright thanks! I hope this could be a feature. There is really no apps with flows that can search up songs to play on Sonos speakers, in the official Sonos app it only supports playing favorite songs. So would be better having this feature.

Trying to get an MVP working as we speak.

Thank you!!

I’ve had some success already!

I was able to add my Sonos speaker as device (using the IP adress, I can’t get network discovery working for some reason) and even start playback from the search widget. It’s even more foolproof than the Spotify playback API since the over-the-network commands wake the Sonos device up. That’s something I couldn’t get working with my Spotify devices yet.

I’m going to spend some more time on this in the next week(s). But so far so good!

Looks like I’ve found my reason on why to go for a full Sonos home after all. I’ve been seaching for alternatives that support Spotify but had the Homey automation options I was after. Maybe this is the missing part in all of this :partying_face:

Thank you so much for doing this! I’ve been wanting to make the Sonos play something specific without needing to favorite every single song in Spotify. If this will work, then this app will definetly be the most used app in my Homey!

I’ve been using the Alexa app for that, but doing it straight to Spotify instead of Alexa needing to handle it aswell would be much better.

Here you can see, i use Spotify Connect to use my phone’s Spotify. I have a Siri shortcut so i use my JBL headset to say ā€œSwitch to Beamā€ then it plays the same music and skips to exactly 5 sec before where i was in the song. Right now i use Alexa and Spotify Connect for this, is it possible to get a skip flow card aswell? Skip X… seconds? Then everything would be possible with Spotify Connect without Alexa.