Alexa Media Player not firing Alexa Routines

I’m struggling with calling an Alexa routine using an Alexa media player. I’ve tried the following (based on the guide here Examples: Automation · custom-components/alexa_media_player Wiki · GitHub )

alias: Test Routine Play

sequence:

- data:

media_content_id: testroutine

media_content_type: routine

service: media_player.play_media

target:

entity_id: media_player.office_echo

mode: single

The script runs, but the routine never fires. I can fire it manually from Alexa and it works just fine. I’m obviously missing something here but can’t figure out exactly what. I’m able to send TTS or have her play music from Spotify, but routines never fire.

If that is how your script is actually formatted, there is not wonder it doesn’t work. In YAML the formatting and spacing needs to be correct or it will not work. Below is a properly formatted script example that runs a routine on an echo.

### scripts.yaml

turn_on_as_amazon_plug:
  alias: Turn On A's Amazon Plug
  sequence:
  - service: media_player.play_media
    data:
      media_content_id: AS turn on A's lamp
      media_content_type: routine
    target:
      entity_id: media_player.bedroom_dot

Note that the media_content_id must match the name of the routine in the Alexa app exactly… capitals, spaces, punctuation must all be the same.

I couldn’t figure out how to get the code to paste in with the formatting. Here it is again copied directly from the script

alias: Test Routine Play
sequence:
  - data:
      media_content_id: testroutine
      media_content_type: routine
    service: media_player.play_media
    target:
      entity_id: media_player.office_echo
mode: single

Did you double-check the name of the routine in the Alexa app for capitals, spaces, and punctuation?

Yes, it all matches. I’ve even tried it on another routine to make sure it wasn’t the routine itself.

In looking at the history on Alexa, it doesn’t even look like the event is getting to Amazon. Is there a log file I can look through to see what is actually happening?

Did you ever figure it out? I’m struggling with the same problem.

1 Like