Spotify playlist through Google Home Mini

Using Hassio and now having a Google Home Mini that i would like to play a certain Spotify playlist as wake-up alarm.

Is there anyone that have a working config already?

I have tested this without success.
So what am i doing wrong?

script:
    morning_music:
        sequence:
          - service: media_player.volume_set
            data:
              entity_id: media_player.googlehome6157
              volume_level: 0.50
          - service: media_player.play_media
            data:
              entity_id: media_player.spotify
              media_content_id: spotify:user:dawnlord:playlist:6YrwtfevNdgc44vI2HiO5j
              media_content_type: playlist

automations:
- alias: 'test'
  initial_state: true
  trigger:
  - platform: time
    at: '17:45:00'
  action:
    service: script.turn_on
    entity_id: script.morning_music

This works when i already have the mini fired up.
But in the morning when i havent played anything yet script doesnt start.

morning_music:
    sequence:
      - service: media_player.select_source
        data_template:
          entity_id: media_player.spotify
          source: media_player.googlehome6157
      - service: media_player.play_media
        data_template:
          entity_id: media_player.spotify
          media_content_type: playlist
          media_content_id: spotify:user:spotify:playlist:37i9dQZF1DX2MyUCsl25eb
1 Like

Have you tried the turn_on command?

Something like this at the top of the sequence maybe?

- service: media_player.turn_on
            data:
              entity_id: media_player.googlehome6157

When i tried that there was a blipping sound but nothing more

Since i have several mini’s i have created a tts-script that engages the spotifylist.
That sorted out my problem :slight_smile:

play_spotify_list:
    sequence:
      - service: media_player.turn_on
        data:          
          entity_id: media_player.googlehome
      - service: media_player.volume_set
        data:
          entity_id: media_player.googlehome
          volume_level: 0.50
      - service: tts.google_say
        data_template:
          entity_id: media_player.googlehome
          message: >
           Hey Google. Play Spotify playlist {{states.input_select.spotifylist.state}} on {{states.input_select.speakers.state}}.
1 Like

@dawnlord

I have been trying to get this working on my system, in my automations.yaml I have added:

alias: 'test'
initial_state: true
trigger:
- platform: time
  at: '22:45:00'
action:
  service: script.turn_on
  entity_id: script.morning_music 

and in the scripts.yaml I have entered:

play_spotify_list:
    sequence:
      - service: media_player.turn_on
        data:
          entity_id: media_player.googlehome2409
      - service: media_player.volume_set
        data:
          entity_id: media_player.googlehome2409
          volume_level: 0.20
      - service: tts.google_say
        data_template:
          entity_id: media_player.googlehome2409
          message: >
           Hey Google. Play hot hits australia on study speaker

Unfortunately running the script manually does nothing, am I missing something?

Did you ever figure out how to do this without the work-around with TTS? Also, does the TTS actually announce the “Hey Google” part out loud?

Also haven’t been successful in getting this to work.

Yes it announces it all out loud, it works but not a good solution for me.

I have still been unable to get it going, did you have any joy?

@dawnlord
@arretx

No no luck yet :frowning:

You can do this via Logitech Media Server. It has a castbridge to connect to all devices with google cast and you can expose any chromecast device (or group) as a Spotify connect client. However, i do not recommend doing this on a rpi… in my tests it was not able to handle the transcoding well.

ok I understood that there is no way to control spotify with Home Assistan even if they claim that you can do it :slight_smile:
current implementation for spotify needs a running client and it is not even able to start spotify on a satellite like Google Home or Echo.

So we need to say that HA has no support for Spotify yet.

1 Like

Hi guys,
I will able to do that with spotcast component. Its works fine even with idle cast devices.

1 Like