Media Player custom play media not working with Alexa

I have a routine that is triggered by a voice message as follows:

It is working when simply speaking to Alex (including Alexa saying “all done”):

However, it is not working when called from Home Assistant:

service: media_player.play_media
target:
  entity_id: media_player.front_bedroom_echo
data:
  media_content_type: custom
  media_content_id: change to energetic

Running in Developer tools results in a call to Alexa but nothing happens as it does not trigger the routine:

I did also try from an automation and that prompted responses from Alexa such as " I didn’t find that channel" or “I can’t help you with that”.

alias: Govee - call Alexa scene routine
description: ""
triggers:
  - trigger: state
    entity_id:
      - input_select.select_govee_scene
conditions: []
actions:
  - action: input_text.set_value
    target:
      entity_id: input_text.alexa_govee_routine_name
    data:
      value: >-
        {% set routine_name = "change to " +  trigger.to_state.state %} 
        {{ routine_name }}
  - action: media_player.play_media
    metadata: {}
    data:
      media_content_id: "{{ states('input_text.alexa_govee_routine_name') }}"
      media_content_type: custom
    target:
      entity_id: media_player.front_bedroom_echo
mode: single

Trace is:

Executed: 8 December 2024 at 15:34:53
Result:
params:
  domain: media_player
  service: play_media
  service_data:
    media_content_id: change to energetic
    media_content_type: custom
    entity_id:
      - media_player.front_bedroom_echo
  target:
    entity_id:
      - media_player.front_bedroom_echo
running_script: false

I have tried inserting Alexa or Turn On in the text but to no avails. Any ideas?

The Custom command function, which emulates voice commands, will not trigger Alexa routines. To trigger routines you have to use routine as the media_content_type and the exact name of the routine as the media_content_id.

service: media_player.play_media
target:
  entity_id: media_player.front_bedroom_echo
data:
  media_content_type: routine
  media_content_id: |
    Govee - Scene - Energetic opens

Ok. Even the github repository describes sending voice commands to trigger routines using custom.

So i thought that would work.

However, if i need to use routine as the method, i am unsure as to what would be the WHEN action in the routine. I am assuming that this will be ignored if the play_media call is used?

Correct, the trigger inside Alexa is bypassed when you call the routine from HA. You can leave the voice trigger phrase as-is if you use it in person.

Ok thanks. I’ll give that a go