Reduce humidity in basement - automation does not work

For the wait template, you just want to add a delay right?
You should use Delay function.

Wait Template is used to evaluates a template, and if true, the action will continue. If not, then it will wait until it is true.

2 Likes

what if you create a difference sensor between the inside dewpoint and outside dewpoint. When this delta is above a predefined threshold start the fan, when it falls below the threshold stop the fan. I do this with the temperature on my 3 story house. if the delta between any two floors is above a threshold I start my furnace fan to circulate / balance the temperature until the delta drops below a certain value. Not exactly the same situation but similar. If you need templates let me know.

After changing to the delay-function, my automation does, what it is designed to do. Thank you very much for your help and inputs.

Regarding difference-sensor: this seems to be a good idea, if to sensors are not in sync? (Which seems to be the case in my installation. I believe, I could correct the sensor values in Tasmota directly…) I will keep this solution in mind.

I will test my automation for a couple of days and see, if it does, what I want it to do. :slight_smile:

Hi,
here is a short update to my automation. There is one issue, which I do not understand completely.

My automation should start the fan, if:

  • dew point in cellar is above dew point outside (-> garden)
  • AND dew point in the garden did not rise within the last 15min

but what I see is, that if the conditions are true, the fan is switched on for 5min, then turned off for 5min, then turned on for 5min, etc.

Is there something wrong with my trend-calculation or with the state-condition and the “for”-functionality?

2021-08-16 20_41_50-Klima - Home Assistant
[1] trend value in a binary sensor: if rising more than 0.25°C per hour, then “Problem”, otherwise “ok”
[2] switch, which turns on the fan (-> D1 mini with relay and sensor)

Code binary sensor:

  - platform: trend
    sensors:
      openweathermap_dewpoint_trend_rising:
        entity_id: sensor.openweathermap_dew_point
        friendly_name: "Garten Taupunkt steigend"
        sample_duration: 3600
        max_samples: 20
        min_gradient: 0.00007   # der min_gradient ist die Steigung der Kurve, welche sich aus Temperatur/Zeiteinheit berechnet. Hier: 0.25 °C/3600 Sekunden = 0.00007
        device_class: problem

Code automation:

alias: Vorratskeller Lüfter Steuerung "on"
description: Startet den Lüfter, wenn der Taupunkt draussen tiefer ist, als drinnen
trigger:
  - platform: time_pattern
    id: time_intervall
    minutes: /5
condition:
  - condition: numeric_state
    entity_id: sensor.tasmota_am2301_dewpoint
    above: sensor.openweathermap_dew_point
  - condition: state
    entity_id: binary_sensor.openweathermap_dewpoint_trend_rising
    state: 'off'
    for: '00:15:00'
action:
  - service: switch.turn_on
    target:
      entity_id: switch.tasmota
  - delay:
      hours: 0
      minutes: 5
      seconds: 0
      milliseconds: 0
  - service: switch.turn_off
    target:
      entity_id: switch.tasmota
mode: single

I think the conditions are OR, not AND. So if at least one of them is true, your automation starts.

Is your fan facing inward?

I have to correct myself, conditions are ANDed, according to docs.

@schneich slightly off-topic, but I am also thinking about adding a fan in the basement to fight humidity. Also located in Germany. Can you tell me what fan you are using? What’s your experience (independent from the automation trouble), does it help much? Are you blowing air out or sucking air in?

Well, there are other german speakting nations… :wink:

fan: PROFAN Technology P21755HBL-ES Axiallüfter 230 V/AC 382 m³/h (L x B x H) 172 x 151 x 55 mm

switch: D1mini & relay runing on Tasmota, AM2301

Experiences: as this is still in beta-state, not much to say - yet. I bought the fan, because we do have a Radon-Issue in our basement. Thats why I am blowing the air out. At least one window has to be open, so that fresh air can come in. There is an effect, as you can see in the charts above. the fan pushes 380m3 of air per hour, depending on the size of the basement, it has to run a substantial amount of time to have a substantial effect. The last couple of days were not ideal to test, because of the high humidity outside - even at night. As soon as the automation runs smoothly, I hope to have a better effect.

I see. Thank you very much for the details. Having to open a window seems to defeat the fan automation though?

To reduce the humidity, you can either use an air dehumidifier or you can make sure that you supply air into the room, which contains less water, than already there. The air must come from somewhere, so having a tilted window is a cheap option. Or you install a heat exchanger/air heat pump, which reduce the humidity as well.

How about separate automations for fan start and fan stop, with the difference sensor. If you want to get into esphome you can use 2 AM2301s and a relay and run the logic on the ESP, and send the humidity values and fan relay staus into HA for monitoring. It becomes self sufficient of any HA issues…

