SmartThings Community

Run routines through Alexa

(John Johnston) #1

I understand that you cant run ST routines through Alexa when it involves locks etc.
I have a routine in ST to disable my motion sensor in the living room ( basically switches to a created mode ) and im trying to have this ran through Alexa so I can ask her to run the command. Is there anyway to do this at all? it comes up with the security error, probably because of the motion sensors. Is there any way around this at all?


(Andy - United Kingdom) #2

If you create a virtual switch you can make this switch run the routine.
Then use Alexa to turn the switch on/off

(John Johnston) #3

Great. ive created the virtual switch and see it within ST. How do i tie that into a routine? Had a look but cant see how to

(John Johnston) #4

Found it buddy. Didnt realise it was there right within the routine.
Thanks again

(Andy - United Kingdom) #5

Glad I could help :slight_smile:

(John Johnston) #6

Hmm, pretty sure i have it set up correctly, but alexa is saying "that command doesnt work on < name of the routine >


(John Johnston) #7

I think the problem is once the command is run, it switches “on” the simulated switch. Do you know if there is a way to have this automatically switch back to “off”

Reason being is I’d never have to have it switch off as this command would only be ran for the wife occasionally. Once things happen, we leave etc, it’ll automatically switch motion back on.


(Stephen Hill) #8

Sounds like you want a ‘momentary tile’ virtual switch.

(John Johnston) #9

Would Alexa pick this “device” up though?

(Andy - United Kingdom) #10

Yep! :slight_smile:

(Andy - United Kingdom) #11

I have a virtual switch DTH with a variable (configurable) off if you would like to try it?

You can configure it for a 5 second off and that would sort your issue out.

Seems to work reliably for me (used for the same thing)

And here is info on installing if you are not familiar with it:

(John Johnston) #12

Thats brilliant mate. Thanks.

(John Johnston) #13

Im still getting this "that command doesnt work on < name of the routine >

The button works as i can go into the alexa app and push the button. But none of my phrases work. ive set up

“turn of motion sensor"
switch off motion sensor”

What commands are you using Cobra?

(Andy - United Kingdom) #14

Ok… Alexa commands are a pain…

1st you need to name the virtual switch something completely different
I use things like L01 (Lounge switch 01)

Then create a group in Alexa that reflects the something intelligent like; Lounge Switch
Then add the switch (in my case L01) to the group in the Alexa app.

Then say ‘Alexa turn on lounge switch’ and you’ll find it works.


  1. do NOT import the routine into Alexa - ‘she’ should not know anything about that - just the switch
  2. You have to make the alexa group name totally unique
    i.e If you call it ‘Lounge Lights’ for example, alexa will get confused if you have another group called ‘Lounge Lights 1’

I’m not sure how ‘she’ will respond to ‘Motion’ e.g. ‘turn motion on/off’ (Motion may well be a ‘protected’ keyword for future use.)
But you might get away with ‘Alexa turn on MotionStop’ (call the group MotionStop and put your Vswitch into this group)

(John Johnston) #15

Think I got it buddy. I wasnt creating a group within Alexa and adding the switch. I was going into Alexa, creating a routine and typing in “turn on motion detection” and adding it there.
Seems this is not the correct way to do it.

Thanks again

(Andy - United Kingdom) #16

Glad you got it sorted