Start Spotify Playlists with Smartthings and Trigger CMD



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



  • Props to Bubba for the video! -

    I'm kind of a rookie to cmd scripts - I'm a web developer.

    I didn't see a command in this video so I thought I'd throw this in here in case there's someone like me.

    start C:\scripts\spotifyChill.vbs - He didn't mention the command in the video. I set voice command to chill music and now I can just tell Alexa to start trigger command and run chill music on my pc - It works great! No need for Spotify premium to play my music using Alexa. I have my computer right next to Alexa in my living room and PC hooked to TV so "Trigger CMD" will come in very useful.



  • UPDATE I just figured out how to switch between Spotify devices. it is a .vbs file I made in notepad. Works like a champ. You can change the amount of times it hits the TAB button (to select different devices) by changing the 3 in "{TAB 3}". I have made multiple identical scripts with the only change being this number. I made Trigger commands that I trigger with Alexa through Smartthings. "Alexa turn on device 3"

    Set WshShell = WScript.CreateObject("WScript.Shell")
    Comandline = ":\Users*YOUR COMPUTER NAME*\AppData\Roaming\Spotify\Spotify.exe"
    CreateObject("WScript.Shell").Run("spotify:")
    WScript.sleep 1000
    WshShell.SendKeys "^{d}"
    WScript.sleep 1000
    WshShell.SendKeys "{TAB 3}", True
    WScript.sleep 1000
    WshShell.SendKeys " "



  • @dlaugh14 That is awesome! I actually hooked an echo dot to my PC (so I can hear both the PC sound and the Alexa sound at the same time. I then output my PC (and Alexa) audio to my home stereo system. One advantage is I only have to say "Alexa play chill music". :) Spotify is set as default player on my Alexa. I can also just say "Alexa skip" to move to the next song.



  • Whats the shortcut for shift?


  • administrators

    @pedro-gense, I found on this page you can have SendKeys basically hold shift and type letters with a + like this:

    objSendKey.SendKeys("+(joecolantonio)") 
    

    That would type JOECOLANTONIO in upper case.



  • yeah some googling found it already, tnx for the quick response.

    Im very noobish at this all and most of it is just copy past and reading.

    What i want is the following, tru smartthings with a virtual button to start a playlist but also to stop the playlist if the virtual sensor switch to off.

    Ive made it so far that i can start a playlist and send the audio tru a spotify connect speaker as so

    Set WshShell = WScript.CreateObject("WScript.Shell")
    Comandline = "C:\Users\Peke\AppData\Roaming\Spotify\Spotify.exe"
    WScript.sleep 9000
    CreateObject("WScript.Shell").Run("spotify:user:1131846872:playlist:3ztoPH7GPeH9b898dIXcvc")
    WScript.sleep 5000
    WshShell.SendKeys "^{s}"
    WScript.sleep 1000
    WshShell.SendKeys "^{RIGHT}"
    WScript.sleep 1000
    WshShell.SendKeys "^{d}"
    WScript.sleep 1000
    WshShell.SendKeys "{TAB 4}", True
    WScript.sleep 1000
    WshShell.SendKeys "+{ENTER}"

    but what i really also want if the virtual button goes to off that the playlist stops and the sound out of my spotify connect speaker stops playing.

    Is this possible, if so can you point me in the right direction?

    Greetz Peke



  • Thanks for your sharing, if you'd like to download Spotify playlists and import Spotify to Amazon Echo, here is the best program- Spotify Music Converter for Windows enables you to download Spotify playlists/tracks to MP3, then you can transfer your Spotify music to Amazon Echo without any limitations.


Log in to reply
 

Looks like your connection to TRIGGERcmd Forum was lost, please wait while we try to reconnect.