Starting a Spotify Playlist on Chromecast

Hi @sjef86,

Does this also work when the spotify connect device thing (chromecast) is not currently playing spotify?
I installed the bindings and configured some rules. When I am already streaming to chromecast I am able to start a playlist from url with the “track_to_play” command. However when I am not casting anything, chromecast will not receive commands…
How did you manage this?

kind regards

Hello, is there an other link where i can download the spotify binding? The link in the post above seems to be broken. Thanks

The Spotify binding is available in the Eclipse market place. Enable the market place with debug access level in PaperUI and it becomes available for install.

Thanks im going to give it a try

I have a Chromecast device on the same network as openHAB. If I connect my phone to that network, so that it sees the Chromecast, then I can use the Spotify binding in openHAB to control Spotify and play music on the Chromecast.
But as soon as I disconnect my phone from the WiFi network, the Chromecast thing (that came through the Spotify binding) goes offline, and – obviously – I can’t play music on it anymore, unless I connect my phone to the WiFi network again.

Is it possible to make openHAB discover the Chromecast device through the Spotify binding, so that it wouldn’t rely on my phone being available? Or is there any other way I can play music from Spotify on the Chromecast?

It’s a common problem with Spotify connect
devices. See my other comment. It applies to the Chromecast too:

Hi All,
I installed the binding (2.4) without any hitch, I can read all the values from the Thing, and I can discover any devices that Spotify streams to.

Unfortunately, I can’t seem to control my Spotify account.

I have a:
Bridge @ spotify_player_Paul_trackPlayer, and a
Device @ spotify_device_Paul_3c3c_devicePlayer

I try this in my Rule:

        sendCommand(spotify_device_Paul_3c3c_trackPlay, "spotify:user:spotify:playlist:37i9dQZF1E358oZ9hslUxp")
        sendCommand(spotify_player_Paul_trackPlay, "spotify:user:spotify:playlist:37i9dQZF1E358oZ9hslUxp")
        sendCommand(spotify_device_Paul_3c3c_devicePlayer, "PAUSE")
        sendCommand(spotify_player_Paul_trackPlayer, "PAUSE")

But it does nothing.

When I manipulate Spotify on my phone, it changes the Items appropriately.

I should also note, that I only have the free Spotify. Do you need the Premium?

Can you control from PaperUI or any other openHAB UI, starting/stopping?
According to the binding documentation you need a premium account, although I heard Spotify changed this. But I don’t know if that is true, so I’m assuming a premium account is still needed.

PowerUI also doesn’t work for toggling the play/pause. :frowning:

Do you mean it doesn’t work with a free account. In that case that’s a restriction of the spotify api.

Correct, the free account doesnt let me control (write) state.

Hi All

Im using the old spotify script written by Patrick

I’m trying to use a single button, to send playback to a device. The button works fine, turning the unit on, but it wont play the playlist.

This playlist works fine when using patricks Habpanel code, which sends the following:

<div class="sceneLatest" ng-repeat="playlist in playlists" ng-class="{true:'on', false:''}[itemValue('spotify_current_context_uri')==playlist.uri]" ng-click="sendCmd('spotify_action', 'play ' + playlist.uri)">
                        {{playlist.name}}

But doesnt if I send my playlist uri , which comes up in the openhab console when playing.

It seems my syntax is wrong, but I’m unsure what I actually need here.

Any suggestions?

My rule:

rule "Aeotec 'WallMote' - Ensuite "
when
        Item BedRoom1_AeoButton_Scene received update
then
        var int sceneNumber = BedRoom1_AeoButton_Scene.state as DecimalType

        switch (sceneNumber) {

       case 1.0 : {
            logInfo("Aeotec Button Bedroom", "Button 1 1x press: " + sceneNumber)
             if (Ensuite_WXA50_Power.state == OFF) {
                Ensuite_WXA50_Power.sendCommand(ON)
                 spotify_current_device_id.sendCommand("b8e79eb9ab94c17b699b3722c5bee4b2af44617f")
                 spotify_action.sendCommand('play', "spotify:playlist:7g8kXqj2ncZjxtqT5DuI6r")
                }
             if (Ensuite_WXA50_Power.state == ON) {
                 spotify_current_device_id.sendCommand("b8e79eb9ab94c17b699b3722c5bee4b2af44617f")
                 spotify_action.sendCommand('play', "spotify:playlist:7g8kXqj2ncZjxtqT5DuI6r")
                }

       }

Thanks!

If you have a Premium subscription of Spotify, you can connect Spotify with Google Chromecast and then stream Spotify to Chromecast. This is the traditional method to cast Spotify to Chromecast. However, you could have a try of the ultimate solution to play Spotify music on Chromecast or Chromecast Audio. You could download Spotify playlist to mp3 with TunesKit tool.

To get started to listen to the Spotify playlist via Chromecast, there are two ways to do this. The most common way is to cast Spotify to Chromecast from iPhone or Android devices with the help of the Spotify app and Spotify Connection. The way is available for Spotify Premium users.
Another way for free users is to use a professional Spotify Downloader to convert Spotify songs offline and transfer them to Google Play Music and then use Chromecast to stream Spotify for playback.

Do you have Spotify Premium or not ? if you have Premium,it could easily to achieve,but is you are using the free account you may need to settle for the right tool, that is, Tunelf Spotify Music Converter. It will carefully convert Spotify music to a playable format, suitable for any media player or device. :smiling_face_with_three_hearts:

Since you can cast an mp3 file to your Chromecast device using the PlayURI-channel, why not try downloading your playlists on Spotify to MP3? There are many tools online which can help you download Spotify to other formats without losing sound quality.

Spotify Premium can help you listen to Spotify playlists on Chromecast. Spotify Free needs to use an additional tool such as AudKit Spotify Music Downloader to download and transfer Spotify playlists to Chromecast for offline listening.

Hello, I try to connect is to launch a playlist on a google mini with spotify, I use the “item” url of chrome cat for that, with the following parameters:

GoogleMiniBureauPlayuri.sendCommand (“spotify: user: me: playlist: Group therapy 344”) but nothing works, have you an explanation of how to format this url? because I can not find, thank you in advance.

ps: if I run the spotify voice on the google mini it works, but via playuri it does not work

Did you find a solution for this? I’m looking for the same, but for some reason I can’t get my google mini to play spotify without talking to it. Via Openhab it’s not working unless it’s already playing.

Hi, but why the spotify app, can change to this “offline” devices?

Best Regards,