Smart Dehumidification Control

This excellent post presents a basement dehumidifying solution using ventilators. In my case forced ventilation was not an option so I’ve opted for a dehumidifier. My main objective is to avoid that walls, furniture and equipments suffer from humidity excess. Here are some characteristics of my project:

  1. The basement has ~60m2 and is under the garage. It is used basically as a gaming / entertainment room
  2. The dehumidifier has no wifi and no pump. I need to be alerted when its water tank is full
  3. I have photovoltaic panels so dehumidifier activity is preferred during the day
  4. Dehumidifier is noisy so it should stop when basement is being used

Required equipment:

  1. Wireless technology (I have wifi and zigbee in the basement)
  2. Dumb dehumidifier (in one corner of the room)
  3. Humidity sensor (in the opposite corner)
  4. Smart plug with energy control (in my case a Tapo P110)
  5. Smart lights (in my case basement lights are controlled with a Shelly1)

I have used this logic:

  1. The system decides when to switch the dehumidifier on/off based of ambient humidity, and in order to detect that the water tank is full it measures its power consumption. This is tricky because dehumidification may pause momentarily during the dehumidification cycle. Therefore I consider that the water tank is full only after 15 consecutive minutes of no dehumidification
  2. When a “water tank full” condition is detected an alarm is sent (via Telegram), the dehumidifier plug is switched off, and future dehumidification cycles are disabled
  3. When basement lights are on the dehumidifier is switched off. And when they are switched off I assume that the water tank has been emptied so dehumidification cycles are resumed

This logic is implemented with the following rules:

Start dehumidification cycle with high humidity

configuration: {}
triggers:
  - id: "1"
    configuration:
      itemName: Sensorhumidadeetemperaturacave_Humidity
    type: core.ItemStateChangeTrigger
  - id: "7"
    configuration:
      itemName: AN_Cellar_Light
      state: OFF
      previousState: ON
    type: core.ItemStateChangeTrigger
conditions:
  - inputs: {}
    id: "3"
    configuration:
      itemName: P110SmartPlug_OutputSwitch
      state: ON
      operator: "!="
    type: core.ItemStateCondition
  - inputs: {}
    id: "4"
    configuration:
      itemName: Sensorhumidadeetemperaturacave_Humidity
      state: 70
      operator: ">"
    type: core.ItemStateCondition
  - inputs: {}
    id: "5"
    configuration:
      itemName: Sun_Elevation
      state: 5 °
      operator: ">"
    type: core.ItemStateCondition
  - inputs: {}
    id: "6"
    configuration:
      itemName: AN_Cellar_Light
      state: ON
      operator: "!="
    type: core.ItemStateCondition
  - inputs: {}
    id: "8"
    configuration:
      itemName: Cellar_Dehumidifier_State
      state: ON
      operator: =
    type: core.ItemStateCondition
actions:
  - inputs: {}
    id: "2"
    configuration:
      command: ON
      itemName: P110SmartPlug_OutputSwitch
    type: core.ItemCommandAction

Stop dehumidification cycle when lights are on

configuration: {}
triggers:
  - id: "1"
    configuration:
      itemName: AN_Cellar_Light
      state: ON
    type: core.ItemStateChangeTrigger
conditions:
  - inputs: {}
    id: "3"
    configuration:
      itemName: P110SmartPlug_OutputSwitch
      state: OFF
      operator: "!="
    type: core.ItemStateCondition
actions:
  - inputs: {}
    id: "2"
    configuration:
      command: OFF
      itemName: P110SmartPlug_OutputSwitch
    type: core.ItemCommandAction

Stop dehumidification with low humidity

configuration: {}
triggers:
  - id: "1"
    configuration:
      itemName: Sensorhumidadeetemperaturacave_Humidity
    type: core.ItemStateChangeTrigger
conditions:
  - inputs: {}
    id: "3"
    configuration:
      itemName: P110SmartPlug_OutputSwitch
      state: OFF
      operator: "!="
    type: core.ItemStateCondition
  - inputs: {}
    id: "4"
    configuration:
      itemName: Sensorhumidadeetemperaturacave_Humidity
      state: 65
      operator: <
    type: core.ItemStateCondition
actions:
  - inputs: {}
    id: "2"
    configuration:
      command: OFF
      itemName: P110SmartPlug_OutputSwitch
    type: core.ItemCommandAction

Detect that dehumidification has been paused

configuration: {}
triggers:
  - id: "1"
    configuration:
      itemName: P110SmartPlug_Power
    type: core.ItemStateChangeTrigger
conditions:
  - inputs: {}
    id: "2"
    configuration:
      itemName: P110SmartPlug_Power
      state: 50 W
      operator: <
    type: core.ItemStateCondition
  - inputs: {}
    id: "3"
    configuration:
      itemName: P110SmartPlug_Power
      state: 40 W
      operator: ">"
    type: core.ItemStateCondition
actions:
  - inputs: {}
    id: "4"
    configuration:
      itemName: Cellar_Dehumidifier_Timer
      command: ON
    type: core.ItemCommandAction

