Trigger actions in HA using a custom sentence via Amazon Echo devices

Having gotten fed up of Alexa forgetting devices and routines stopping running, I’ve moved across to a HA Yellow and ported all of my devices across.
Activating lights via motion sensors, switching them off again after set times or lack of motions, etc works fine, as does asking Echo/Alexa to switch on or off a certain light or plug socket.

Previously, with Alexa, I had customer sentences set to trigger a sequence of events. For example: “Alexa, goodnight” would switch off all the downstairs lights, stop any music, switch on the staircase lights, and start the robot vacuum cleaner.
I cannot figure out how to recreate this functionality via HA, or if it is even possible.

I would like to create a custom sentence, which I can say to any Alexa device, have it passed to HA, and have HA trigger automations or scripts. Can this be done, currently?

What I do is this:

  • Create a script in HA that does the things you want
  • Expose the script to Alexa - Alexa will have it as a scene
  • Create a routine in Alexa that runs your script (turns the scene on) when you say the words you want to use
2 Likes

How did I not figure that out!?

Works perfectly, thank you!

1 Like
  • Expose the script to Alexa - Alexa will have it as a scene

How would you be able to do so? I’m very curios about the solution…

Since the post is tagged with nabu-casa and cloud I’m guessing he did it with this:

You can also look into doing it manually, or use the emulated hue trick.
I’ve used emulated hue in the past, it worked well enough. You create a helper input_boolean to turn on/off via Alexa, and HA triggers an automation on its end when the helper’s state changes.

@Nerivec is correct, I’m using Nabu Casa’s Home Assistant Cloud service.

1 Like