You are right, the logic gets quite complicated if say the fan is set to spin for 8 minutes and then someone comes in for 1 minute … does the fan then spin for 8+1 minute, 1 minute or what.
Thanks Pantheon for the logic, but how would the three IF statements distinguish between each other as if the light turns off within 2 minutes all of them are true - so I think there would need to be a “under 2”, “2 to 5” and “5-20 or above” in there.
At the moment the fan runs for a standard 5 minutes after the light goes off which means a quick wee at night and the fan is spinning for ages, whereas when 3 people have a shower (one after each other - not at the same time!!!) the 5 minutes is not enough to fully extract the steam.
Hence the timer … in fact, if there are three people who go for a wee one after another (2 mins each) then I would like the timer to add it all together and run for 6 minutes.
So, basically … lights on = start timer and start fan
lights off = run the fan for the duration of the timer - timer starts to countdown
if light turns on again add more time time to the timer
I am sure that this is logically possible with variables …