Skip to main content
  1. posts/

Automating My Bathroom Fan with Home Assistant

·1 min

I had a common household problem: remembering to turn on the bathroom fan during a shower. My kids never remember to do it, and I don’t always remember either. That led to foggy mirrors, damp air, and the occasional weird science experiment forming on the ceiling.

Enter: Home Assistant.

I already had a smart switch wired into the bathroom fan, and the bathroom light was already being tracked by Home Assistant. So I set up a simple automation: if the bathroom light is on for more than five minutes, the fan kicks on automatically. That’s it.

Here’s the YAML:

alias: "Bathroom Fan Auto On"
trigger:
  - platform: state
    entity_id: light.bathroom_light
    to: "on"
    for:
      minutes: 5
condition: []
action:
  - service: switch.turn_on
    target:
      entity_id: switch.bathroom_fan
mode: single

And here’s what it looks like on the bathroom dashboard:

Bathroom Dashboard Screenshot

The fan turns on if someone’s been in the bathroom for a while (usually a shower), and I have a separate automation to turn it off again after an hour. It’s a super simple quality-of-life automation that keeps the air moving and the mirror clear—without anyone having to remember to do anything.

Next step: adding a humidity sensor so I can make it even smarter. But for now, this does the job beautifully.