Smart Bathroom Ventilation

Upgrade your bathroom with a Shelly 2.5 and Home Assistant for optimal comfort. Our custom firmware and automation control the fan speed based on the humidity level, improving air quality. Enjoy a noise-free bathroom & improved air quality with just a few easy steps.

Smart Bathroom Ventilation
Photo by Skyler King / Unsplash
Skill Cost Time
2 / 5 ~30 Euro ~60min

Challenge / Annoyance

Are you tired of dealing with a bathroom fan that operates at maximum capacity every time you turn on the lights? Do you find it irritating that the fan produces excessive noise when you're just using the toilet or relaxing in the bath? Or have you experienced the frustration of inadequate ventilation following a shower, resulting in mold growth over time? If you nodded in agreement, you're not alone. Many homeowners face these common issues with their bathroom ventilation systems. Fortunately, modern technology can assist you in transforming your traditional fan into a smart one that is quieter, more efficient, and more effective. In this blog post, we'll demonstrate how to improve the ventilation system with a Shelly 2-channel smart switch and Home Assistant, enabling you to enjoy optimal air quality and comfort in your bathroom.

Solution - Hardware

🛑
MIND THE POWER
The bathroom ventilation unit is connected to a 3-phase Perilex plug, and the fan speed is determined by which of the three phases is active.

Off: Phase 1 is powered (this is the 'default' setting)
Low: Phase 1 and Phase 2 are powered
High: Phase 1 and Phase 3 are powered

Phase 2 and 3 alternate and should not be powered simultaneously

By adding a Shelly 2.5, comprising two Wi-Fi-controlled relays, we can connect the bathroom ventilation system to Home Assistant.

Shelly / Perilex cable wiring diagram
Top: Out-of-the-box Perilex connected to the control board. Bottom: Separated JST connector and the Shelly between the board and the Perilex plug.

Solution - Software

We evaluated various software solutions to control the Shelly 2.5, including the original firmware, Tasmota, and custom firmware using MQTT to manage the fan and its status. After testing the first two options, we opted for the custom firmware because it required the least amount of tinkering in Home Assistant to create a user-friendly fan entity with speed control. The original firmware and Tasmota necessitated linking two switches in Home Assistant with an input helper and complex automation. In contrast, the custom firmware enabled autodiscovery, generating a device and fan entity that worked immediately.

💡
When compiling the firmware for the Shelly 2.5, be aware of its limited 2MB flash storage, and adjust the flash size accordingly. The Shelly Plus 2PM has twice the flash storage capacity at 4MB.
Bathroom Ventilation Device and Fan Entity with Speed Control

Configuration in Home Assistant

With Home Assistant, you can create an automation that controls the fan speed based on various factors such as occupancy, temperature, and humidity. For example, you can set the fan to stay at a lower speed when the bathroom is occupied at night to avoid unnecessary noise. When the humidity level in the room rises above a certain threshold, the fan can be set to turn on automatically at a higher speed to effectively remove excess moisture from the air and prevent mold buildup. Additionally, you can configure the system to return to a lower speed once the humidity level has decreased to a safe level.

alias: Bathroom Ventilation
description: "Adjust bathroom fan speed based on humidity"
trigger:
  - platform: numeric_state
    entity_id: sensor.humidity_bathroom
    above: "60"
    id: low
  - platform: numeric_state
    entity_id: sensor.humidity_bathroom
    above: "80"
    id: high
  - platform: numeric_state
    entity_id: sensor.humidity_bathroom
    below: "80"
    id: low
  - platform: numeric_state
    entity_id: sensor.humidity_bathroom
    below: "60"
    for: "00:10"
condition: []
action:
  - choose:
      - conditions:
          - condition: trigger
            id: low
        sequence:
          - service: fan.set_percentage
            data:
              percentage: 50
            target:
              entity_id: fan.bathroom_ventilation
      - conditions:
          - condition: trigger
            id: high
        sequence:
          - service: fan.set_percentage
            data:
              percentage: 100
            target:
              entity_id: fan.bathroom_ventilation
    default:
      - service: fan.set_percentage
        data:
          percentage: 0
        target:
          entity_id: fan.bathroom_ventilation
mode: restart
Home Assistant automation (in YAML) to adjust the fan speed based on a humidity sensor.

Result

Humidity at a comfortable level, without hassle, moisture, or noise pollution.

Bill of materials

Off-the-shelf alternatives

Currently, there are no off-the-shelf alternatives available that provide the same level of customization and integration in Home Assistant. Most traditional exhaust fans are controlled by an on/off switch or timer, which can result in excessive noise and inadequate ventilation.

Although there are some newer models of exhaust fans that have integrated humidity sensors, allowing for more precise control over ventilation, they still fall short in terms of customization and integration within Home Assistant. Therefore, for those looking for a truly smart and customizable exhaust ventilation system, this smart upgrade remains the best option.

Conclusion

By adding the Shelly 2.5 to your bathroom ventilation system and integrating it with Home Assistant, you can enjoy optimal air quality and comfort in your bathroom while also saving energy and reducing noise pollution. It's an easy and affordable solution that can be implemented in just a few simple steps.