Triggers on a light or a motion sensor and turns the fan ON. The trigger can be anything you like that has an ON and OFF state.
When the light or motion sensor is triggered a time delay is activated and turns the fan OFF Automatically.
The fan will stay ON if the light is turned back ON or the motion sensor detects motion before the time delay turns the fan OFF. It will then reset the time delay when the switch is turned Off or after last motion is detected.
You have the option to invert the trigger so when you turn the light OFF the fan will turn ON.
You have the option to set the “Trigger Wait Time”. This can help assume a number 2 is in progress and the fan is required.
You have the option to use a “Manual Fan Switch” that turns the fan ON or OFF independently while retaining the automation trigger functionality. Additionally, there is an auto-off feature that can serve as a manual timer.
You have the option to set a start time, an end time and select weekdays. This will only allow the automation to run between the time periods.
You have the option to use the “By-pass Options”. This allows you to add switches to manually By-pass the trigger sensor so you can use the fan as normal by turning them ON and OFF manually.
Safe guard option for HA restart.
CHANGELOG
Version: 2.4 - 28 Jan-24 Bug fix when by-pass turns OFF. Version: 2.3 - 18 Jan-24 Added logic to manual fan switch. Version: 2.2 - 16 Jan-24 Update logic on manual fan switch. Version: 2.1 - 13 Jan-24 Added manual fan switch and global conditions options. Maintenance items. fixed bugs in by-pass and inverted trigger option. Version: 2.0 - 10 Oct-23 Added a HA restart option. Version: 1.9 - 8 Oct-23 Trigger wait time now works with inverted trigger. Version: 1.8 - 8 Oct-23 Added by-pass options. Version: 1.7 - 31 March-23 Bug fix when using “Trigger Wait Option”. Version: 1.6 - 30 March-23 Added an option to invert the trigger. Version: 1.5 - 28 March-23 Update to include any domain. Version: 1.4 - 26 Jan-23 Added weekday selection. Version: 1.3 - 14 Jan-23 Added “Trigger Wait Option” & “Time Option” Version: 1.2 - 7 Nov-22 Update description and wording. Version: 1.1 - 23 Oct-22 Initial release
Q: I am using the inverted trigger option and every time I turn OFF the by-pass the fan comes ON. Can I stop this from happening?
A Yes, use the wait time. If you would like it to work without waiting then set this time to “0”. This will stop the fan coming ON when turning the by-pass OFF and using the inverted trigger option.
Q: I am using a motion sensor and the trigger wait time but the fan never comes ON? or, I am using a motion sensor and the trigger wait time but the automation is not working correctly?
A Motion sensors tend to go ON and OFF (detected and clear) in a short time period. The trigger wait time requires the trigger to be ON and remain ON for a set amount of minutes before it will turn the fan ON. The trigger wait time is best suited when using a trigger like a light or a sensor that remains ON until you leave the bathroom. If you are keen to use some type of motion sensing maybe try using a presence detectors or maybe have a short delay OFF in your motion sensor.
Q: I would like to set a different value but the slider is not letting me?
A Just simply type the number value you would like in the field and click save. A red line will appear under the number you have entered but once you click save, exit the automation and go back into it the red line will not be there.
The trigger (Light) must be ON for a set time (Trigger Wait Time) before the fan will turn ON. This is a good option if you are doing a number 1 and the fan is not required. If you are doing a number 2 then this normally takes longer than a number 1 so if the light is ON for X amount of time then the fan will come ON.
You have the option to set a start time and an end time. This will only allow the automation to run between the time periods. This is a good option if you would like to disable the fan at night when everyone is sleeping so the fan noise doesn’t wake anyone up.
If the fan goes ON and the wait time is 3 min and the delay time is 5 min. If you turn the light on again and the delay has 2 min left the fan will go OFF in the delay time(2 min) and the automation restarts from when the light was turned ON. If your in and out in 2 min the fan will go OFF as you exit and stay OFF. If you are longer than 3 min the fan will come ON again.
If you have 4 min left to go and your longer than 3 min the fan will stay ON and then go OFF on time delay once you turn the light OFF.
Hope that right… just run some checks and see how you go.
you have to select the option for “Trigger Wait Option (Optional)” & select “Use the wait time”
Hi, I’m newbie to HA. Thanks for your blueprints, they are perfect examples of automation. I have cloned this blueprint with a few changes.
I have a standard dumb fan in ceiling with a smart switch behind it. But since I want to have the fans in the fan category, I used the helper to change the “switch” to “fan”. Item “switch.id” was hidden for selection, selecting “fan.id” doesn’t work in script. Because the “fan” category has its own on/off methods. Changing the on/off command in “actions” from “switch.turn_” to “fan.turn_” solved this problem. I don’t know if there is a more universal method of defining it, regardless of the switch category.
The second version is to start the fan after the light goes out, not while the person is inside with the light on. Simply moved the order of actions - turning on the fan after turning off the light.
About 2) …
I have used the Sonoff Mini (in follow mode with a rocker-switch) as a switch element for the fan. At any time, anyone can manually turn off/on the fan locally. For example, if he doesn’t want to sit under a noisy fan.
I will probably change the logic to:
trigger light on
wait for some time (for case “2”)
set fan on
wait for light off
set fan on
wait for fan after-delay
set fan off
If someone turns off the fan during the “mission”, it will be ensured that the fan starts for delay time when he leaves (light off). If the fan is still running, nothing happens, just a redundant command.
Better suggestion. Get a TVOC sensor (with temperature and humidity) and just use that to trigger the fan, when it detects the smelly side effects of a no. 2 in progress and/or your humidity going through the roof.
I have developed it for 3 more option if the trigger is inverted (light from on to off = fan on). I have done the testing and it works, but will probably do some more tests. Just need to clean it up before I release it (version 1.6). Once I am 100% happy I will release it. Probably be in a day or two.
Added “Trigger Options”. You can now select “Normal Mode” or “Invert Trigger”.
Normal Mode (Default) - This will start the fan when the trigger goes from an OFF to ON state. Example, Light turned ON or motion sensor detected.
Invert Trigger - This will start the fan when the trigger goes from an ON to OFF state. Example, Light turned OFF. It is not recommended to use this option when using a motion sensor.