Run routines through Alexa

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?

Thanks

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

1 Like

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
Thanks

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

1 Like

Great!
Glad I could help :slight_smile:

1 Like

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

Strange.

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.

Thanks

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

Would Alexa pick this “device” up though?
Thanks

Yep! :slight_smile:

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.

https://github.com/CobraVmax/SmartThings/tree/master/devicetypes/cobra/custom-variable-switch-seconds.src

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

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

Thats brilliant mate. Thanks.

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

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.

Notes:

  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)

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

Glad you got it sorted

1 Like