Rountines - One routine turns lights on and off?

(Tom) #1


I’m new to Smartthings, moved over from WeMo and glad I did. So far I really like ST and and I’m happy I switched. I have a question about routines. I’ve been able to setup several routines and they work perfectly. However, is it possible to have one routine like “Kitchen Lights” either turn on or off the devices associated with the routine based on state. In other words… all “kitchen Lights” are off,

  1. Run the routine Kitchen Lights and the lights turn on
  2. Run the routine again to turn the lights off.

The reason is I have Alexa integration and would like to issue the following commands

Alexa - Turn on kitchen lights - lights turn on
Alexa - Turn off kitch lights - lights turn off

Is this possible or do you need two separate routines?


The short answer to your question is no you can’t run the same routine once for on and once for off. You would need separate routines to turn on and off the lights.

The long answer is that there is almost always a way in SmartThings to do what you want. I think in your case it will involve a virtual switch. I have never used these but I’m sure someone will come along after me and give you a more complete answer to this question.

(Michael Fitzgerald) #3

First create two routines, one to turn on the lights, and one to turn them off. Then create a simulated switch (which has to be done through the IDE, as far as I can tell.) After that, using the “Switch activates home phrase” smartapp you add the routine to turn on the lights to the “On” and the routine to turn off the lights to the “Off”. Then the simulated switch will both turn on and turn off the lights.

It sounds a lot more complicated than it is.One thing I found is that I cannot change a routine once it’s been added to a simulated switch, I have to remove and recreate it. A minor thing, but it was pretty frustrating the first time I tried to edit an underlying routine and ended up with the switch not working, even though the routine itself worked.

(Daniel Ionescu) #4

If you just want control through Alexa, you don’t need any routines. Just tell tu turn on or off the lights you need.

(Robin) #5

I have several routines which I use to toggle lights, but they need to be combined with the CoRE smartapp to work.

In CoRE:

routine X runs
using X lights
|> toggle

Or for multiple lights:

routine X runs
any of XYZ lights are on
using XYZ lights
|> turn off
using XYZ lights
|> turn on

Install instructions in post 1 of the following thread:

(Robin) #6

Your simulated switch method works to a point, but the switch won’t be synchronised with the lights in both directions. If lights are turned on manually at the wall switch or via the app, the simulated switch will remain off. When you then go to use the sim switch it has to be toggled twice causing other lights to briefly flash on / off.

Benefit of controlling via a routine is that (in iOS at least), we can swipe down from the top of the screen (with ST app closed) for quick access to the routine widgets.

(Larry) #7

You are making this way more complicated than you need. Use the device grouping in alexa.

create a new group called all kitchen lights… add all your kitchen lights found in smartthings integration to the alexa group…

Then just say alexa turn on all kitchen lights.

etc. etc.

only issue if some dim… and some dont, I don’t think you can say dim all kitchen lights.

(Tom) #8


Thank you, that worked perfectly!!!

(Tom) #9


Thanks so much for the replies, the suggestion Lgkahn provided by creating a group in Alexa with the lights worked perfectly.

(Lee Florack) #10

C[quote=“NomadTech, post:4, topic:73892, full:true”]
If you just want control through Alexa, you don’t need any routines. Just tell tu turn on or off the lights you need.

Agree. Just group them together, give the group a name and tell Alexa to turn on/off or dim/brighten by group name. No routine, or any other app needed.