Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Trixster

macrumors member
Original poster
May 18, 2009
67
15
Is there a way to add two "if this" commands to the IFTTT app in iOS?
I´d like to add a command that turns on my Telldus lights if I get home after dark, so in essence I need to add both the location (arriving home) and a time (after 16:00) then my lights turn on. But as of now I can only add one "if this" command, so either the location or the time, not both... is there a way around this?
 
In conventional programming, what you're asking for is called a "nested if", or if there are logical operators available, a boolean condition.

A quick google of ifttt nested if finds this article:
https://medium.com/@pebneter/when-if-is-not-enough-55b6e57d8742

There are other results, so it's worthwhile doing the search yourself.


I've never used ifttt myself, so I can't say if there's a simpler way to accomplish the goal. Personally, the inability to use boolean operators as conditionals (A and B, A or B) would be a pretty big show-stopper for me.


This is your stated conditional:
both the location (arriving home) and a time (after 16:00) then my lights turn on.​

The word "and" is the boolean operator. If that exists in ifttt then use that.

To structure a nested if from the conditional:
if ( arriving home ) then
if ( after 16:00 ) then
turn lights on​

The indentation shows which statements are conditioned on a preceding statement.

The AND is implicit in this structure, where "turn lights on" must first satisfy 2 conditions.
 
Last edited:
In conventional programming, what you're asking for is called a "nested if", or if there are logical operators available, a boolean condition.

A quick google of ifttt nested if finds this article:
https://medium.com/@pebneter/when-if-is-not-enough-55b6e57d8742

There are other results, so it's worthwhile doing the search yourself.


I've never used ifttt myself, so I can't say if there's a simpler way to accomplish the goal. Personally, the inability to use boolean operators as conditionals (A and B, A or B) would be a pretty big show-stopper for me.


This is your stated conditional:
both the location (arriving home) and a time (after 16:00) then my lights turn on.​

The word "and" is the boolean operator. If that exists in ifttt then use that.

To structure a nested if from the conditional:
if ( arriving home ) then
if ( after 16:00 ) then
turn lights on​

The indentation shows which statements are conditioned on a preceding statement.

The AND is implicit in this structure, where "turn lights on" must first satisfy 2 conditions.

Thanks! I´ll give it a try.
I agree that the "nested if" is a pretty big downside of ifttt, but the fact that ifttt supports just about every automation hardware available (not really, but a lot more then competing apps) is crucial.
 
I think it’s totally crazy that IFTTT hasn’t become IFT&TTT. Surely Siri Shortcuts or something else will end up killing it if it stays as it is, as it is pretty much useless to HomeKit devices and extremely limiting to everything else.
 
Last edited:
  • Like
Reactions: Trixster
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.