Water tank full - Stop dehumidifier and notify me

configuration: {}
triggers:
  - id: "1"
    configuration:
      command: OFF
      itemName: Cellar_Dehumidifier_Timer
    type: core.ItemCommandTrigger
conditions:
  - inputs: {}
    id: "2"
    configuration:
      itemName: P110SmartPlug_Power
      state: 50 W
      operator: <
    type: core.ItemStateCondition
  - inputs: {}
    id: "3"
    configuration:
      itemName: P110SmartPlug_Power
      state: 40 W
      operator: ">"
    type: core.ItemStateCondition
actions:
  - inputs: {}
    id: "4"
    configuration:
      itemName: P110SmartPlug_OutputSwitch
      command: OFF
    type: core.ItemCommandAction
  - inputs: {}
    id: "5"
    configuration:
      itemName: Cellar_Dehumidifier_State
      command: OFF
    type: core.ItemCommandAction
  - inputs: {}
    id: "6"
    configuration:
      itemName: aAlert
      command: É necessário despejar o balde do desumidificador da cave
    type: core.ItemCommandAction
  1. Cellar_Dehumidifier_Timer is a switch item that expires after 15 minutes. This value should be higher than the “normal pause” of the dehumidifier
  2. Cellar_Dehumidifier_State is a switch item (OFF when water tank is full, ON otherwise)
  3. aAlert is a string item linked to a message channel (see below)

My dehumidifier uses 45W for ventilation and 240W for dehumidifying. It’s regulated for humidity target 40% and in such case “normal pauses” are ~8min

There are various methods to send alerts to mobiles, I use the http binding to send telegrams. Here is the thing (****** are coded using telegram binding instructions)

UID: http:url:d52db6a46a
label: $Telegram
thingTypeUID: http:url
configuration:
  authMode: BASIC
  ignoreSSLErrors: false
  baseURL: https://api.telegram.org/bot****************
  delay: 0
  stateMethod: GET
  refresh: 30
  commandMethod: GET
  contentType: text/plain
  timeout: 3000
  bufferSize: 2048
channels:
  - id: message
    channelTypeUID: http:string
    label: Message
    description: ""
    configuration:
      mode: WRITEONLY
      commandExtension: /sendMessage?chat_id=********&text=%2$s
2 Likes

Your dehumidifier is not that dumb! Mine falls back to default 60% after power cycle.

1 Like

Good catch. In such cases the dehumidifier will pause more frequently, and probably for larger periods, so the algorithm to detect that the water tank is full needs to be adjusted.

My dehumidifier retains previous settings and when set to 40% has the following consumption graph (works 40 min pauses 8 min…)

image

Therefore I consider a 15min pause an indicator of water tank full. In your case this period would probably need to be increased (expiration time of item Cellar_Dehumidifier_Timer)

I could have considered 1h pause as the “water full” indicator but in such case ventilation would be working for 50 mins wasting 40Wh of energy.

1 Like

I’ve just built my own smart Wifi connected dehumidifier. The controller is a Sonoff TH running ESPHome. The Sonoff is wired into the power input to switch the power supply to dehumidifier. The tank full sensor is wired to an input pin on the Sonoff, along with a push button for controlling the automation override. The Sonoff’s humidity sensor is mounted in the dehumidifier where the optional factory sensor would go.

The Sonoff connects to Openhab using MQTT. It responds to command messages over MQTT to turn the power on or off. Every 5 minutes it reports the humidity on MQTT. The button is set up so that a single press with send an override command and start the dehumidifier, and a double press clears the override command. The tank full sensor also sends a MQTT message when triggered.

In Openhab, I have items connected the MQTT channels for the power, humidity, tank full, and override. I have a rule that monitors the humidity item and the current solar power being fed into the grid. If the humidity is greater than 60% and there is a surplus of more than 400W of solar power being fed back into the grid, it turns the dehumidifier on, otherwise it turns it off. The rule is triggered by the humidity update from the dehumidifier every 5 minutes.

The override item is configured to expire after 6 hours. There is a rule that is triggered by the override item to turn on power to the dehumidifier. The above dehumidifier rule has a ‘ButOnly If’ check to disable it if the override is on. After 6 hours the override item expires to Off and it resumes automatic control.

The tank full message is monitored by a Node Red flow that displays an alert message on my home dashboard when the tank is full.

I use the dehumidifier in the laundry to dry washing. The idea is that if I have washing that needs drying quickly (or on a rainy day), I can press the override button to have the dehumidifier run continuously for 6 hours, otherwise it just runs when excess power is available. Pressing the button twice, cancels the override.

The only issue I have is that there isn’t any good item type in Openhab that matches a tank full state. I’m using a Contact item type but it uses OPEN/CLOSED states which require some interpretation as to what they mean.

1 Like

In my case I’ve used a switch item whose name is “Dehumidifier available”. To have a “tank full” status maybe a map transformation will work.