A Flexible Multi-Player / Multi-Device Music Interface

Just rechecked the documentation. Spocast is for Google Nest/Chromecast devices.
On Amazon Echo, you might have to change the Spotify player command:

          sequence:
          - service: spotcast.start
            data:
              random_song: true
              shuffle: true
              entity_id: >-
                {{ states("sensor.selected_audio_media_device")}}
              uri: "{{ (states('sensor.selected_spotify_playlist_uri')) }}"
              account: xxx

will probably have to be replace by something like this:

    sequence:
    - service: media_player.select_source
      data:
        entity_id: media_player.spotify
        source: "{{ states('sensor.selected_audio_media_device')}}"
    - service: media_player.play_media
      data:
        entity_id: media_player.spotify
        media_content_type: "music"
        media_content_id: "{{ (states('sensor.selected_spotify_playlist_uri')) }}"

Code inspired by Play Spotify track on echo dot - #5 by Burningstone. As I have never used an Echo, I cannot guarantee it works. (You might have to repace the echo entity_id by its name at different places)

1 Like