Switch & If Statement


#1

I have a simple case setup for my fans where, depending on room temperate, I change the speed of the fans.

By itself, works perfectly.

However, I want this switch to only work if the fan is already on. If someone manually turns off the fan, I would prefer the case just to exit.

Here is what I currently have:

Where would be an easy bailout, if Fan = Off


#2

Not sure what calls this piston but I would suggest a simple block before the switch:

If fan switch is off
then
   exit "Fan is off"
end if

#3

It won’t let me add anything prior to my execute statement

Do I have to rebuild the piston from scratch ?

Also, problem with the If statement is when do I add it.

I cannot trigger the Piston with it, the case has to execute and I don’t think I can add a nested If loop into a case (I don’t think)


#4

Good point. You may have to go into the piston settings and disable event subscriptions once you add the ‘if’ statement.

You will have to add the ‘if’ after the switch and then drag it to the top. Do you know how to do drag and drop? Be sure the drag/drop icon is “on”.

-------------------------------------------------------vvvvv

51%20AM


#5

I would just add a restriction to the SWITCH (click on the funnel in the previous post to display restrictions)

Image1

Edit: My restriction should read only when “Ceiling Fan’s switch is on


#6

So simple.

Thank you. Updated Piston: