Bathroom fan auto-on/off


#1

I tried to create piston to run bathroom fan in auto, using humidity sensor and light
so,
if the just the light on for 5min then turn the fan ON then if the light Off after 5min turn the fan OFF
if the humidity sensor it greater than 80% turn the fan ON then after then if the humidity sensor less 75% turn the fan Off
if then if the light OFF and humidity geart then 80% run for 20MIN the turn OFF the fan,
can someone help me out
thank you

thank you


#2

I don’t believe line 49 will get fired when the humidity drops below 11 because the event is in an else. I could be wrong.

Try putting all the code in the else (starting at line 47) in a separate if block, outside fo the first one.


#3

thanks for your help I mad some changes can you check it, and how I can add it time 5min to line 27,
is my statement right if humidity below 75% light switch on after 5min, then switch

off wait 5min then turn a fan off
thank for your advice


#4

@kreddad amazing to see you went over and beyond by posting a flowchart for your piston with your question. thanks for making it easier for others to respond to your question, thats very helpful.


#5


I made so adjustment, just need lite help
if the line 24 it true I want te restart from line 20 any suggestion thank you