Looking for an APP to delay turning something ON not off

I’m not able to write an APP but would like to have an APP that would allow me to sut up the delay turning something ON when detected by motion or presence sensor.

Can you give a real life example so I can understand better?


I’m want to turn one or more of my outlets on after let’s say 30 seconds or 1 minute after sensing motion in a room or the presence sensors arriving. There are apps that turn off after a delay why can’t someone who knows how to program the apps make one that will do the same thing but delay turning on?

Its definitely doable, I just wanted an example to see how much logic the App would need.

Are you with SmartThings?

nope, just a enthusiast. You will find a lot of us around here.

I wish I was smart enough to be able to write code. I tried one day but have no idea how to do it. I don’t have the brain for it. I would think that whoever wrote the app to turn things off where you can set up the delay time could just substitute ON instead of OFF in the code? It sounds that easy but I have a feeling it’s not that easy.

Thanks again

It is pretty easy once you get the logic of the code structure. Ive only been coding with smartthings for about 2 months. Im about done with it now. Gimme another 15min to test.

So based on your example above this is coded for an OR condition.
If motion is detected OR presence sensor has arrived.
If you want it to be an AND condition
If motion is detected AND presence is present
then the code will need some modification.

| note the runin() command used here is not the most accurate. It may take 10-15 seconds longer to respond.

Hi Brian:
Could you please guide me how to use the code you provided? at

My problem statement is that after detecting motion, a timer will be started and after 3 minutes (as example) the switch for the fan will be ON; time delay of ON for 3 minutes. and it will run for another 2 minutes and then the switch will be OFF. only one cycle. Could you please help?