Hey everyone! I’ve been diving into creating a smart bathroom ventilation system, and I wanted to share my experience and some tips for those who might be interested in setting something similar up. ![]()
The Goal:
I wanted to automate the bathroom fan to turn on when motion is detected, but only if someone is actually in the bathroom for more than a minute. This way, it avoids running unnecessarily when someone just quickly uses the restroom. Additionally, I wanted the fan to stay on for a few minutes after the bathroom is empty to ensure proper ventilation. ![]()
The Setup:
I’m using an Aqara motion sensor and a Shelly relay to control the fan. The motion sensor detects movement, and the Shelly relay switches the fan on and off. The automation is managed through my smart home hub. ![]()
The Challenges:
Initially, I struggled with setting up the right automation rules. I wanted the fan to activate only when motion was detected for more than a minute, but I wasn’t sure how to configure that. After some research and experimentation, I found that setting a delay in the automation rules worked perfectly. ![]()
The Solution:
Here’s how I set it up:
- Motion Detection: The Aqara motion sensor detects movement in the bathroom.
- Delay: If motion is detected for more than a minute, the fan turns on.
- Post-Movement: The fan stays on for an additional 5 minutes after the last detected motion to ensure the room is properly ventilated.

The Outcome:
This system has been working beautifully! It’s energy-efficient and ensures that the bathroom stays fresh without running the fan unnecessarily. Plus, it’s been a great learning experience for me in terms of setting up more complex automations. ![]()
Tips for Others:
- Start simple and gradually add more complex rules as you get comfortable with your system.
- Don’t hesitate to reach out to the community for help. There are so many knowledgeable people who are more than happy to assist!

- Experiment with different delay times to find what works best for your space.
I hope this helps anyone looking to create a similar setup. Let me know if you have any questions or if you’ve tried something like this in your home! ![]()