Update: Creating home assistant interface to alexa playlists

I stumbled upon https://github.com/custom-components/alexa_media_player/wiki#what-this-is which gave me the information I needed to directly control my echo device, instead of having one echo command via voice another.

Read my post https://robertjwallace.com/creating-home-assistant-interface-to-alexa-playlists/ for background.

The difference between what I was doing in that post and what I am doing now is in the scripts.yaml file. The code to directly control my echo is:

message_alexa:
  sequence:
    service: media_player.play_media
    data:
      entity_id: media_player.echo_living_room
      media_content_id: "Alexa play {{ playlist }} playlist on echo living room"
      media_content_type: custom
message_pandora:
  sequence:
    service: media_player.play_media
    data:
      entity_id: media_player.echo_living_room
      media_content_id: "Alexa play {{ station }} on pandora on echo living room"
      media_content_type: custom

You can see that I added Pandora through Alexa and also that I am now passing parameters to the script. I am passing the playlist to the message_alexa script and am passing the station to the message_pandora script.

The Lovelace card code now looks like:

type: 'custom:mini-media-player'
entity: media_player.echo_living_room
icon: 'mdi:amazon'
artwork: cover
shortcuts:
  columns: 2
  buttons:
    - icon: 'mdi:account-cowboy-hat'
      name: Country
      type: script
      id: message_alexa
      data:
        playlist: country
    - icon: 'mdi:baguette'
      name: French
      type: script
      id: message_alexa
      data:
        playlist: french
    - icon: 'mdi:piano'
      name: David Lanz
      type: script
      id: message_alexa
      data:
        playlist: david lanz
    - icon: 'mdi:cat'
      name: Easy Listening
      type: script
      id: message_alexa
      data:
        playlist: easy
    - icon: 'mdi:music-circle'
      name: Irish Tenors Pandora
      type: script
      id: message_pandora
      data:
        station: Irish Tenors
tts:
  platform: alexa
  enity_id: media_player.echo_living_room

The next steps will be to add check boxes to select which echo device to use.

Leave a Reply

Your email address will not be published. Required fields are marked *