BillyBobK
How about separate automations for fan start and fan stop, with the difference sensor. If you want to get into esphome you can use 2 AM2301s and a relay and run the logic on the ESP, and send the humidity values and fan relay staus into HA for monitoring. It becomes self sufficient of any HA issues…

Thank you very much for the input. My first plan was, to do something as you proposed. with our old house, it is a bit difficult, to get one sensor outside and one sensor inside and still both connected to one Arduino Nano/D1 mini. There is no good spot to put the sensor outside and still get proper readings. thats why I have put my horse on HA. And it is more complex and more fun. :slight_smile:

the solution I have choosen above, is working. But there is one downside. as it is triggered every 5min, the fan is stopping for a short moment and then resumes again. I want to get rid of this stop and go and there seems no way to do this, when using a time based trigger. thats why I am trying a different approach.

I have built something similar (documentation is WIP though, … home-assistant/README-basement.md at 3aef40ca950e21cc15b836bf4ca4d4f73df6d1af · swa72/home-assistant · GitHub)

1 Like

What about something were you create some hysteresis in your on off triggers with two completely separate triggers
eg.

  1. When humidity is rising for x:minutes start fan.
  2. When humidity is falling for x: minutes stop fan.

This will start the fan when the humidity is rising and ONLY stop the fan when it is falling (not time based).

I like the idea of having triggers other than time based. On the other hand, they may be too complicated for a first run. I’m still testing my setup with simple durations and later, with more experience, upgrade to something more sophisticated like you suggested :wink:

I have implemented a similar automation based on a simple state machine for drying my cellar. It has three states:

  1. cross-ventilation driven by a window fan, if the cellar humidity exceeds 50% - but only if the absolute humidity outside is lower than inside

  2. power consuming air drying with an electric dehumidifier, but only if ventilation (1) is not possible but the cellar humidity raises above critical level (>60%)

  3. do nothing as long as everything is within acceptable limits…

What I like about my automation: The transitions between the states are triggered only if sensor values change or exceed the limits.

I would like to share this if anyone else is currently interested in the topic?

I would be interested, if this is still up-to-date.
I have an own automation based on dew point delta between indoor and outdoor. However, it runs arbitrary and doesn’t stop, even if the dewpoint isn’t close to the my chosen 5° delta. I believe, the automation is buggy and I also have to admit that I don’t understand it fully:

alias: de-Humidifier between 5 and 3 Taupunkt Delta
trigger:
  - platform: numeric_state
    entity_id: sensor.filtered_taupunkt_delta
    above: 5
    for:
      hours: 0
      minutes: 5
      seconds: 0
  - platform: numeric_state
    entity_id: sensor.filtered_taupunkt_delta
    below: 3
    for:
      hours: 0
      minutes: 5
      seconds: 0
condition: []
action:
  - service: >-
      input_boolean.turn_{{ 'off' if states('sensor.filtered_taupunkt_delta') |
      float < 3.0 else 'on' }}
    entity_id: input_boolean.beluftung_keller
  - service: >-
      input_boolean.turn_{{ 'on' if states('sensor.filtered_taupunkt_delta') |
      float < 5.0 else 'off' }}
    entity_id: input_boolean.beluftung_keller
mode: single

this is the dew point plot from last night an the automation triggered to on at:

Triggered by the numeric state of sensor.filtered_taupunkt_delta at 18. September 2023 um 03:07:04

Does anybody has an idea what might be wrong here?

Hi @DrBando,

as this topic has already a solution, you might want to start a new discussion to get more attention.

To your question: I don’t understand your code either :slight_smile: , so let me ask some questions and we might get there.

  • Your dew point delta of “5” seems to be high. In our area/house the difference between insight and outside dew point is almost always not that big. You might want to reduce the delta-trigger?
  • You added some code in the service action. I am not a pro, but I have never seen something like this. Your code seems to be a condition. So, why don’t you add your conditions under condition? In my understanding, the action is only used to trigger something - no calculations there.
  • The dew point plot is your delta or the actual dew point (inside or outside)? (based on your code, you are German speaking. Where do you life so that you have a negative dew point in September? Perhaps something wrong with the sensor? :slight_smile: )

Chris

Hi, and thanks for your reply.
You’re right in most points, a dew point delta of 5 is rather high, but I wanted to be on the safe side. I have lowered the threshold to 3°. The automation code I’ve took from another thread, but I’ve rewritten it now to 2 separate automations starting and stopping the fans. I couldn’t test it, because this morning the dew point delta was not large enough. And: you’re right, I’m located in northern Germany, a negative dew point would be odd in this time of year, but what you can see in the plot is still the delta between inner and outer dew point. A positve delta means that absolute humidity would be higher indoors than outdoors. Sensors are working fine and are quite reliable (Govee HT5075 via Bluetooth).

Cheers, Ben