Automatic spotify connect player

Hello there,

i actually wanted to check if anybody has a solution to automatically play spotify playlists on triggering a sensor or device.

Ideally, this works with the spotify connect feature to automatically move the song playing to where i am in the house.
I know that something like this should be possible with Sonos… however is there another solution to use all of the speakers i already have at home? Maybe chromecast audio?

@AlmostSerious did you manage to find a solution for this? I would be very interested if you did.

No, unfortunately not. However, best bet on achieving this seems to be Bose Soundtouch, as you can put 6 presets that can then be triggered via smartthings. A preset could be a Spotify Playlist. However, currently im simply using the ECHO to just say play spotify… and thats fine for now.

Anyone? Anyone? Bueller??? Ferris Bueller???

Has anyone worked on this? It would be really cool to have a trigger to just start playing a spotify playlist without having to pull my phone out and fiddle… IE walk in the door, lights go on and some music kicks on as well.

1 Like

Use Alexa if you have one.

“Play (song name) on Spotify” (You may have to add the artist in there if there are multiple songs with the same name)
“Play (artist name) on Spotify” (Shuffles songs by that artist)
“Play (composer) on Spotify” (Shuffles music from that composer)
“Play (playlist name) on Spotify” (You can also say “Shuffle” instead of “Play”)
“Play (genre) on Spotify” (90s music, rock, hip-hop, etc)

Theory: Perhaps you could use a combination of Sharptools by @joshua_lyon (android) for presence/sensor triggers, and then utilize tasker with the Macronos plugin to trip off the playlist of choice on Sonos… you can take pieces from this article for inspiration. I fully admit this is more dependent on android than ST, but it’s all I can think of at present to satisfy the use case…

1 Like

Still great to put the idea out there - you never know how your thoughts might inspire creativity with someone else!

Following on the idea from @YankeeJohnboy, you could use something like AutoLocation to detect when you are home and then use something like AutoInput to automate the screen presses to cast the audio. Again, this is still tied to your phone.

If you’re willing to get your hands dirty, you might be able to take some of the work done in this Node.JS project and extend it for your needs (or something similar - this was just a quick search!):

You can use HAM Bridge for AppleScript automation, it allows firing of specific playlists dependent on many triggers using the SmartApps by @scottinpollock.

I’ve used it to make a media controller for Spotify and iTunes that can be controlled by nearly anything, including a virtual remote in the ST app. https://github.com/ijaspley/HAM-Bridge-Smartthings-Media-Control

I finally made it happen by using Home Assistant. Right now im using Home Assistant and Smartthings in paŕallel. Implementation of Spotify in HA was pretty easy. Now my ST paired sensors trigger my HA Automations including Spotify :slight_smile:

Marcus
I would very much like to know more detail on how you got this to work.
I was hoping AT tiles would offer a solution but Action tiles, Fully Kiosk and Spotify dont play nicley
Best
Neil

I recommend to check out their Website. www.hass.io
Im running it on a rpi3.

If someone knows how to find me a command line in Windows that will start a specific Spotify playlist, I will have it working for in SmartThings the same day. We can control anything on Windows if we know the command line. Aka if you can fire a playlist in command prompt we will do the rest.

You need to right click the playlist in the web player to get the URL which includes the proper name of the playlist (they have weird names (list of characters), not obvious ones like ‘discover weekly’), then you can pass this into your prompt.

1 Like

I DID IT!!! Start Spotify Playlists with Smartthings and Trigger CMD Here is a video of how to do it.
https://youtu.be/5LNVrFHCKkA

2 Likes

Solutions for getting SmartThings to automate playback of Spotify playlists on Sonos devices:

  1. If you have a Harmony Hub, create Harmony activities for playing your playlists on the Sonos then invoke those Harmony activities from ST (this is the most reliable and close to native solution. It is my recommended solution).
  2. If your Sonos is near a voice assistant, use an ST smart app or webCoRE to have the Sonos speak to Alexa/Google to trigger the playlist (e.g. "Alexa play playlist in the “”
  3. Duplicate your Spotify playlist tracks into a Sonos playlist and play that - ST can play Sonos playlists
  4. Duplicate your Spotify playlist tracks into a webCoRE Piston and use the piston
  5. Use a software tool like TRIGGERcmd that integrates with ST to trigger the playlist from your desktop. Video here: https://youtu.be/5LNVrFHCKkA
1 Like

Spotify has an API that supports commands to all connect devices via rest commands so it should be doable…


I suck at developing tho, so I just keep getting “groovyx.net.http.HttpResponseException: Unauthorized @line 116 (pause)”
I would appreciate help if anyone smarter than me is willing!
def pause() {
log.debug “Executing Pause”
httpPut(

    uri: "https://api.spotify.com/v1/me/player/pause",

    body: [contentType: "application/json", token_type: "bearer", access_token:"NotMyRealTokenObviously"] 

)

}

1 Like

It would be enough for me to be able to use my Bose Soundtouch 30 with Spotify and the same with my Onkyo. Both devices are compatible with spotify, but neither of them can control it with alexa, nor with Google assistant, nor with Smarthings. I always have to pick up the phone and redirect the music to those devices. For me it would be enough to be able to listen to the last music that was playing, to continue what I was listening to, but I never found a solution

Just use Spotify premium to directly play Spotify on Sonos. Or, if you want to play Spotify on all your speakers, you might use a Spotify Song Downloader to download Spotify music to the computer. Then you can transfer and listen to Spotify music on any other device.

The frustrating thing is that I can play Spotify Premium music on my Onkyo and Bose devices through their app, but I haven’t found a way to do it by voice, or through some automation. The bose is also compatible with Smartthings, but very limited, I can only turn on and choose one of the 6 presets and only through the smartthings app or automations, certainly not by voice as I would like.