[Automation] Shower detection: trigger when humidity increases in 10 minutes?

Hi Thom. Do you mind to share your automation:

  • Turn the fan on when humidity exceeds 70%

Fiddling around with it for some time now based on your “Switch fan to OFF” but can not find a sweet spot.

Thank you in advance.

Hey there, not sure what you are struggling with as this automation is rather simple. Should be something like this:

  - trigger:
      - platform: numeric_state
        entity_id: sensor.bad_raumsensor_bme280_humidity
        above: 70
    action:
      - service: switch.turn_on
        entity_id: switch.bad_luftung

Thank you for your reply.

I am using a similar automation. However, the bathroom exhaust fans seem to switch ON/OFF kind of uncontrolled.

Since I live in a tropical country with a fast changing average humidity between 72% - 79% I may have to work on the sensor (max_age & sampling_size) to get this working correctly.

I just use % humidity above 57%, if that happens I want the fan to start. At least where I live that works well. I have 2 bathrooms, both with the same ventilation fan (house fan) so I check the triggering sensor to set the fan back to medium speed. If the sensor does not come down to below 53% after 1h 30m then set to medium speed anyway (that never happens).

alias: House Ventilation Fan Automasjon
description: Turn on ventilation fan to max when someone is in the shower
trigger:
  - type: humidity
    platform: device
    device_id: 3d2eb894b7e477272c3ba089e22c8348
    entity_id: b363171b2d3789ea19c6df9990153ebb
    domain: sensor
    above: 57
    id: moist-1
  - type: humidity
    platform: device
    device_id: ee22b3674c83e100c9f03ef1be8b6f1d
    entity_id: 34e6631b03658e2e75091a730d80f5b2
    domain: sensor
    above: 57
    id: moist-u
condition: []
action:
  - choose:
      - conditions:
          - condition: trigger
            id:
              - moist-1
        sequence:
          - service: fan.set_percentage
            metadata: {}
            data:
              percentage: 100
            target:
              entity_id: fan.house_vent_fan
          - wait_for_trigger:
              - type: humidity
                platform: device
                device_id: 3d2eb894b7e477272c3ba089e22c8348
                entity_id: b363171b2d3789ea19c6df9990153ebb
                domain: sensor
                below: 53
            continue_on_timeout: true
            timeout:
              hours: 1
              minutes: 30
              seconds: 0
              milliseconds: 0
          - service: fan.set_percentage
            metadata: {}
            data:
              percentage: 66
            target:
              entity_id: fan.house_vent_fan
      - conditions:
          - condition: trigger
            id:
              - moist-u
        sequence:
          - service: fan.set_percentage
            metadata: {}
            data:
              percentage: 100
            target:
              entity_id: fan.house_vent_fan
          - wait_for_trigger:
              - type: humidity
                platform: device
                device_id: ee22b3674c83e100c9f03ef1be8b6f1d
                entity_id: 34e6631b03658e2e75091a730d80f5b2
                domain: sensor
                below: 53
            continue_on_timeout: true
            timeout:
              hours: 1
              minutes: 30
              seconds: 0
              milliseconds: 0
          - service: fan.set_percentage
            metadata: {}
            data:
              percentage: 66
            target:
              entity_id: fan.house_vent_fan
mode: single

Hey corvy,
that you can always do. It’s the easy approach which should be good enough for most use cases.
What I found is that your relative humidity change via a fan depends on the outside humidity (air intake). Therefore, a simple trigger by relative humidity % will switch the ventilation on too early or off too late.

My approach using humidity change automation from above worked pretty well in an apartment bathroom.

In another use case of mine to ventilate a basement room, I went with something that is commonly refered to as “dew point ventilation”.

Yeah I see that and I guess this could also be done in my use case. I can see that the sensor moves at least 5% when someone showers, unless many shower in a row.

I will give this a closer look into my use-case.