I’m sure this is possible. I have an automation to turn on a light in my porch when my garage door opens. I would like it to turn off 5 minutes later. I saw this thread:
and installed that smart app but… That app seems to turn off a device x minutes after it goes on regardless of how it was turned on. I would like it to automagically turn off x minutes after it went on but only if it was turned on because the garage door sensor reported open.
There are several ways to do this. You can certainly do it with core, which is a very sophisticated community created rules engine, but it’s quite complex to set up. And it may be overkill if all you really want is a Virtual timer.
There is another alternative which just uses the official smart lighting feature. You will have to set up 3 automations to make it work: one to turn on the timer when the sensor reports open, one to turn off the timer after X minutes, and one to have the real light follow the timer. But each of those steps is very simple in itself. And it will definitely allow you to manage the real light in other ways with other rules.
There is a how to for virtual timers is in the community created wiki:
In CoRE I have the motion from IFTTT connected sensor trigger the a virtual switch that triggers the light. You wouldn’t need this extra step and could also drop the “Else” statement.
I tend to double-up on triggers and functions as different parts of Smartthings has differing amounts of reliability. Your milage may vary…
PS You may also see that others have used rule machine in the past but that automation is no longer supported. Use CoRE instead.
Wow that was easy! I had it working in about 5 minutes. I used the suggestion provided by @JDRoberts just because it seemed the easiest. I’ll definitely be playing with CoRE, a rules engine has to be fun!
Of course, I tried to create a virtual switch to do something else, and totally screwed that up… Ah well, I’ll figure it out.