Turn fan back on if someone turns it off

Hello!

I created a basic automation to turn on the extractor fan if the mold level gets too high (it’s using this integration: Mold Indicator - Home Assistant).

See automation here:

alias: High humidity in dormer bathroom -> fan on
description: ""
trigger:
  - platform: numeric_state
    entity_id: sensor.dormer_bathroom_mold_indicator
    for:
      hours: 0
      minutes: 0
      seconds: 0
    above: 65
condition: []
action:
  - type: turn_on
    device_id: cc8648b4719724a529687c5d1c9d2cc7
    entity_id: fan.dormer_toilet_fan
    domain: fan
mode: single

I read however that this will only trigger if the mold level increases past 65, not if its already above that. The issue I have with this is that when someone walks out of the shower, they might turn the fan off as they walk passed the switch. I need it to turn the fan back on (possibly after a small delay so the person doesn’t fight the switch!).

I’m quite new to HA to any advice welcome :slight_smile:
max

add another trigger for when the fan goes to off and then add a condition to make sure the mold indicator is still above 65.

trigger:
  - platform: numeric_state
    entity_id: sensor.dormer_bathroom_mold_indicator
    for:
      hours: 0
      minutes: 0
      seconds: 0
    above: 65
  - platform: state
    entity_id: fan.dormer_toilet_fan
    to: 'off'
    for:
      seconds: 30
condition: 
  - condition: numeric_state
    entity_id: sensor.dormer_bathroom_mold_indicator
    above: 65
action:
  ...
2 Likes

That’ll do the trick! Thank you :smiley:

1 Like