I would like to have an intent that allows the spotify application to connect to an existing spotify connect enabled device (like a chromecast)
My idea is to have an intent to be used from Tasker or even adb, that connects to the device. More information in http://blog.ereslibre.es/?p=410 or https://androidtrix.wordpress.com/2013/11/05/tasker-spotify-plug-load-and-play/
An already existing intent for Spotify can be used as follows:
adb shell am start -n "com.spotify.mobile.android.ui/com.spotify.mobile.android.ui.Launcher" -a android.media.action.MEDIA_PLAY_FROM_SEARCH -e query "artist:heroes del silencio"
The new intent can be use, for example like this:
adb shell am start -n "com.spotify.mobile.android.ui/com.spotify.mobile.android.ui.Launcher" -a android.media.action.CONNECT_TO_DEVICE -e query "My_Chromecast_device"
This idea was already submited and marked as duplicated of https://community.spotify.com/t5/Live-Ideas/Publish-the-Spotify-Connect-Wireless-speaker-API/idi-p/520890 but it's not the same, as this is requesting an API to implement a custom spotify connect enabled device.
Happy to discuss.