Using My Media for Alexa skill within Homeassistant

Hi. I’m trying to integrate the skill “My Media for Alexa” in HA to be able to listen my music when I wake up in the morning. I’m trying to send a command (as read in the Alexa Media Player integration wiki) but nothing happens. Here the script:

alias: My Media Sveglia Uno
sequence:
  - action: media_player.play_media
    target:
      entity_id: media_player.echo
    data:
      media_content_type: custom
      media_content_id: chiedi a my media di riprodurre playlist sveglia uno
description: ""
icon: mdi:alarm-multiple

I’ve also tried to start an Alexa routine without success:

alias: My Media Sveglia Uno
sequence:
  - action: media_player.play_media
    target:
      entity_id: media_player.echo
    data:
      media_content_type: routine
      media_content_id: mai media sveglia uno
description: ""
icon: mdi:alarm-multiple

Anyone could help please?

Using custom commands that are bilingual can be very frustrating. You can try “sounds like” transliteration, but it doesn’t always work.

When using routine, the value for media_content_id has to match the Routine name in the Alexa app exactly… spaces, punctuation, and capitalization all need to match.

Keep in mind that, while it is useful, AMP is on shaky ground.

Thanks! I’ve modified the script so now capitalization matches but it doesn’t work :confused:

Here is what worked for me. This is the important part for My Media. You must use ASK MY MEDIA at the start. But you can also use it without Ask My Media and put anything in there that you want Alexa to do. Play jazz music, What is the current weather forecast. Turn on bedroom light.

actions:
  - action: media_player.play_media
    target:
      entity_id: media_player.workshop
    data:
      media_content_id: "\"Ask my media to play music by yanni\""
      media_content_type: custom
    metadata: {}

In my system, I created a button group as below. Each button activates an automation that sends the command to Alexa and cycles the buttons.

Here is the code for Yanni.

alias: Play Yanni Music
description: ""
triggers:
  - trigger: state
    entity_id:
      - input_boolean.yanni
    from: "off"
    to: "on"
conditions:
actions:
  - action: media_player.play_media
    target:
      entity_id: media_player.workshop
    data:
      media_content_id: "\"Ask my media to play yanni\""
      media_content_type: custom
    metadata: {}
  - action: input_boolean.turn_off
    metadata: {}
    data: {}
    target:
      entity_id:
        - input_boolean.jazz
        - input_boolean.bone
        - input_boolean.mance
        - input_boolean.random_music
        - input_boolean.nero
        - input_boolean.70s
mode: single

Here are the different things each button does.

media_content_id: "\"Play 70s on iheartradio\""
media_content_id: "\"Ask my media to play yanni\""
media_content_id: "\"Play music by down to the bone\""
media_content_id: "\"Play some music\""
media_content_id: "\"Play smooth jazz on iheartradio\""
media_content_id: "\"Ask my media to play peter nero\""
media_content_id: "\"Play music by Junior Mance\""
action: media_player.media_stop

Good Luck.