Spotify_iconHow to control Spotify from Homeseer? There is no plugin available, scripting is a problem as well. Spotify don’t have his API ready to achieve this.

I use the Android app “Tasker” a lot the last year. I’ve several tablets and even a mobile from with Android. With Tasker you can automate events or task on a Android device.

First setup the Tasker plugin in Homeseer(3) to controll the Android device: http://board.homeseer.com/showthread.php?t=158888

In this case you can create task to set a certain volume level of the Android device:

  • Create a new Task and set the name in capital letters and without spaces, like “VOL60”. When this task will be run, the volume will be set to level 6.
  • Add an Action
  • Choose “Audio”
  • Select “Media Volume”
  • Change the slider to the desired level, in this case “6”
  • Select in the top left corner the “<” icon, to go back to the previous screen
  • The selected acgtion is now visible in the task “Media Volume – Level 6”.
  • Select in the top left corner the “<” icon, to go back to the previous screen
  • The task is now created.

When a Task or Profile is created or changed, Tasker has to be closed first to save the settings.

  • Press the 3 dots in the upper right corner
  • Choose “Exit”
  • Select “Save First”

In my Homeseer set I created a virtual device that can control the volume of one of the Spotify clients:

Tasker-Spotify-Volume

To control Spotify from Homeseer you have to create also tasks to Play/Stop the Spotify app. I added also trasks to switch to the Next and Previous track.

In case you want to start Playing Spotify, create a new Task:

  • Create a Task and set a name in CAPITAL_LETTERS without spaces, like “SPOTIFY_PLAY”
  • Choose “System”
  • Choose “Send Intent”
  • At the top by “Action,  enter without quotes: “com.spotify.mobile.android.ui.widget.PLAY”
  • Scroll down to Package, choose “com.spotify.music”
  • Scroll down to Target, choose “Broadcast Receiver”.
  • Save task

Test your task with the Play icon in the left corner. If Spotify resume playing, you can continue with Homeseer.

  • Exit tasker and save your settings.

To run this task from Homeseer:

  • In Homeseer, create an event.
  • or example: Manually triggered
  • Choose Control device
  • Select your Tasker device.
  • Choose for CUSTOM CODE
  • Set device string to the exact Task name you created earlier in the Tasker app (like “VOL60” or “SPOTIFY_PLAY”).
  • Save the event and run it.

You can create tasks as well for:

com.spotify.mobile.android.ui.widget.NEXT

com.spotify.mobile.android.ui.widget.PREVIOUS