Nesting "IF's in an "IF"


#1

I’m trying to nest two different conditions in another on line 45

IF motion is inactive
THEN
IF LIGHT (dimmer 3) was turned on by motion, turn off in 1 minutes
IF LAMP (dimmer 9) was turned on by motion, turn off after 2 minutes

I have tried all manner of changing the if’s and with’s to async, and while behavior sometimes changes, I can never get the second IF to turn off after 2 minutes.


#2

what about changing line 46 to “changes to inactive”… I think you need something to actually trigger/happen in order to get that to run.


#3

This was a simple working piston (yesterday) with just a single Dimmer3 and motion was a trigger-“changes to inactive”.
When I added the two IF’s to it, only the first IF ran. The second was completely ignored.
Changing to a condition caused them both to fire, but the timer on the second “IF” won’t start until the first IF is complete.


#4

Would it not be easier to turn those around, in two separate statements:

  1. If {lampoonmotion} is true
    AND motionsensor 13 is inactive
    Then
    With dimmer 9
    Wait one minute
    turn off
    Etc

  2. If {lightonmotion} is true
    AND motionsensor 13 is inactive
    Then
    With dimmer 3
    Wait two minutes
    Turn off
    Etc