Play Spotify on specific Google Home

I am trying to play a Spotify playlist on a specific Google Home. There are three entities available: media_player.spotify, media_player.player1 (Google Home Mini), media_player.player2 (Google Home Mini) (and some other like my Shield and Chromecast). How to target a specific media player in my automation? Naming the entity ID like below does not work. Any tips?

- alias: Spotify op Google Home 2
  trigger:
  - event_data:
      event: 1002
      id: tradfri_remote_control
    event_type: deconz_event
    platform: event
  condition: []
  action:
  - data:
      entity_id: media_player.player2
      media_content_id: spotify:user:spotify:playlist:37i9dQZF1DWSkkUxEhrBdF
      media_content_type: playlist
    service: media_player.play_media
  initial_state: true
1 Like

Anyone made any progress on this?

This will not work at all. Spotify Connect on Home Assistant will not see the Google Homes as Players. Similar to Spotify on a Windows PC. You can only select them once they are already active.
However, what you can do is to use Google Assistant as a workaround. i.e.: Sending the command via text to the google assistant.
Check this:

and this:

The above uses the Google Assistant Service, instead of the easier to use (on hassio) SDK.
However, simply using the Google Assistant SDK didn’t work last time I tried since Google decided to not accept Media commands from SDK. Maybe this has changed though…

1 Like

Thanks @AlmostSerious for your explanation. Is there any change this will change so HA will see the Google Homes as players? I would love to use the Google Homes as players but not that happy to do it the cumbersome way…

If you just want to use a single Google Home use this new custom component:

Groups don’t seem to work yet.

1 Like

Yeah, found that one and works fine. Lets hope there will be a way to shorten the time between trigger and actually playing the song.