Pause spotify, use TTS, continue spotify

I was looking for an example configuration on how to pause a playing spotify, use tts (text to speech) to say something relevant and then continue playing spotify again.

Currently tts just stops spotify. Im using a chromescast audio for playing music. but I want my HA notifications also on the same speakers. But without ruining my music…

Even better would be if the audio can be mixed…lower music volume and overlay speech. But I understand that my hardware (chromecast) is not capable of that.

I struggle with this as well. Would love to know what type of hardware I would need to buy/build to mix signals but because the CCA directly pulls the music, I don’t think it would be possible without an intermediate source.

What I have done though is prevent TTS from stopping music from playing. so when the party is going and music is playing, it doesn’t stop to let me know that the thermostat just turned on. :slight_smile:

https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/script/voice_notify.yaml#L34-L43

Has anyone ever found a solution to this problem?

Hey Carlos. That link is no longer valid. Could you possibly let me know how you achieve this now as I’m about to start walking with a limp as when my wife is playing music and it stops because of a notification, I get yelled at :frowning:

I’d like to send notifications to all six Google Homes and all three Echo Dot’s (Alexa Media Player installed) but exclude any device that has media_content_type: music. Is that doable?

1 Like

I don’t have this issue any more since I Stream music via echos and TTS via CCA and then just use a mixer to mix the tracks together (so TTS plays right over the music a little louder).

But you could do some fancy jinja to check for music playing… should work… here’s some jinja that might get you on your way.

This is something that I also would like to do (to resume playing after a TTS notification).
I found a thread that might help into achieve this, but if possible, we would have to adapt to our needs, since it is a islamic prayer system. It uses Google home but I think it can be used with CCA instead.
The thread is here.

What This Automation Does: When it is time for the prayer, in the below sequence ->

All the media in the house is muted/paused
The volume of the Google Home devices is adjusted (super low for early morning ~5am prayer)
The Adhan plays 5 times a day at the correct prayer time. All at the same time through all the speakers (synchronized)
All the media in the house is un-muted/un-paused to resume previous activity and state

Thanks Carlos. Sorry, I forget you were using a mixer. I found a solution that seems to work very well now.

1 Like

So? What was your solution?
I’m facing the same problem now, trying to have my doorbell chime through my Home devices. This stops the music in it’s tracks though. Without the possibility to say “Resume music” afterwards.

Good point! I’ve posted my working solution here https://gist.github.com/xbmcnut/09cfe7509dccb01ad512a5c6d4baa519

2 Likes

Thanks for sharing, this works really well for my setup!

1 Like

Hey guys!

I struggle with the same issue. I like to have alexa stopping and resuming spotify on my Denon AVR.
I took a look into the proposed solution but didn’t really get it.

I found this:

spotify_favorite1:
  alias: Spotify MNM
  sequence:
  
  -  service: media_player.select_source
     data_template: 
       entity_id: media_player.spotify
       source: Denon AVR-X4000
  -  service: media_player.volume_set
     data:
       entity_id: media_player.denon_avrx4000
       volume_level: 0.15          
  -  service: media_player.play_media
     data:
       entity_id: media_player.spotify
       media_content_id: spotify:user:1112984459:playlist:3ubAuVo0RldsGEogXJTOAS
       media_content_type: playlist

It helped me getting my denon to play the desired spotify playlist. But it starts all over instead of resuming.

Alexa itself supports the command “Alexa, continue in my living room”. Most of the time it continues playing spotify on my denon in my living room. but not always ;(

Thanks a for any help!

archived it with this config:

alias: spotify
sequence:

  • service: media_player.select_source
    data_template:
    entity_id: media_player.spotify
    source: tek
  • service: media_player.media_play
    data:
    entity_id: media_player.spotify

it will continue the playlists track at the second it pauses:

alias: stop media
sequence:

  • data: {}
    entity_id: media_player.tek_3
    service: media_player.media_play_pause

to avoid confuses, my denon avrs entity name is “tek_3”, but in spotify its called “tek” within its sources.