How to program Alexa without voice command but with motion detection

I’m seeing some confusion here about the current state of Amazon Alexa routines, because they did change early this year in quite a significant way.

First of all, as @rontalley mentioned, Alexa routines are already designed to do the first part of this. If you have a physical sensor which is known to Alexa, usually a motion or contact sensor, you can just use that as the trigger for an Alexa routine. Super simple and works well. :sunglasses:

Next, as @ogiewon mentioned, Amazon very recently added the ability to use a “custom action“ as the last step in an Alexa routine. This will be the exact equivalent of speaking that particular command to Alexa. So, if your custom skill is triggering a skill which has a call and response format, that skill will be activated and that call and response format will take place.

This is not a loophole: it’s intentional. It was done specifically to provide a method for routines to handle security skills which request pin codes, and also to handle some of the vacuum cleaner skills, which often have a call and response.

The security part of all of this is handled by the Alexa skill, not the routine. And it will allow for multiple questions and answers as long as the skill itself does.

The Original Question

So to do this as described by the OP, you aren’t doing anything with smartthings or with virtual devices. It’s all being done through Alexa features.

First, you just use an Alexa routine to recognize the sensor as a trigger.

Second, the last step of that routine should be a custom action to trigger an Alexa skill that you wrote that has whatever call and response you want.

So any more questions on the details of doing all of that should go to an Alexa developers forum, of which there are several. :sunglasses:

The only way that smartthings would be involved is if you wanted to put a lot of additional logic around when the trigger occurred. Otherwise, as @nathancu Suggested, it could get pretty annoying.

For example, if you wanted to ask the breakfast question only once each day, you could put that logic in Webcore on the smartthings platform and instead of triggering your Alexa routine from the physical sensor, you would let smartthings evaluate the physical sensor notifications and then turn on a virtual sensor if you did want to go into the Alexa stuff.

But you only need all of that if you can’t get the screening logic that you want in the Alexa routine itself. It does have some like time of day, but you could get way more complicated in smartthings.

Here is the community FAQ on using a smartthings virtual sensor to trigger an alexa routine:

FAQ: Can I trigger an Echo Action without Speaking to It?

I hope that helps clear up some of the confusion. Amazon has been increasing the functionality of Alexa routines for about a year now, and they have many options that they didn’t used to. So it’s possible that the original use case may end up being very simple as far as the sensor part, but will require writing an Alexa skill to go with it.

3 Likes