This post is part of the Komfovent in Home Assistant series.

Controlling my Komfovent balanced ventilation system through Home Assistant β€” opens up a world of possibilities.

Here are three automations I use to make the system a bit smarter 🙂

Table of contents

Override mode

The ventilation unit has three “special operating modes”: Kitchen, Fireplace, and Override. These are activated by relay inputs, and I’ve made a simple WeMos module to trigger them.

The kitchen mode compensates for the air extracted by the kitchen hood vent, and fireplace creates a slight positive pressure in the house, helping the fireplace get enough air.

Until recently I didn’t have a need for the override mode, but this summer I discovered a great use for it 🙂 On warm and sunny days we typically leave the back door open all day, which means we don’t need to push fresh air into the house.

As the name implies; the override mode overrides all other modes, even the kitchen and fireplace relay inputs.

I set the override mode to drop the supply air to 20%, but keep the extract air at 50% β€” fresh air can simply be pulled in through the open back door. Some supply air circulation is kept to prevent condensation in the supply air ducts, and to reach rooms on the 2nd floor. The temperature was set to 15Β°C and the electric heater disabled.

The override mode has the ability to turn the system on, if you don’t want this β€” make sure to select Activate by contact: If on.
Override mode in Komfovent web interace

The automation is very simple; if the back door is open for more than three minutes β€” turn on relay 3, which activates the override mode. When closed for five seconds β€” turn override mode off 🙂

You can also set delayed start and stop in the Komfovent web interface, but I prefer it to respond immediately to the relay and set the delay in Home Assistant.

- id: '1658059003508'
  alias: Ventilation door is open
  trigger:
  - platform: state
    entity_id:
    - binary_sensor.door_back_contact
    to: 'on'
    from: 'off'
    for:
      hours: 0
      minutes: 3
      seconds: 0
  condition: []
  action:
  - service: switch.turn_on
    data: {}
    target:
      entity_id: switch.komfovent_relay_3
  mode: single

- id: '1658059065611'
  alias: Ventilation door is closed
  trigger:
  - platform: state
    entity_id:
    - binary_sensor.door_back_contact
    from: 'on'
    to: 'off'
    for:
      hours: 0
      minutes: 0
      seconds: 5
  condition: []
  action:
  - service: switch.turn_off
    data: {}
    target:
      entity_id: switch.komfovent_relay_3
  mode: single

Away mode

The next automation puts the ventilation system in away mode when the alarm is armed away. But it’s not quite that simple… The ventilation system extracts air from the laundry room, helping our clothes dry faster. So if clothes are hung to dry β€” I don’t want to enable away mode.

To achieve this I created two template sensors β€” one to calculate the difference in humidity between the 1st floor (by averaging values from two other sensors) and the laundry room. And the second to see if the difference is higher than 5%, if so β€” clothes are probably drying.

sensor:
  - platform: min_max
    name: "Humidity 1st floor mean"
    type: mean
    entity_ids:
      - sensor.netatmo_stue_humidity
      - sensor.climate_playroom_humidity

template:
  - sensor:
    - name: "Laundry room humidity diff"
      state: "{{ (states('sensor.climate_laundry_room_humidity') | float) - (states('sensor.humidity_1st_floor_mean') | float) }}"
      unit_of_measurement: "%"
      device_class: "humidity"
  - binary_sensor:
    - name: "Probably drying clothes"
      state: "{{ states.sensor.laundry_room_humidity_diff.state | float > 5 }}"
      device_class: "moisture"
Laundry room card in Home Assistant

The “Probably drying clothes” sensor is then included as a condition in the automation for activating away mode on the ventilation system:

- id: '1637912692246'
  alias: 'Alarm: ventilation Away'
  trigger:
  - platform: state
    entity_id: alarm_control_panel.rpi_alarm
    to: armed_away
  condition:
  - condition: state
    entity_id: sensor.komfovent_mode
    state: '2'
  - condition: state
    entity_id: binary_sensor.probably_drying_clothes
    state: 'off'
  action:
  - service: script.komfovent_set_away
    data: {}
  mode: single

