Echo Devices (Alexa) as Media Player - Testers Needed

OK it sounds like a good idea, but could you help me with the input select by putting in your code and I’ll replace it with my devices? Cause I tried but I couldn’t get it to work. And also if it’s possible to get the code for input select for the music please?

Thank you in advance.

Also, how do you make the map afterwards?

input_select:
  choose_music:
    name: Choose Music
    icon: mdi:music
    options:
      - Album Doo Wops and Hooligans
      - Album Unorthodox Jukebox
      - Cher
      - Playlist Easy
      - Playlist Eagles
  choose_player:
    name: Choose Echo Device
    icon: mdi:amazon
    options:
      - study
      - lounge
      - portable
      - show
      - bedroom
      - bathroom
      - spare_room

Great thanks, but it’s impossible to create a map that includes all of this. You’re really nice.

Here is my code for the card but, the scripts do not work, I can choose them in the list but it does not change when I select another one, the same for the other speakers I have only Terrace which works.

Thanks for your help

type: vertical-stack
cards:

  • type: conditional
    conditions:
    • entity: input_select.amazon_selection
      state: Amazon
      card:
      type: entities
      style: |
      ha-card {
      background-image: url("/local/black.jpg");
      background-repeat: no-repeat;
      background-size: 100%, 100%;
      border-left: solid 1px rgba(80,80,80,0.4);
      border-right: solid 1px rgba(80,80,80,0.4);
      }
      entities:
      • input_select.amazon_selection
      • type: divider
        style:
        height: 10px
      • script.amazon538
  • type: entities
    style: |
    ha-card {
    background-image: url("/local/music-2.jpg");
    background-repeat: no-repeat;
    background-size: 100%, 100%;
    border-top: solid 1px rgba(80,80,80,0.4);
    border-left: solid 1px rgba(80,80,80,0.4);
    border-right: solid 1px rgba(80,80,80,0.4);
    }
    title: Music
    show_header_toggle: false
    entities:
    • input_select.speakers
    • type: divider
      style:
      height: 10px
    • input_select.amazon_selection
  • type: conditional
    conditions:
    • entity: input_select.speakers
      state: Terrasse
      card:
      type: ‘custom:mini-media-player’
      entity: media_player.atelier_nico
      icon: ‘mdi:amazon-alexa’
      background: /local/black.jpg
      artwork: cover
      artwork_border: true
      show_source: true
      style: |
      ha-card {
      border-left: solid 1px rgba(80,80,80,0.4);
      border-right: solid 1px rgba(80,80,80,0.4);
      border-bottom: solid 1px rgba(80,80,80,0.4);
      }
  • type: conditional
    conditions:
    • entity: input_select.speakers
      state: Echo Studio
      card:
      type: ‘custom:mini-media-player’
      entity: media_player.nicolas_echo_studio
      icon: ‘mdi:amazon-alexa’
      background: /local/black.jpg
      artwork: cover
      artwork_border: true
      show_source: true
      style: |
      ha-card {
      border-left: solid 1px rgba(80,80,80,0.4);
      border-right: solid 1px rgba(80,80,80,0.4);
      border-bottom: solid 1px rgba(80,80,80,0.4);
      }
  • type: conditional
    conditions:
    • entity: input_select.speakers
      state: Dot Salle de bain
      card:
      type: ‘custom:mini-media-player’
      entity: media_player.dot_salle_de_bain
      icon: ‘mdi:amazon-alexa’
      background: /local/black.jpg
      artwork: cover
      artwork_border: true
      show_source: true
      style: |
      ha-card {
      border-left: solid 1px rgba(80,80,80,0.4);
      border-right: solid 1px rgba(80,80,80,0.4);
      border-bottom: solid 1px rgba(80,80,80,0.4);
      }
  • type: conditional
    conditions:
    • entity: input_select.speakers
      state: Bose
      card:
      type: ‘custom:mini-media-player’
      entity: media_player.salon
      icon: ‘mdi:amazon-alexa’
      background: /local/black.jpg
      artwork: cover
      artwork_border: true
      show_source: true
      style: |
      ha-card {
      border-left: solid 1px rgba(80,80,80,0.4);
      border-right: solid 1px rgba(80,80,80,0.4);
      border-bottom: solid 1px rgba(80,80,80,0.4);
      }

