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.
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.