- id: '1637912760933'
  alias: 'Alarm: ventilation Home'
  trigger:
  - platform: state
    entity_id: alarm_control_panel.rpi_alarm
    to: disarmed
  condition:
  - condition: state
    entity_id: sensor.komfovent_mode
    state: '1'
  action:
  - service: script.komfovent_set_normal
    data: {}
  mode: single

To set normal and away mode β€” I’m using two scripts:

script:
  komfovent_set_away:
    alias: Komfovent mode Away
    sequence:
      - service: modbus.write_register
        data:
          address: 4
          hub: komfovent
          unit: 1
          value: 1
  komfovent_set_normal:
    alias: Komfovent mode Normal
    sequence:
      - service: modbus.write_register
        data:
          address: 4
          hub: komfovent
          unit: 1
          value: 2

I haven’t included triggers to switch to away mode if the laundry room dries up while the alarm is armed away. The condition is only checked when the alarm is armed. I figured that was enough 🙂

Set temperature

The last automation changes the set temperature if any of the kids’ rooms gets above 24Β°C. The idea behind this automation is to allow the ventilation system to supply cold air from the outside during the eventing and night, but only if the rooms are hot.

We do have cold summer days, and I don’t want to supply cold air on cold days. The temperature is changed back once the hottest room drops below 22Β°C, for 15 minutes.

To get the highest temperature from the kids’ rooms β€” I’m using a min/max sensor:

sensor:
  - platform: min_max
    name: "Bedrooms max temperature"
    type: max
    entity_ids:
      - sensor.climate_adrian_temperature
      - sensor.climate_twins_temperature
Bedrooms card in Home Assistant

Then a simple automation based on the numeric state of that sensor:

- id: '1652083447584'
  alias: Ventilation cooling start
  trigger:
  - platform: numeric_state
    entity_id: sensor.bedrooms_max_temperature
    above: '24'
    for:
      hours: 0
      minutes: 2
      seconds: 0
  condition: []
  action:
  - service: script.komfovent_set_night_temp
    data: {}
  mode: single

- id: '1652083511698'
  alias: Ventilation cooling stop
  trigger:
  - platform: numeric_state
    entity_id: sensor.bedrooms_max_temperature
    below: '22'
    for:
      hours: 0
      minutes: 15
      seconds: 0
  condition: []
  action:
  - service: script.komfovent_set_day_temp
    data: {}
  mode: single

And to actually change the temperature β€” I’m using two scripts again:

script:
  komfovent_set_night_temp:
    alias: Komfovent temperature night time
    variables:
      temperature: "{{ ((states.input_number.ventilation_set_night_temp.state | float) * 10) | int }}"
    sequence:
      - service: modbus.write_register
        data:
          address: 109 # Normal
          hub: komfovent
          unit: 1
          value: "{{ temperature }}"
      - delay: 1
      - service: modbus.write_register
        data:
          address: 115 # Intensive
          hub: komfovent
          unit: 1
          value: "{{ temperature }}"
  komfovent_set_day_temp:
    alias: Komfovent temperature day time
    variables:
      temperature: "{{ ((states.input_number.ventilation_set_day_temp.state | float) * 10) | int }}"
    sequence:
      - service: modbus.write_register
        data:
          address: 109 # Normal
          hub: komfovent
          unit: 1
          value: "{{ temperature }}"
      - delay: 1
      - service: modbus.write_register
        data:
          address: 115 # Intensive
          hub: komfovent
          unit: 1
          value: "{{ temperature }}"

The day and night time temperatures are set as input numbers:

input_number:
  ventilation_set_night_temp:
    name: Komfovent temperature night time
    min: 15
    max: 25
    step: 0.1
    mode: box
    unit_of_measurement: Β°C
    icon: mdi:weather-night
  ventilation_set_day_temp:
    name: Komfovent temperature day time
    min: 15
    max: 25
    step: 0.1
    mode: box
    unit_of_measurement: Β°C
    icon: mdi:weather-sunny

Last commit 2024-04-05, with message: More tag clean up.


Komfovent in Home Assistant series

  1. Interfacing Komfovent C6 in Home Assistant
  2. Wi-Fi relays for controlling ventilation β€” WeMos D1, MQTT, and Home Assistant
  3. A few more ventilation automations in Home Assistant