The Ultimate Smart Home Automation Cookbook

Bathroom Lighting Automation offers a clever workaround to the typical challenges faced with motion-activated lighting. A common issue in traditional setups is that when you’re in the shower, you’re often out of the motion sensor’s range, resulting in the lights turning off unexpectedly. While adding an additional motion sensor in the shower area might seem like a solution, it’s not ideal due to the high moisture levels.

This is where Bathroom Lighting Automation steps in with an innovative solution. In many homes, like ours, bathroom doors remain open unless the room is occupied. By integrating Bathroom Lighting Automation with a contact sensor on the door, we can create a more responsive system. With this setup, closing the bathroom door triggers the contact sensor, which in turn disables the motion-activated lights from turning off. This ensures that even when out of sight of the motion sensor, such as when you’re in the shower, the lights remain on.

Bathroom Lighting Automation resolves the inconvenience of lights turning off and enhances energy efficiency. By having lights that only stay on when the bathroom is in use, as indicated by the door’s position, Bathroom Lighting Automation creates a more innovative, user-friendly environment. This approach to Bathroom Lighting Automation ensures comfort and convenience, making it an essential feature in modern smart homes.

Automation Details

Required Devices

  • Motion Sensors
  • Contact Sensors
  • Smart Lighting

Triggers:

  • When Motion is Detected
  • When Motion Stops

Conditions:

  • Don't Run While Away
  • Don't Turn Off if Door is Closed
  • Moring and Home Modes Stay for 5 Minutes and Stay 3 Minutes During Night Mode
  • Morning and Home Full Brightness and 50% Brightness at Night

Actions:

  • Turn On Lights
  • Turn Off Lights

Stay Time is the amount of time after motion stops before turning off lights.

Novice
Novice

Hubitat

Bathroom Lighting Automation

The Official Documentation for Room Lighting

Setting Up the Automation

  1. First, go to Apps and then Room Lighting.

    Bathroom Lighting Hubitat App Screen
  2. Select Create New Room Lights Automation…

    Hubitat Create New Room Lights Automation
  3. From the Rooms to Automate dropdown, select your room. Mine is Downstairs Bathroom.

    Bathroom Lighting Hubitat Room Lighting Screen
  4. Hubitat will look at your devices in that room and select them accordingly. Next, we are going to go into Set Up Lighting Periods.

    Bathroom Lighting Hubitat Select Lighting Periods
  5. Select Hub Modes from the Vary Lighting Using drop-down and select your modes from the new drop-down. We are not setting Away since we don’t want our automation running while Away.

    Bathroom Lighting Hubitat Lighting Periods Screen
  6. For morning and home, I am OK with them coming on full brightness, but for Night I want to change the brightness to 50%.

    Bathroom Lighting Hubitat Lighting Periods Brightness Level
  7. We want different motion stay times, so we’ll turn on Use Stay Minutes Per Mode. Then we’ll set the stay times for Morning and Home to 5 minutes and 3 minutes for Night. Then can click the Done With Periods button.

    Bathroom Lighting Hubitat Lighting Periods Stay Times
  8. Next, we go into Means to Activate Lights section.

    Bathroom Lighting Hubitat Select Means to Activate
  9. Select Means to Activate drop-down.

    Bathroom Lighting Hubitat Adjusting Means to Activate
  10. We want to unselect Contact opens and Button is pressed, and leaving Motion becomes active.  Then we want to also select Switch turns on.

    Bathroom Lighting Hubitat Choosing Means to Activate
  11. Next, in the Switches that turn on drop-down, select your lights.  Then Click the Done with Means to Activate button.

    Bathroom Lighting Hubitat Choosing Switches
  12. Next, go into the Means to Turn Off Lights section.

    Bathroom Lighting Hubitat Select Means to Turn Off
  13. Select Means to Turn Off drop-down.

  14. The only ones we want here are All Motions Stays inactive and Switch turns off.

    Bathroom Lighting Hubitat Choosing Means to Turn Off
  15. Make sure switches that turn off is populated with your switches.   Then click Turn Off Lights Options.

  16. On the Options page in the Disable Turning Off Upon These Events drop-down and select Contact is closed.

    Bathroom Lighting Hubitat Means to Turn Off Options Disable
  17. Select your contact sensor and in the Re-Enable Turning Off upon these Events drop down select Contact is opened.  Then make sure you select your contact sensor again.  Then Click the Done with Turn Off Options button.

    Bathroom Lighting Hubitat Means to Turn Off Options re-enable
  18. Then click the Done with Means to Turn Off button.

    Bathroom Lighting Hubitat Means to Turn Off Finished
  19. Next Click the Done button to finish the automation.

    Bathroom Lighting Hubitat Finished
  20. Finally, click the Done Creating Room Lights button.

    Hubitat Done with Room Lighting

