Switch *changes*

For one, you probably would want to grab this app:

And use it for the "time switches". If a switch is turned on in the group, all the others will be turned off. Then, you'll probably want to have a rule per "time switch".

Lastly, I think you'll want to kick to "wait" instead of delay.

So, if any switch is turned on, we'll set the 'timeoutNumber' (call this whatever you'd like) to the time, in minutes, we want the fan to run for based on which switch it was.

We check to make sure at least one contact sensor is open. If it is, then turn the fan on. The wait will turn the fan off if all the contact sensors are closed OR if all the switches are turned off (this would be for a manual override). If either happens, then the fan will be turned off. If neither happens, the wait will timeout after however many minutes the variable is set to.

If another switch is turned on, then the wait is auto cancelled and the next wait time will be set to the variable. So, if you turn on fanOn60, but after 20 minutes you turn on fanOn120, then the rule will start over and turn the fan off after another 120 minutes have passed.

2 Likes