How to trigger Alexa routines from Home Assistant

Essentially you need three things to make this work:

  1. You need a helper in Home Assistant: a Toggle helper

  2. You need a way for things in Home Assistant to be visible to Alexa: the simplest solution is a Nabu Casa subscription and the Home Assistant Alexa Skill. You will then need to expose the toggle helper to Alexa.

  3. A Routine in your Alexa app: This will respond to the change in state of the helper toggle and do whatever you set the routine to do.

1 Like

I should have mentioned that I’ve tried this with a toggle helper as well. The strange thing there is that running the routing from the Alexa app on my phone via voice control works perfectly. If I ask any of my echo’s the same thing, I just get a ‘dum dum’ like response and it doesn’t work.

This did prompt me to do some more testing today though and I’ve found that for whatever reason, the voice command I was using just wouldn’t work. I tried changing it to something else that is similarly worded and it works without any issue!

I can use some help… I want to have an Automation whereby a TIME Trigger and a CALENDAR Condition runs a Alexa Routine. How do I do that ? I am not very familiar with Yaml and by far prefer the Visual Editor. Thanks !!!

Hi,

I’ ve tried to create a binary sensor with device class “door” to act as a door sensor. It’s OK with HA but if I attempt to expose to Alexa trought Emulated Hue or HA Bridge, always detected as a light and can’t create a routine event.

My Goal is to be able to launch an Alexa routine from a virtual button on HA

I didn’t use Nabu Casa

Many Thanks

EDIT : " The Emulated Hue integration provides a simpler alternative to use utterances such as “Alexa, turn on the kitchen light” . However, it has some limitations since everything looks like a light bulb."

D’oh !

That does not require anything but the Alexa Media Player custom integration.

service: media_player.play_media
data:
  media_content_id: Lacrimas Button Routine
  media_content_type: routine
target:
  entity_id: media_player.den_echo_dot

The value for media_content_id is the name of the routine in the Alexa app. It must match exactly.

1 Like

I tested it too but it didn’t work either, no error on the HA side but nothing happened on my echo dot. I therefore thought that it was necessary to trigger via the routine event

Is it possible to ENABLE/DISABLE (not trigger!) an Alexa rountine from HA?
I have configured a routine that detects motion through the built-in ultrasonic motion sensing of echo dot. I’d like to enable the routine when I’m not at home and disable it when I am at home.

service: media_player.play_media
data:
  media_content_id: enable <ROUTINE NAME> routine
  media_content_type: custom
target:
  entity_id: media_player.echo_dot
1 Like

@Didgeridrew
Just for the readers: your suggestion only works in some countries (it should in US and UK) but not in other countries (e.g. Italy, but I’ve seen many others complaining it does not work in their country too).
So in those other countries, you can’t enable/disable a routine just sending a voice command to Alexa, the only option is doing it through the app.

1 Like

Maybe I am missing something here but I have set up the routine in Alexa as test, then created the below:

alias: Robovac Test
sequence:

  • service: media_player.play_media
    target:
    entity_id: media_player.office_echo_15
    data:
    media_content_id: Test
    media_content_type: routine
    metadata: {}
    mode: single

There is an Alexa routine called test thats starts my Eufy Robovac. I would use the Eufy Custom Integration, but for some reason it finds my vacuum but all entities are unavailable.

The script in HA says its run, but nothing actually happens

Any help would be appriciated.

  1. The value for media_content_id must match the routine’s name exactly including capitalization, punctuation, and spaces. Double check that they match.

  2. Please format your configuration properly, so we can tell if that is contributing to the problem.

  3. As mentioned above by skydado, some functions may be region-locked by Amazon.

Hi Drew, thanks for the reply.

  1. Correct all matches. Why I choose something as simple as test, as a test.

  2. screenshot attached as my formating comes out as above when I copy and paste.
    example attached

  3. Tried something at first as triggering a light to turn on however no dice.

hy, i try this but not works, can help me , alias: Test alexa
description: “”
trigger:

  • platform: event
    event_type: “”
    condition:
    action:
  • service: media_player.play_media
    metadata: {}
    data:
    media_content_id: Buongiorno
    media_content_type: routine
    target:
    entity_id: notify.alexa_media_echo_dot

See Post #153.

try out this:

I had a input_boolean in HA triggering a routine in Alexa. This was working flawlessly although it stop working about two weeks ago… The integration is working fine between HA and Alexa. If the input_boolean status changes from HA it gets updated in alexa and viceversa. If the routine is manually triggered from alexa it also works just fine… But for some reason the routine does not want to run when the input_boolean changes it’s value. I even tried creating a template switch and using the input_boolean as the status for the template switch but same results… the alexa routines are not being triggered when the value of the HA devices changes…

any ideas that could be the culprint ?