Alexa integration: what to say to her?

I have the Alexa integration installed. I’m wondering how to know what specific commands I can give her to trigger exposed HA scripts and entities. For instance, I have a script called toggle_media_center that is exposed:

alias: Toggle Media Center
sequence:
  - target:
      entity_id: remote.universal_remote
    data:
      device: samsung_monitor
      command: power
    action: remote.send_command
  - delay: "00:00:01"
  - target:
      entity_id: remote.universal_remote
    data:
      device: denon_media_server
      command: power
    action: remote.send_command
  - target:
      entity_id: input_boolean.media_center_power
    action: input_boolean.toggle
    data: {}
mode: single

What do I say to get her to run this script? I tried “Alexa, turn on media center” but that didn’t work.

It is most likely " Alexa, turn on Toggle Media Center".

Yep, that did it. Interestingly, “turn off toggle media center” didn’t do anything. Tried just “toggle media center” and she complained about that.

When the interaction isn’t easily understood by Alexa, I generally use a template switch. Alexa clearly understands switch devices.

I haven’t tried it with media player commands. But you have the same ability to define each action.

Have you tested action: remote.turn_on and action: remote.turn_off commands

I’ll test it…
EDIT I tested via a Helper and it works really well with Alexa. You should also be able to eliminate the input_booleans

scripts are a bit more complicated than other entities for Alexa.

I typically setup an Alexa routine that I use my own phrase to trigger the HA script.

as an example I have a HA script I use to open or close my garage door. I expose that to Alexa so that I can use it there.

instead of telling Alexa to “turn on open the garage door” (which is unnatural) I set up an Alexa routine that uses the phrase “open the garage door” to trigger the HA script to open the garage door. Now I just say “Alexa open the garage door” and it works as expected.

I could have probably technically just exposed the garage door cover entity itself to Alexa and it would work. I just use the script as a safety to double check that the garage door is actually closed before I give it an open command. Since it’s the same button to both open and close the door if HA “pushes the button” to open the door that’s already open then the door would instead close. That’s why I use the script since I can do that check in the script.