and this is my script:

amazon538:
alias: Playlist Amazon
sequence:

  • service: media_player.play_media
    data_template:
    entity_id: '{% if is_state(“input_select.speakers”, “Dot Salle de bain”) %} media_player.dot_salle_de_bain
    {% elif is_state(“input_select.speakers”, “Echo Studio”) %} media_player.nicolas_echo_studio
    {% elif is_state(“input_select.speakers”, “Partout”) %} media_player.partout
    {% elif is_state(“input_select.speakers”, “Terrasse”) %} media_player.atelier_nico
    {% endif %}

    '
    

    media_content_id: '{% if is_state(“input_select.amazon_selection”, “playlist Pop Urbaine Validée”)
    %} playlist Pop Urbaine Validée {% elif is_state(“input_select.amazon_selection”, “playlist La Crème Rap Français”)
    %} playlist La Crème Rap Français {% elif is_state(“input_select.amazon_selection”, “playlist Les hits Pop urbaine”)
    %} playlist Les hits Pop urbaine {% elif is_state(“input_select.amazon_selection”, “playlist Les hits Pop”)
    %} playlist Les hits Pop {% elif is_state(“input_select.amazon_selection”, “playlist Les dernières nouvautés”)
    %} playlist Les dernières nouvautés
    {% endif %}

    '
    

    media_content_type: AMAZON_MUSIC

This is my lovelace card

      type: entities
      title: Favourite Music
      show_header_toggle: off
      entities:
      - entity: input_select.choose_music
      - entity: input_select.choose_player
      - entity: script.playmusic
        name: Play Music
        icon: mdi:play

Okay, thanks for your help, but it’s not working for me. I think I must have a mistake in one of my files. If you see anything weird, let me know. Thank you so much for your help.

Part of the issue is you may not be copying the code correctly but we can’t tell since your’e not using quoting. The spacing is important with yaml. Please make sure you quote your code using triple ` on its own line before and after.

```yaml
YAML CODE I WANT PEOPLE TO SEE.
```

Hi, good it’s good everything works perfectly, on the other hand, I have an echo that doesn’t update in the playlist, i.e. when the music starts, its state doesn’t change and so I can’t pause or play, on the other speakers no problem, these are also echoes.

Thank you very much for your help

Ok, yes I want to and I agree with you on the other hand, I don’t know how to integrate it as yaml code on the site.

Thanks to you.

Hey guys,

may I ask you again how to enable shuffle for an amazon music playlist?
Thanks a lot!

Hi, I put, Playlist Name

Hello do you know how to play radio with Alexa media player?

Can we call a radio skill? If so how?

Thanks to you

 - service: media_player.play_media
   data:
      entity_id: media_player.alexa_kitchen_2
      media_content_id: VRT MNM
      media_content_type: TUNEIN

TuneIn is good service you can use. media_content_id is a radio station

Okay, so just thank you?

Don’t you need to create an account?

Is it possible to make input select?

I believe tunein is free to use. A free account is possible. I don’t pay for it at the moment and works great.

Myself I made different scripts for different stations.
So my input select will run the correct script.
Maybe better ways are possible? but I use this for now.

                    - type: 'custom:mini-media-player'
                      entity: media_player.alexa_kitchen_1
                      name: Alexa Keuken
                      artwork: cover
                      group: true
                      shortcuts:
                        columns: 4
                        buttons:
                        - name: MNM
                          type: script
                          id: script.alexa_kitchen_1_play_mnm
                        - name: StuBru
                          type: script
                          id: script.alexa_kitchen_1_play_stubru
                        - name: Q-Music
                          type: script
                          id: script.alexa_kitchen_1_play_qmusic
                        - name: Spotify
                          type: script
                          id: script.alexa_kitchen_1_play_spotify
                    state_filter:
                      - playing
                    card:
                      type: entities

Okay, great. Thank you so much for your solution. It works perfectly.

Any suggestions? I keep getting this screen after selecting what method to use for 2fa.

image

My next step was going to be trying to change the User Agent Strings in the request so it could be seen as a different device.

I’ve never seen that screen before so would need logs and the html page to figure out the proper way to respond. Are you using app to add the integration? Please reference the issue fork workarounds and how to submit logs.