SmartThings Community

I want to create a nested condition on IFTTT or otherwise

(Douglas L) #1

How do I set up the following:

  1. Garage lights are on from sunset to 11pm.
  2. I want lights to come pon if I come home after 11 and then turn off 5 mins later.

So I want:
IF after 11pm
AND I arrive home
THEN Turn on garage lights
THEN Turn off garage lights 5 mins later

Anyway to do this?


(The fish is still dead.) #2

IFTTT doesn’t do ANDs and ORs. I think you’d need to look into building a smartapp for this.

(Greg) #3

I don’t think the smart apps can do ANDs or ORs either. at least not the ones they provide you with. Unless your AND or OR is a Mode.

(Brian Smith) #4

Wouldn’t this all be in the mode? If you are in night mode and presence is detected, it would trigger different actions than other modes…right?

The issue here is it might be 11pm but it is not “night” or “sleep” mode… :frowning:

(Taryn Brice Rowland) #5

You can definitely write AND/ORs into SmartApps if you write them yourself. If you look at the sample code they give you, it’s pretty easy to figure out.

(Chrisb) #6

Check out my SmartApp named: On when open, then off Sunset/Sunrise only

It’s in the Shared SmartApps area. It does almost exactly what you want. It looks for open/close after sunset rather than coming home, but should be pretty easy to adapt.

(Chrisb) #7


After looking at the dashboard options a little bit, I think you can do this with the built in functions.

Select the light you want to control, then Turn on when people arrive.
Now select which people.

If you scroll down there are options for Turn off after a certain duration.

And further down there are options for times when you want this to happen. The only problem here is you can’t specific sunset… you’ll just have to pick a beginning and ending time. Otherwise I think it fits all your criteria.

(Douglas L) #8

An overdue thanks, Chrisb! Your suggestion worked.

(Philipp Ebneter) #9

Hi there,

I created a cloud application called which extends IFTTT and allows you to create the setup you want without coding. Check it out and let me know if it helped!

(Paul Dubé) #10

You might want to try ImSmart. It has all the features you need and growing fast.


  • Works seamlessly with IFTTT and the majority of devices you own.
  • Enhanced control of rules allows you precise automation that you need.
  • Holds the values of your device or process state.
  • Ability to connect more than one IFTTT Maker key.
  • Execute several actions with a single trigger.
  • Delay execution of trigger actions for unprecedented control.

Check it at


As others have said, there are many different ways to do this, but as of today, March 2017, most people would use core. :sunglasses:

(Alan) #13

I may be late to the party on this posting, but here is my CoRE solution. You can substitute anything for the motion sensor in my example, like location or presence.

Before you begin, turn on Advanced Mode by going into Settings->ExpertFeatures->Expert Mode