Spotify atuomation sometimes can't connect to echo (No active playback device found)


I’ve created an automation that will select an echo device as media souce (media_player.select_source) and then play a spotify playlist (media_player.play_media). I have spotify premium.

My issue is that this automation works fine in testing, but fails when it should run based trigger: trace timeline shows that fails at the play stage because No active playback device found.

I think the issue is that when I am testing, I am looking or recently looked at the spotify app on my phone, but when the automation trigger the spotify session is long dormant.

How I can “activate” the spotify session so that the automation will run smoothly?

I am trying to create an automation that will select a chosen playlist to play in the morning because my dumb echo, even if I specified what playlist I want to play as alarm, won’t make the selection and instead will play the last playlist I was listening to. As you can image the music I’m listening in evening fully awake may be non the best choice to wake to.

1 Like

Hi, have you found a solution? I’m currently running into the same issue with a different Spotify Connect device.

Yes, I found a solution, but it was so long ago that I don’t really recall what I’ve done.

I had a look at the automation that uses spotify and I think I went for a slightly different approach, but here the relevant yaml:

  - service: media_player.play_media
      media_content_id: playlist morning vibes in shuffle
      media_content_type: SPOTIFY
      enqueue: play
      entity_id: media_player.echo_camera

The command media_content_id: playlist morning vibes in shuffle is the equivalent of issuing a voice command to alexa, hence the extra bit of info. It works.