Routines in SmartThings are designed to trigger when a device's status changes. To work around this and trigger routines over the same status, you can use a virtual switch.


This is especially useful if you need to get a text message every 10 minutes based on the status of a device (like a water sensor displaying wet status).


Create a virtual switch and set up an automation to repeatedly turn it on and off based on your desired schedule or conditions. Then, you can create a routine that uses the virtual switch's status as the trigger. You can also include the status of other devices as preconditions for the routine to run.


1. Create a virtual switch (US/Canada only - all other regions must use zVirtualEdge driver): 

  1. Open SmartThings
  2. Tap Menu
  3. Tap Labs (beaker icon)
  4. Tap "Virtual Switch"
  5. Tap + at the top right
  6. Input:
    • Name of the virtual switch
    • Location
    • Room
  7. Save it
 
2. Create two automations to toggle the virtual switch on and off, this will give you something like a while loop as it turns on/off automatically. 

Automation 1 -
IF - Virtual Switch == ON (for 5 minutes)
THEN - Virtual Switch = Turn OFF



Automation 2 - 
IF - Virtual Switch == OFF (for 5 minutes)
THEN - Virtual Switch = Turn ON



This will trigger the virtual switch on/off every 5 minutes automatically, which you can use to trigger an automation every 10 minutes. 

3. Now Create the third automation to send yourself a SMS message every 10 minutes. 

IF - Door Window Sensor 7 == OPEN (Precondition)
And IF - Virtual Switch == ON
THEN - Send SMS message to yourself.



You can do this with any device if you want to trigger an automation multiple times while a device in your network stays in a specific state.