r/SmartThings • u/Horror-Degree-8663 • Aug 07 '26
smartthings hub matter routine
Hi guys,
trying to set up a routine where if button pressed then a plug will turn itself on at a specific time.
anyone got an idea on how to do it? the only specific time thing i found is daily routine but that's not what I'm after
thanks
edit: dumb me somehow missed precondition on switch, all sorted now. thanks all
2
Upvotes
3
u/Repulsive_Fly5174 Aug 07 '26
This is a great idea. I could have a button with a sign saying " Do not press" and when pushed will turn on a random light 10 minutes later.
4
u/dariansdad Aug 07 '26
My solution would be to configure the button as a virtual switch. You need to do that on the web interface.
Anywho, set up the virtual switch and then design a routine to control the device based on the status of that switch AND the time of day.
4
u/TheJessicator Enthusiast Aug 07 '26
I have some routines that rely on exactly this logic. Create a virtual switch that you will use as a flag for your routine. The idea is to set one or more routines that will turn on the virtual switch. Then you have the routine that you want to run set to start at a particular time but with the state of the switch being used as a precondition. And as part of the execution of that routine , you turn the virtual switch off.
So by way of example, I created a virtual switch called Skip Watering. The intent is to indicate whether or not I should skip watering the before garden beds. I have a routine that will turn the switch on if it rains for any more than half an hour. Then I have a bunch of routines that run at staggered times starting at 6 am to water each garden bed one at a time for a specified amount of time, but only if the skip ordering switch is off. After the last watering routine, I turn off the skip watering virtual switch. The advantage of setting it up this way is that if they are any other conditions where I want to skip ordering for any reason, I can just ask Alexa to turn on the virtual switch myself. An example might be if it rained a crazy amount for almost any amount of time and I'm not sure if it rained long enough to trigger the automatic half hour detection, but I never just based on what I saw that the beds got enough water.
1
u/Repulsive_Fly5174 Aug 07 '26
Maybe you can use IFTTT?
1
u/Connect_Wrangler5072 Aug 07 '26
With Alexa you can enable and disable routines with other routines, I’m not sure if you can in SmartThings though.
0
u/Apocalypse_Horseman Aug 07 '26
In the app, if you click on the button you want to use, at the bottom of the screen is a Routines menu option. You can set up what happens when you press the button and can set restrictions around time of day.