Having trouble with did not change function


#1

1) Give a description of the problem
I want to have a dimmer turn on only when multiple contact sensors did not change in last minute and only when a switch did not change in last two minutes

2) What is the expected behavior?
As above

3) What is happening/not happening?
Even if contact sensors and switch did not change in last X minutes , the dimmer is not turning on

The second and third if statements seem to be workinf fine. It’s just the first one with contact sensors and switch and dimmer in it

**4) Post a Green Snapshot of the piston!

5) Attach any logs (From ST IDE and by turning logging level to Full)
(PASTE YOUR LOGS HERE BETWEEN THE MARKS THEN HIGHLIGHT ALL OF THE LOGS SND CLICK ON THE </> ICON TO FORMAT THEM)

Thank you.


#2

Well, right now you have two if statements with the identical trigger so hard to say which one will run. You can change the only when to an if inside the trigger if and then put the when statement inside also to eliminate confusion. That will likely fix your problem. Something like this;

If switch 11 changes to on
Then
  If contacts didn’t change 
   Then 
      Do stuff 
   End if
  With
      Switch 11
     Do stuff
   End with
 End if

#3

Got it. Will update and report back