FAQ: use a button controller to turn on a virtual switch to run a routine to change SHM alarm state (SmartThings Classic)

I wanted to use a Button press to perform Routine A immediately, and a button Hold to perform Routine B after a 1 minute delay.

  1. I created 2 Virtual Switches, VSA and VSB.
  2. I then used Smart Lighting to turn on VSA when Button is pressed. Do not check Toggle on & off.
  3. Use Smart Lighting to turn on VSB when Button is held. Do not check Toggle on & off.
  4. Next create a Routine called ‘Nothing’ that does nothing.
  5. Create a Power Alliance app that turns off VSA after 1 minute (that way button gets reset to off so you don’t need to worry about the state of the Virtual Switch)
  6. Create a Power Alliance app that turns off VSB after 1 minute (this will trigger our delay)
  7. Create Switch Activates Home Phrase app that when VSA is On performs Routine A, and when Off performs Routine Nothing (power alliance resets switch for us, but we don’t want to do anything when it does)
  8. Create a Switch Activates Home Phrase app that when VSB is On performs Routine Nothing (start our delay), and when switch is Off perform Routine B (the power alliance app turns it off after 1 minute so that’s how we get our delay)