Home Assistant

Bathroom Lighting Automation

The Official Documentation for Automation editor

Setting Up the Automation

  1. First, we need to go to Settings and Automations & Scenes.

    Home Assistant Settings Screen
  2. Click the blue Create Automation button.

    Home Assistant Automations Screen
  3. Choose Create new automation.

    Home Assistant Create Automation Screen
  4. Click Add Trigger.

    Home Assistant New Automation Screen
  5. From the list, select Device.

    Home Assistant Trigger Types Menu
  6. In the Device section, choose our motion sensor, and for the Trigger drop-down, select Started detecting motion.  Then click the vertical ellipse in the upper right-hand corner and select Edit ID.

    Bathroom Lighting Home Assistant Triggers
  7. Add a Trigger ID. You can call it anything you like, but we’ll use motion_started.

    Bathroom Lighting Home Assistant Trigger ID
  8. Now add a second trigger using the same motion sensor but using the Stopped detecting motion Trigger.  Then click the Add Condition button.

    Bathroom Lighting Home Assistant Second Trigger
  9. Select Not from the list.

    Bathroom Lighting Home Assistant Conditions Not
  10. Click the Add Condition button and select State from the list.

    Bathroom Lighting Home Assistant Conditions State
  11. In the Entity drop-down, select Mode, and then in the State drop-down, select Away.  Then click the Add Condition button.

    † Home Assistant doesn’t have any native way of handling Hub Modes, but you can read Hub Modes to learn how to set it up.

    Bathroom Lighting Home Assistant Conditions Mode
  12. Then select Device from the conditions list.

    Bathroom Lighting Home Assistant Conditions Device
  13. In the Device drop-down select our contact sensor and set the Condition to Contact is open.  Then click the Add Action button.

  14. Select If-then from the list.

    Bathroom Lighting Home Assistant Actions If-then
  15. Click the Add Condition button within the if statement and select Triggered by from the list.

    Bathroom Lighting Home Assistant Actions Triggered by
  16. Select the ID we created earlier and then click the Add Action button.

    Bathroom Lighting Home Assistant Actions Triggered ID
  17. From the list, select the If-then option.  Click the Add Condition button within the if statement and select Or.  Then, click the Add Condition button and select State from the list.

    Bathroom Lighting Home Assistant Actions State
  18. We will create two conditions, both being type State. One is for mode-morning, and the other is for mode-home.  Then click the Add Action button.

    Bathroom Lighting Home Assistant Actions Modes
  19. Select the Device option from the list.

    Bathroom Lighting Home Assistant Actions Device
  20. In the Device box, choose the light we want to control, set the Action to Turn on, and set the brightness to 100%. Then click the Add else link.

    Bathroom Lighting Home Assistant Actions Lights
  21. Click the Add Action button within the else statement and select Device. Then choose our light again, and set the Action to Turn on, but this time we’ll set the brightness to 50%. This finishes up the actions if the automation is triggered by motion starting. Next, we will work on the action if the automation was triggered by the motion stopped. Finally, in the last Else section, click Add Action.

    Bathroom Lighting Home Assistant Actions Lights Else
  22. We are going to do the same thing we did before.

    • From the Action’s list, select the If-then option.
    • Click the Add Condition button within the if statement and select Or.
    • We will create two conditions, both being type State. One is for mode-morning, and the other is for mode-home.
    • Then click the Add Action button.

    Bathroom Lighting Home Assistant Actions Else Modes
  23. From the list select Wait for time to pass (delay).

    Bathroom Lighting Home Assistant Actions Else Delay
  24. Set the delay for 5 minutes and click the Add Action button and select Device.  In the Device drop-down select our light and set the action to Turn off.  Do this for each light.  Then click the Add else link.

  25. We will set up the same actions, but this time we’ll set the delay for 3 minutes.

    Bathroom Lighting Home Assistant Actions Else Lights Off Else
  26. At the bottom right corner, click the blue Save button.  Name the automation and click save again.

    Success: That’s It! You have successfully automated your bathroom lights.

    Bathroom Lighting Home Assistant Save and Name