Optimizing Bathroom Automation: A Rule-Based Approach

I’ve always been fascinated by the endless possibilities of automation in smart homes, and I thought this would be a great way to share how I’ve tackled automating my bathrooms. The goal was to fully automate the fan and lighting operations, making it as seamless as possible for daily use. Here’s how I approached it.The idea was to create a single rule for each bathroom, handling all automation aspects. The bathroom setup includes a Tuya bulb over the shower and regular vanity lights, all controlled via Z-Wave switches. I also integrated the [[APP] Smarter Humidity Fan] app to automate the exhaust fan based on humidity levels. The app uses a virtual switch that triggers when humidity thresholds are met.The Logic:- Trigger: Motion detection was the cornerstone of the automation. The rule activates when motion is detected, adjusting the lights based on the time of day.- Actions: - During daylight hours (8 AM to 11 PM), the shower light switches to white at 100% brightness, and all vanity lights turn on. - At night (11 PM to 8 AM), the shower light shifts to red at 100% brightness. - The system also handles delayed actions to ensure everything turns off after a period of inactivity, preventing energy waste.The Payoff:- Lights automatically adjust to the appropriate color based on the time of day.- The fan remains on post-shower, ensuring fresh air without manual intervention.- Motion detection ensures lights stay on while someone is in the bathroom, with a gentle reminder to move if they’re inactive for too long.Possible Improvements:- Adding logic to restore the bulb color after night mode.- Enhancing detection for when someone is filling the bathtub to automatically turn on the fan.This setup has been a game-changer for our daily routine, making the bathroom experience more convenient and energy-efficient. I’m excited to see how this can be further optimized and hope it inspires others to explore similar automation possibilities in their homes!