Komfovent C6 & C6M Controller Package File

spent some more time and I was able to troubleshoot and narrow down that the error is about reading operation mode. I get such error each 15seconds.
basically it doesnt recognize modbus response for the mode setting it is in.

now trying to figure out what response is expected and which code line is creating a request to retrieve the state. any help would be appreciated

I’ve just not had time to get to this yet. I need to update a load of the code because of changes to HA core templates :frowning:

The issue might be the C6 firmware you are running. Komfovent are not very forthcoming with new firmware or the MODBUS document. I have both, just not had time to do anything with it.

What I know is they changed this and added a new mode.
image

I am running this firmware

image

I got confused with the results of my testing yesterday. I see that actually HA is able to retrieve operation mode information it is just it gets not all responses formatted in the same way. see the mode graph:

so I though what if I update the unit as maybe some performance issues would be fixed. Now I am on this version:
image

maybe not the wises move with the update though as Komfovent indeed is not doing well with the documentation either changelogs

I found also the thread about unit of measurement and did commented out those lines.
now most of the errors are gone.
I still get the error when auto mode is not on. cant really understand why all other times responses are good but when auto is off it doesn’t understand the operation mode value.

        # unit_of_measurement: "State"

For now giving up. function wise all sensors, switches are working fine however it just keeps posting errors even all entities have correctly updated values. no clue why it errors out…

Maybe someday I will be wiser than now (just 2 weeks as a Home Assistant user).
It is worth evaluating and rewriting the code to fit with standard integration for HVAC. then I believe it would be more future proof.
Climate - Home Assistant (home-assistant.io)

here is my few adjusted cards to share:
image
Card for the home summary dashboard with long press action to turn on boost and tap action to navigate to the next page with the info as bellow:

update:
Finally error free :smiley:
after recent home assistant core beta version update (2023.10.0b1) there were changes to modbus base integration which resulted in total erroring of this integration. so I had no choice just to go through all sensors and switches bit by bit.
so the fault was returned with switches for address 4 configurations where function verify was expecting command_off value as specified however mode register in the unit has more than on off values and is different than expected. so by commenting out verify lines for mode reading this integration goes error free :slight_smile:

p.s. climate template I now see is hardly useful

1 Like

@runnerM Can you share your Komfovent config? My config stopped working after 2023.10.0 update… or maybe you have some other instructions how to fix this matter?

updated config to make it work with recent modbus changes. I use only sensors and switches. commented out all the rest as I am not interested in that yet. however there I also cleaned up the cofiguration so in theory should work as well :slight_smile:

modbus:
  - type: tcp
    host: 192.168.0.150
    port: 502
    name: "Komfovent"

    switches:
    - name: "Komfovent Switch Power"
      address: 0
      command_on: 1
      command_off: 0
      verify:
    - name: "Komfovent Switch Eco"
      address: 2
      command_on: 1
      command_off: 0
      verify:
    - name: "Komfovent Switch Auto"
      address: 3
      command_on: 1
      command_off: 0
      verify:
# adress 4 is where all modes are stored which means 
#   it has more than two values and is not only on/off switch sensor states
#   this is why if used and state is read by using verify function
#   it will generate error due to off state will not be recognized correctly
    - name: "Komfovent Switch Away"
      address: 4
      command_on: 1
      command_off: 2
#      verify:
    - name: "Komfovent Switch Normal"
      address: 4
      command_on: 2
      command_off: 1
#      verify:
    - name: "Komfovent Switch Intensive"
      address: 4
      command_on: 3
      command_off: 2
#      verify:
    - name: "Komfovent Switch Boost"
      address: 4
      command_on: 4
      command_off: 2
#      verify:
    - name: "Komfovent Switch Normal Heater"
      address: 110
      command_on: 1
      command_off: 0
      verify:
    - name: "Komfovent Switch Eco Free Cooling Heating"
      address: 201
      command_on: 1
      command_off: 0
      verify:
    - name: "Komfovent Switch Eco Heater Blocking"
      address: 202
      command_on: 1
      command_off: 0
      verify:
    - name: "Komfovent Switch Eco Cooler Blocking"
      address: 203
      command_on: 1
      command_off: 0
      verify:
    - name: "Komfovent Switch Eco Constant Heat Recovery"
      address: 216
      command_on: 1
      command_off: 0
      verify:

    sensors:
    - name: "Komfovent on off num"
      address: 0
      data_type: uint16
    - name: "Komfovent Eco num"
      address: 2
      data_type: uint16
    - name: "Komfovent Auto num"
      address: 3
      data_type: uint16
    - name: "Komfovent Mode num"
      address: 4
      data_type: uint16
    - name: "Komfovent Scheduler num"
      address: 5
      data_type: uint16
    - name: "Komfovent Temp Control num"
      address: 10
      data_type: uint16
    - name: "Komfovent Flow Control num"
      address: 11
      data_type: uint16
    - name: "Komfovent Control Indoor Humidity %"
      address: 40
      unit_of_measurement: "%"
      scan_interval: 30
    - name: "Komfovent Status Normal Fan Supply Setpoint"
      address: 105
      data_type: uint32
      unit_of_measurement: "%"
      device_class: power_factor
      state_class: measurement
      scan_interval: 5
    - name: "Komfovent Status Normal Fan Extract Setpoint"
      address: 107
      data_type: uint32
      unit_of_measurement: "%"
      device_class: power_factor
      state_class: measurement
      scan_interval: 5
    - name: "Komfovent Status Normal Setpoint C"
      address: 109
      unit_of_measurement: °C
      scale: 0.1
      precision: 1
      device_class: temperature
      state_class: measurement
      scan_interval: 5
    - name: "Komfovent Eco Min Supply temperature C"
      address: 199
      unit_of_measurement: °C
      scale: 0.1
      precision: 1
      device_class: temperature
      state_class: measurement
      scan_interval: 5
    - name: "Komfovent Eco Max Supply temperature C"
      address: 200
      unit_of_measurement: °C
      scale: 0.1
      precision: 1
      device_class: temperature
      state_class: measurement
      scan_interval: 5
    - name: "Komfovent Eco Free Heating/Cooling Status Num"
      address: 201
      data_type: uint16
      scan_interval: 5
    - name: "Komfovent Eco Heating Enabled Status Num"
      address: 202
      data_type: uint16
      scan_interval: 5
    - name: "Komfovent Eco Cooling Enabled Status Num"
      address: 203
      data_type: uint16
      scan_interval: 5
    - name: "Komfovent Eco Constant HR Enabled Status Num"
      address: 216
      data_type: uint16
      scan_interval: 5
    - name: "Komfovent Supply temperature 'C"
      address: 901
      unit_of_measurement: °C
      scale: 0.1
      precision: 1
      device_class: temperature
      state_class: measurement
      scan_interval: 15
    - name: "Komfovent Extract temperature 'C"
      address: 902
      scale: 0.1
      unit_of_measurement: °C
      precision: 1
      device_class: temperature
      state_class: measurement
      scan_interval: 15
    - name: "Komfovent Outdoor temperature 'C"
      address: 903
      scale: 0.1
      unit_of_measurement: °C
      precision: 1
      device_class: temperature
      state_class: measurement
      scan_interval: 15
    - name: "Komfovent Supply Flow volume"
      address: 905
      data_type: uint32
      precision: 0
      unit_of_measurement: "mÂł/h"
      scan_interval: 10
    - name: "Komfovent Extract Flow volume"
      address: 907
      data_type: uint32
      precision: 0
      unit_of_measurement: "mÂł/h"
      scan_interval: 10
    - name: "Komfovent Supply Fan Intensivity '%"
      address: 909
      data_type: uint16
      scale: 0.1
      precision: 1
      unit_of_measurement: "%"
      state_class: measurement
      scan_interval: 30
    - name: "Komfovent Extract Fan Intensivity '%"
      address: 910
      data_type: uint16
      scale: 0.1
      precision: 1
      unit_of_measurement: "%"
      state_class: measurement
      scan_interval: 30
    - name: "Komfovent Electric Heater %"
      address: 912
      data_type: uint16
      scale: 0.1
      precision: 1
      unit_of_measurement: "%"
      state_class: measurement
      scan_interval: 10
    - name: "Komfovent Filter Impurity, %"
      address: 916
      data_type: uint16
      unit_of_measurement: "%"
      state_class: measurement
      scan_interval: 60
    # - name: "Komfovent Supply Pressure"
    #   address: 918
    #   data_type: uint16
    #   unit_of_measurement: Pa
    #   state_class: measurement
    #   scan_interval: 10
    - name: "Komfovent Status"
      address: 899
      data_type: uint16
      scan_interval: 5
    - name: "Komfovent Power consumption, W"
      address: 920
      data_type: uint16
      unit_of_measurement: W
      device_class: power
      state_class: measurement
      scan_interval: 10
    - name: "Komfovent Heater Power, W"
      address: 921
      data_type: uint16
      unit_of_measurement: W
      device_class: power
      state_class: measurement
      scan_interval: 30
    - name: "Komfovent Heat Recovery, W"
      address: 922
      data_type: uint16
      unit_of_measurement: W
      device_class: power
      state_class: measurement
      scan_interval: 10
    - name: "Komfovent Heat exchanger efficiency, %"
      address: 923
      data_type: uint16
      unit_of_measurement: "%"
      state_class: measurement
      scan_interval: 10
    - name: "Komfovent Energy saving, %"
      address: 924
      data_type: uint16
      unit_of_measurement: "%"
      state_class: measurement
      scan_interval: 10
    - name: "Komfovent Specific power (SPI)"
      address: 925
      data_type: uint16
      scale: 0.001
      precision: 2
      unit_of_measurement: W/(m3/h)
      state_class: measurement
      scan_interval: 10
#     #Consumption
    - name: "Komfovent AHU Consumption Day, kWh"
      address: 926
      data_type: uint32
      precision: 2
      scale: 0.001
      unit_of_measurement: kWh
      device_class: energy
      state_class: total_increasing
      scan_interval: 30
    - name: "Komfovent AHU Consumption Month, kWh"
      address: 928
      data_type: uint32
      precision: 2
      scale: 0.001
      unit_of_measurement: kWh
      device_class: energy
      state_class: total_increasing
      scan_interval: 30
    - name: "Komfovent AHU Consumption Total, kWh"
      address: 930
      data_type: uint32
      precision: 2
      scale: 0.001
      unit_of_measurement: kWh
      device_class: energy
      state_class: total_increasing
      scan_interval: 30
    - name: "Komfovent Heater Consumption Day, kWh"
      address: 932
      data_type: uint32
      precision: 2
      scale: 0.001
      unit_of_measurement: kWh
      device_class: energy
      state_class: total_increasing
      scan_interval: 30
    - name: "Komfovent Heater Consumption Month, kWh"
      address: 934
      data_type: uint32
      precision: 2
      scale: 0.001
      unit_of_measurement: kWh
      device_class: energy
      state_class: total_increasing
      scan_interval: 30
    - name: "Komfovent Heater Consumption Total, kWh"
      address: 936
      data_type: uint32
      precision: 2
      scale: 0.001
      unit_of_measurement: kWh
      device_class: energy
      state_class: total_increasing
      scan_interval: 30
    - name: "Komfovent Heating Recovery Day, kWh"
      address: 938
      data_type: uint32
      precision: 2
      scale: 0.001
      unit_of_measurement: kWh
      device_class: energy
      state_class: total_increasing
      scan_interval: 30
    - name: "Komfovent Heating Recovery Month, kWh"
      address: 940
      data_type: uint32
      precision: 2
      scale: 0.001
      unit_of_measurement: kWh
      device_class: energy
      state_class: total_increasing
      scan_interval: 30
    - name: "Komfovent Heating Recovery Total, kWh"
      address: 942
      data_type: uint32
      precision: 2
      scale: 0.001
      unit_of_measurement: kWh
      device_class: energy
      state_class: total_increasing
      scan_interval: 30
    - name: "Komfovent Status Panel Temperature"
      address: 945
      scale: 0.1
      unit_of_measurement: °C
      precision: 1
      device_class: temperature
      state_class: measurement
      scan_interval: 10
    - name: "Komfovent Status Panel Humidity"
      address: 946
      unit_of_measurement: "%"
      device_class: humidity
      state_class: measurement
      scan_interval: 10

sensor:
  - platform: template
    sensors:
      komfovent_on_off:
        friendly_name: "Komfovent On Off"
        value_template: >-
          {% set mapper =  {
              '0' : 'Off',
              '1' : 'On'} %}
          {% set state =  states('sensor.komfovent_on_off_num') %}
          {{ mapper[state] if state in mapper else 'Unknown' }}

      komfovent_eco_mode:
        friendly_name: "Komfovent Eco Mode"
        value_template: >-
          {% set mapper =  {
              '0' : 'Off',
              '1' : 'On'} %}
          {% set state =  states('sensor.komfovent_eco_num') %}
          {{ mapper[state] if state in mapper else 'Unknown' }}

      komfovent_auto_mode:
        friendly_name: "Komfovent Auto Mode"
        value_template: >-
          {% set mapper =  {
              '0' : 'Off',
              '1' : 'On'} %}
          {% set state =  states('sensor.komfovent_auto_num') %}
          {{ mapper[state] if state in mapper else 'Unknown' }}

      komfovent_operation_mode:
        friendly_name: "Komfovent Operation Mode"
        value_template: >-
          {% set mapper =  {
              '0' : 'Standby',
              '1' : 'Away',
              '2' : 'Normal',
              '3' : 'Intensive',
              '4' : 'Boost',
              '5' : 'Kitchen',
              '6' : 'Fireplace',
              '7' : 'Overide',
              '8' : 'Holiday',
              '9' : 'Air Quality',
              '10' : 'Off' } %}
          {% set state =  states('sensor.komfovent_mode_num') %}
          {{ mapper[state] if state in mapper else 'Unknown' }}

      komfovent_scheduler_mode:
        friendly_name: "Komfovent Scheduler Mode"
        value_template: >-
          {% set mapper =  {
              '0' : 'StayAtHome',
              '1' : 'WorkingWeek',
              '2' : 'Office',
              '3' : 'Custom'} %}
          {% set state =  states('sensor.komfovent_scheduler_num') %}
          {{ mapper[state] if state in mapper else 'Unknown' }}

      komfovent_temp_control_mode:
        friendly_name: "Komfovent Temperature Control Mode"
        value_template: >-
          {% set mapper =  {
              '0' : 'Supply',
              '1' : 'Extract',
              '2' : 'Balance',
              '3' : 'Room'} %}
          {% set state =  states('sensor.komfovent_temp_control_num') %}
          {{ mapper[state] if state in mapper else 'Unknown' }}

      komfovent_flow_control_mode:
        friendly_name: "Komfovent Flow Control Mode"
        value_template: >-
          {% set mapper =  {
              '0' : 'CAV',
              '1' : 'VAV',
              '2' : 'DCV',
              '3' : 'OFF'} %}
          {% set state =  states('sensor.komfovent_flow_control_num') %}
          {{ mapper[state] if state in mapper else 'Unknown' }}

      komfovent_eco_free_heat_cool_mode:
        friendly_name: "Komfovent Eco Free Heating/Cooling Status Mode"
        value_template: >-
          {% set mapper =  {
              '0' : 'Off',
              '1' : 'On'} %}
          {% set state =  states('sensor.komfovent_eco_free_heating_cooling_status_num') %}
          {{ mapper[state] if state in mapper else 'Unknown' }}

      komfovent_eco_heater_blocking:
        friendly_name: "Komfovent Eco Heating Blocking"
        value_template: >-
          {% set mapper =  {
              '0' : 'Off',
              '1' : 'On'} %}
          {% set state =  states('sensor.komfovent_eco_heating_enabled_status_num') %}
          {{ mapper[state] if state in mapper else 'Unknown' }}

      komfovent_eco_cooler_blocking:
        friendly_name: "Komfovent Eco Cooler Blocking"
        value_template: >-
          {% set mapper =  {
              '0' : 'Off',
              '1' : 'On'} %}
          {% set state =  states('sensor.komfovent_eco_cooling_enabled_status_num') %}
          {{ mapper[state] if state in mapper else 'Unknown' }}

      komfovent_eco_constant_heat_recovery:
        friendly_name: "Komfovent Eco Constant Heat Recovery"
        value_template: >-
          {% set mapper =  {
              '0' : 'Off',
              '1' : 'On'} %}
          {% set state =  states('sensor.komfovent_eco_constant_hr_enabled_status_num') %}
          {{ mapper[state] if state in mapper else 'Unknown' }}


# input_number:
#   komfovent_set_fan:
#     name: "Komfovent Set Fan"
#     unit_of_measurement: "%"
#     min: 20
#     max: 70
#     step: 5

#   komfovent_set_fan_vol:
#     name: "Komfovent Set Fan Vol"
#     unit_of_measurement: "mÂł/h"
#     min: 136
#     max: 491
#     step: 25

#   komfovent_set_temp:
#     name: "Komfovent Set Temp"
#     unit_of_measurement: °C
#     min: 15.0
#     max: 26.0
#     step: 0.1

#   komfovent_set_eco_max_temp:
#     name: "Komfovent Set Eco Max Temp"
#     unit_of_measurement: °C
#     min: 15.0
#     max: 26.0
#     step: 0.1

#   komfovent_set_eco_min_temp:
#     name: "Komfovent Set Eco Min Temp"
#     unit_of_measurement: °C
#     min: 15.0
#     max: 26.0
#     step: 0.1

# shell_command:
# #  set modes for 120 minutes (the =120 part)
#   komfovent_kitchen_mode: >-
#     curl 'http://192.168.0.150/' --data-raw '1=user&2=user' &&
#     curl 'http://192.168.0.150/ajax.xml' --data-raw '282=120'

#   komfovent_fireplace_mode: >-
#     curl 'http://192.168.0.150/' --data-raw '1=user&2=user' &&
#     curl 'http://192.168.0.150/ajax.xml' --data-raw '283=120'

#   komfovent_boost_mode: >-
#     curl 'http://192.168.0.150/' --data-raw '1=user&2=user' &&
#     curl 'http://192.168.0.150/ajax.xml' --data-raw '284=120'

binary_sensor:
  - platform: template
    sensors:
      komfovent_status_starting:
        friendly_name: "Komfovent Status - Starting"
        value_template: "{{ states('sensor.Komfovent_status')|int(0)|bitwise_and(1) > 0 }}"
      komfovent_status_stopping:
        friendly_name: "Komfovent Status - Stopping"
        value_template: "{{ states('sensor.Komfovent_status')|int(0)|bitwise_and(2) > 0 }}"
      komfovent_status_fan:
        friendly_name: "Komfovent Status - Fan"
        value_template: "{{ states('sensor.Komfovent_status')|int(0)|bitwise_and(4) > 0 }}"
      komfovent_status_rotor:
        friendly_name: "Komfovent Status - Rotor"
        value_template: "{{ states('sensor.Komfovent_status')|int(0)|bitwise_and(8) > 0 }}"
      komfovent_status_heating:
        friendly_name: "Komfovent Status - Heating"
        value_template: "{{ states('sensor.Komfovent_status')|int(0)|bitwise_and(16) > 0 }}"
      komfovent_status_cooling:
        friendly_name: "Komfovent Status - Cooling"
        value_template: "{{ states('sensor.Komfovent_status')|int(0)|bitwise_and(32) > 0 }}"
      komfovent_status_heatingdenied:
        friendly_name: "Komfovent Status - Heating Denied"
        value_template: "{{ states('sensor.Komfovent_status')|int(0)|bitwise_and(64) > 0 }}"
      komfovent_status_coolingdenied:
        friendly_name: "Komfovent Status - Cooling Denied"
        value_template: "{{ states('sensor.Komfovent_status')|int(0)|bitwise_and(128) > 0 }}"
      komfovent_status_flow_down:
        friendly_name: "Komfovent Status - Flow Down"
        value_template: "{{ states('sensor.Komfovent_status')|int(0)|bitwise_and(256) > 0 }}"
      komfovent_status_free_heating:
        friendly_name: "Komfovent Status - Free Heating"
        value_template: "{{ states('sensor.Komfovent_status')|int(0)|bitwise_and(512) > 0 }}"
      komfovent_status_free_cooling:
        friendly_name: "Komfovent Status - Free Cooling"
        value_template: "{{ states('sensor.Komfovent_status')|int(0)|bitwise_and(1024) > 0 }}"
      komfovent_status_alarm_f:
        friendly_name: "Komfovent Status - Alarm F"
        value_template: "{{ states('sensor.Komfovent_status')|int(0)|bitwise_and(2048) > 0 }}"
      komfovent_status_alarm_w:
        friendly_name: "Komfovent Status - Alarm W"
        value_template: "{{ states('sensor.Komfovent_status')|int(0)|bitwise_and(4096) > 0 }}"

#Scripts to write values to the MODBUS Registers
# script:
#   komfovent_write_temp_setpoint_normal:
#     alias: Komfovent Write Temp Setpoint Normal
#     variables:
#       valuetosend: 45
#     fields:
#       komfovent_temp_setpoint:
#         name: Komfovent Temp Setpoint Value
#         example: "195"
#         description: Actual value is * 10; 19.5°C = 195
#     sequence:
#       - service: modbus.write_register
#         data_template:
#           hub: "Komfovent"
#           address: 109
#           unit: 1
#           value: "{{ komfovent_temp_setpoint }}"
#     mode: single

#   komfovent_write_temp_to_reg:
#     alias: Komfovent Write Temp to Register
#     variables:
#       temptosend: 45
#     fields:
#       komfovent_temp:
#         name: Value
#         example: "195"
#         description: Actual value is * 10; 19.5°C = 195
#       komfovent_register:
#         name: Register
#         example: "0-999"
#         description: The Modbus Register value to use (register - 1)
#     sequence:
#       - service: modbus.write_register
#         data_template:
#           hub: "Komfovent"
#           address: "{{komfovent_register}}"
#           unit: 1
#           value: "{{ komfovent_temp }}"
#     mode: single

#   komfovent_write_fan_intensity_normal:
#     alias: Komfovent Write Fan Intensity Normal
#     variables:
#       valuetosend: 45
#     fields:
#       komfovent_fan_intensity:
#         name: Komfovent Fan Intensity Value
#         example: "[0,40]"
#         description: Writes same value to both fans and assumes intensity is set as a %
#         selector:
#           number:
#             min: 0
#             max: 100
#             unit_of_measurement: "%"
#     sequence:
#       - service: modbus.write_register
#         data_template:
#           hub: "Komfovent"
#           address: 105
#           unit: 2
#           value: "{{ komfovent_fan_intensity }}"
#       - service: modbus.write_register
#         data_template:
#           hub: "Komfovent"
#           address: 107
#           unit: 2
#           value: "{{ komfovent_fan_intensity }}"
#     mode: single

#   komfovent_dummy:
#     alias: "Komfovent Dummy script"
#     sequence:
#       delay: 00:00:00
# automation:
#   - alias: Komfovent Set Normal Temperature Input Number
#     description: "Set the input number to the Normal Setpoint value on HA start and if changed elsewhere (app or web)"
#     trigger:
#       - platform: homeassistant
#         event: start
#       - platform: state
#         entity_id: sensor.komfovent_status_normal_setpoint_c
#     condition: []
#     action:
#       - service: input_number.set_value
#         data:
#           value: "{{states('sensor.komfovent_status_normal_setpoint_c')}}"
#         target:
#           entity_id: input_number.komfovent_set_temp
#     mode: single

#   - alias: Komfovent Write Normal Temp Setpoint on Input change
#     description: "Write Normal Setpoint when input_number changes"
#     trigger:
#       - platform: state
#         entity_id: input_number.komfovent_set_temp
#     condition: []
#     action:
#       - service: script.komfovent_write_temp_setpoint_normal
#         data:
#           komfovent_temp_setpoint: "{{(states('input_number.komfovent_set_temp') | float(2.0) * 10) | int(20)}}"
#     mode:
#       single

#       {{(states('sensor.komfovent_extract_fan_intensivity') | round(0,"common",20))
#       != (states('input_number.komfovent_set_fan') | round(0,"common",20))}}
#   - alias: Komfovent Set Normal Fan Input Number
#     description: "Set the input number to the Extract Normal Fan Setpoint value on HA start and if changed elsewhere (app or web)"
#     trigger:
#       - platform: homeassistant
#         event: start
#       - platform: state
#         entity_id: sensor.komfovent_extract_fan_intensivity
#     condition:
#       - condition: and
#         conditions:
#           Only set if using % i.e. under 90 (max %).
#           - condition: numeric_state
#             entity_id: sensor.komfovent_extract_fan_intensivity
#             below: "90"
#           - condition: template
#             value_template: >-
#               {{(states('sensor.komfovent_status_normal_fan_extract_setpoint') | int(20))
#                 != (states('input_number.komfovent_set_fan') | int(20)) }}
#     action:
#       - service: input_number.set_value
#         data:
#           value: "{{states('sensor.komfovent_status_normal_fan_extract_setpoint') | int(20)}}"
#         target:
#           entity_id: input_number.komfovent_set_fan
#     mode: single

#   - alias: Komfovent Write Normal Fan Setpoint on Input change
#     description: "Write Normal Fan Setpoint (Sup & Extract) when input_number changes"
#     trigger:
#       - platform: state
#         entity_id: input_number.komfovent_set_fan
#     condition: []
#     action:
#       - service: script.komfovent_write_fan_intensity_normal
#         data:
#           komfovent_fan_intensity:
#             ["0", "{{states('input_number.komfovent_set_fan')}}"]
#     mode: single

#   - alias: Komfovent Record daily Heater consumption kWh
#     description: ""
#     mode: single
#     trigger:
#       - platform: state
#         entity_id: sensor.komfovent_heater_consumption_day_kwh
#         to: "0.0"
#       - platform: state
#         entity_id: sensor.komfovent_heater_consumption_day_kwh
#         to: "0.01"
#       - platform: state
#         entity_id: sensor.komfovent_heater_consumption_day_kwh
#         to: "0.02"
#     action:
#       - service: notify.persistent_notification
#         data:
#           message: Heater consumption yesterday {{trigger.from_state.state}}kWh
#       - service: mqtt.publish
#         data:
#           topic: ha/kom_heater_yesterday
#           retain: true
#           payload: "{{trigger.from_state.state}}"

#   - alias: Komfovent Write Eco Max Temp on Input change
#     description: "Write Eco Max Temp when input_number changes"
#     trigger:
#       - platform: state
#         entity_id: input_number.komfovent_set_eco_max_temp
#     condition: []
#     action:
#       - service: script.komfovent_write_temp_to_reg
#         data:
#           komfovent_temp: "{{(states('input_number.komfovent_set_eco_max_temp') | float(2.0) * 10) | int(20)}}"
#           komfovent_register: 200
#     mode: single

#   - alias: Komfovent Set Eco Max Temp Input Number
#     description: "Set the input number to the Eco Max Temp value on HA start and if changed elsewhere (app or web)"
#     trigger:
#       - platform: homeassistant
#         event: start
#       - platform: state
#         entity_id: sensor.komfovent_eco_max_supply_temperature_c
#     condition:
#       - condition: template
#         value_template: >-
#           {{(states('sensor.komfovent_eco_max_supply_temperature_c') | int(20))
#             != (states('input_number.komfovent_set_eco_max_temp') | int(20))}}
#     action:
#       - service: input_number.set_value
#         data:
#           value: "{{states('sensor.komfovent_eco_max_supply_temperature_c')}}"
#         target:
#           entity_id: input_number.komfovent_set_eco_max_temp
#     mode: single

#   - alias: Komfovent Write Eco Min Temp on Input change
#     description: "Write Eco Min Temp when input_number changes"
#     trigger:
#       - platform: state
#         entity_id: input_number.komfovent_set_eco_min_temp
#     condition: []
#     action:
#       - service: script.komfovent_write_temp_to_reg
#         data:
#           komfovent_temp: "{{(states('input_number.komfovent_set_eco_min_temp') | float(2.0) * 10) | int(20)}}"
#           komfovent_register: 199
#     mode: single

#   - alias: Komfovent Set Eco Min Temp Input Number
#     description: "Set the input number to the Eco Min Temp value on HA start and if changed elsewhere (app or web)"
#     trigger:
#       - platform: homeassistant
#         event: start
#       - platform: state
#         entity_id: sensor.komfovent_eco_min_supply_temperature_c
#     condition:
#       - condition: template
#         value_template: >-
#           {{(states('sensor.komfovent_eco_min_supply_temperature_c') | int(20))
#             != (states('input_number.komfovent_set_eco_min_temp') | int(20))}}
#     action:
#       - service: input_number.set_value
#         data:
#           value: "{{states('sensor.komfovent_eco_min_supply_temperature_c')}}"
#         target:
#           entity_id: input_number.komfovent_set_eco_min_temp
#     mode: single

#   - alias: Komfovent Exercise Fans
#     description: 'Write Normal Fan Setpoint (Sup & Extract) when input_number changes'
#     trigger:
#       - platform: state
#         entity_id: input_number.komfovent_set_fan
#     condition: []
#     action:
#       - service: script.komfovent_write_fan_intensity_normal
#         data:
#           komfovent_fan_intensity: ["0","{{states.input_number.komfovent_set_fan.state}}"]
#     mode: single

3 Likes

Is there a better way to handle the address 4 than four different switches? The logic behind the four switches is somewhat ok but it looks weird when there is more than one switch active.

I need to read all the data but I only need to write to address 4 with four different states; “away”, “normal”, “intensive” and “boost”. What I would like to do is automation’s that will change the states based on CO2 or relative humidity levels, electric heater power, electricity prices, solar panel production and so on.

It gets complicated if I have to read what mode number is on, flip that switch off and then flip the needed switch on and so on.

I need to do some other work on this package file as well. Did you raise an Issue. Hoping to get to it this week.

If you find it, let me know :slight_smile:

Personally, I always just leave it in Normal (and Eco) and just use automations to change the fan intensivity.

After a quick look through the new ModBUS docs, it looks like (as usual) the devs have written an integration to fit with their experience of the world rather than what it is really like. It in no way accounts for a device like the Komfovent MVHR units :frowning:

Might take a bit of unpicking.

I’m behind on my HA versions so it will take me a bit of time to update the package I fear.

So for instance - fan entity is either on or off with no % or flow rate :man_facepalming: .

I also spent time playing a little with the modbus climate entity. it would almost work if that would include:

  1. option to define custom hvac mode values (states)
  2. option to define address for each set temp for each mode
  3. fan entity to support hvac modes and values similarly as climate entity

with current modbus version climate entity can be used only for one mode within mode register. if someone is interested to play more here is example I tried.

    climates:
      - name: "away mode"
        address: 902
        hvac_onoff_register: 0
        hvac_mode_register:
          address: 4
          values:
            state_off:
              - 2
              - 3
              - 4
              - 5
              - 6
              - 5
              - 6
              - 7
              - 8
              - 9
              - 10
              - 0
            state_auto: 1
        max_temp: 40
        min_temp: 5
        scale: 0.1
        target_temp_register: 103
        target_temp_write_registers: true

Otherwise the only part I still get errors sometimes if komfovent status sensor entity. it suspect there is something wrong binary_sensor config due to responses are not binary :slight_smile: :

 friendly_name: "Komfovent Status - Starting"
        value_template: "{{ states('sensor.Komfovent_status')|int(0)|bitwise_and(1) > 0 }}"

Hello,

Please be gentle with me :slight_smile: I am ultra newbie in HA and dev integrations. However I do have Komfovent box and it would be great if I could skip original GUI by using HA integration. My device is following:

image

I though I will be able to add this integration via HACS but is seems does not work.

Can you please guide what files I have to modify to enable it manually? I could really use some ultra basic instruction since this will be my first HA coding experience.

Thank you in advance

hi - I’m stuck with this integration.
My ventilation is a Komfovent C6M, but I see I have a newer firmware:

INFORMATION
Configuration
R-450-V-R-AL_v2246

Main module firmware
C6M 1.4.33.51

Control panel firmware (1)
C6 1.1.3.34

Control panel firmware (2)
*.*.*.*

Based on the docu on README.md

this is what I did:

  • in configuration.yaml I added:
homeassistant:
  packages:
    komfovent: !include komfovent.yaml

I added the file https://github.com/borpin/ha_komfovent_config/blob/c8b06a3772b66f80d2305238bce36a215626ce0e/komfovent.yaml

I adapted the IP address (I’m using a fixed ip)

When checking the yaml config, it returns plenty of errors:

Invalid config for 'modbus' at komfovent.yaml, line 227: Komfovent Supply Flow volume: `count` illegal with `data_type: uint32` 'modbus->0->sensors->20', got {'name': 'Komfovent Supply Flow volume', 'address': 905, 'count': 2, 'data_type': 'uint32', 'input_type': 'holding', 'precision': 0, 'unit_of_measurement': 'mÂł/h', 'scan_interval': 10}
Invalid config for 'modbus' at komfovent.yaml, line 235: Komfovent Extract Flow volume: `count` illegal with `data_type: uint32` 'modbus->0->sensors->21', got {'name': 'Komfovent Extract Flow volume', 'address': 907, 'count': 2, 'data_type': 'uint32', 'input_type': 'holding', 'precision': 0, 'unit_of_measurement': 'mÂł/h', 'scan_interval': 10}
Invalid config for 'modbus' at komfovent.yaml, line 337: Komfovent AHU Consumption Day, kWh: `count` illegal with `data_type: uint32` 'modbus->0->sensors->33', got {'name': 'Komfovent AHU Consumption Day, kWh', 'address': 926, 'data_type': 'uint32', 'input_type': 'holding', 'count': 2, 'precision': 2, 'scale': 0.001, 'unit_of_measurement': 'kWh', 'device_class': 'energy', 'state_class': 'total_increasing', 'scan_interval': 30}
Invalid config for 'modbus' at komfovent.yaml, line 348: Komfovent AHU Consumption Month, kWh: `count` illegal with `data_type: uint32` 'modbus->0->sensors->34', got {'name': 'Komfovent AHU Consumption Month, kWh', 'address': 928, 'data_type': 'uint32', 'input_type': 'holding', 'count': 2, 'precision': 2, 'scale': 0.001, 'unit_of_measurement': 'kWh', 'device_class': 'energy', 'state_class': 'total_increasing', 'scan_interval': 30}
Invalid config for 'modbus' at komfovent.yaml, line 359: Komfovent AHU Consumption Total, kWh: `count` illegal with `data_type: uint32` 'modbus->0->sensors->35', got {'name': 'Komfovent AHU Consumption Total, kWh', 'address': 930, 'data_type': 'uint32', 'input_type': 'holding', 'count': 2, 'precision': 2, 'scale': 0.001, 'unit_of_measurement': 'kWh', 'device_class': 'energy', 'state_class': 'total_increasing', 'scan_interval': 30}
Invalid config for 'modbus' at komfovent.yaml, line 370: Komfovent Heater Consumption Day, kWh: `count` illegal with `data_type: uint32` 'modbus->0->sensors->36', got {'name': 'Komfovent Heater Consumption Day, kWh', 'address': 932, 'data_type': 'uint32', 'input_type': 'holding', 'count': 2, 'precision': 2, 'scale': 0.001, 'unit_of_measurement': 'kWh', 'device_class': 'energy', 'state_class': 'total_increasing', 'scan_interval': 30}
Invalid config for 'modbus' at komfovent.yaml, line 381: Komfovent Heater Consumption Month, kWh: `count` illegal with `data_type: uint32` 'modbus->0->sensors->37', got {'name': 'Komfovent Heater Consumption Month, kWh', 'address': 934, 'data_type': 'uint32', 'input_type': 'holding', 'count': 2, 'precision': 2, 'scale': 0.001, 'unit_of_measurement': 'kWh', 'device_class': 'energy', 'state_class': 'total_increasing', 'scan_interval': 30}
Invalid config for 'modbus' at komfovent.yaml, line 392: Komfovent Heater Consumption Total, kWh: `count` illegal with `data_type: uint32` 'modbus->0->sensors->38', got {'name': 'Komfovent Heater Consumption Total, kWh', 'address': 936, 'data_type': 'uint32', 'input_type': 'holding', 'count': 2, 'precision': 2, 'scale': 0.001, 'unit_of_measurement': 'kWh', 'device_class': 'energy', 'state_class': 'total_increasing', 'scan_interval': 30}
Invalid config for 'modbus' at komfovent.yaml, line 403: Komfovent Heating Recovery Day, kWh: `count` illegal with `data_type: uint32` 'modbus->0->sensors->39', got {'name': 'Komfovent Heating Recovery Day, kWh', 'address': 938, 'data_type': 'uint32', 'input_type': 'holding', 'count': 2, 'precision': 2, 'scale': 0.001, 'unit_of_measurement': 'kWh', 'device_class': 'energy', 'state_class': 'total_increasing', 'scan_interval': 30}
Invalid config for 'modbus' at komfovent.yaml, line 414: Komfovent Heating Recovery Month, kWh: `count` illegal with `data_type: uint32` 'modbus->0->sensors->40', got {'name': 'Komfovent Heating Recovery Month, kWh', 'address': 940, 'data_type': 'uint32', 'input_type': 'holding', 'count': 2, 'precision': 2, 'scale': 0.001, 'unit_of_measurement': 'kWh', 'device_class': 'energy', 'state_class': 'total_increasing', 'scan_interval': 30}
Invalid config for 'modbus' at komfovent.yaml, line 425: Komfovent Heating Recovery Total, kWh: `count` illegal with `data_type: uint32` 'modbus->0->sensors->41', got {'name': 'Komfovent Heating Recovery Total, kWh', 'address': 942, 'data_type': 'uint32', 'input_type': 'holding', 'count': 2, 'precision': 2, 'scale': 0.001, 'unit_of_measurement': 'kWh', 'device_class': 'energy', 'state_class': 'total_increasing', 'scan_interval': 30}

Can sb help me? I don’t want to go to the next step of dashboard config, as this is not working, and I don’t really have a feeling I understand what I’m doing.

The way I understand it, is that ha is already supporting the modbus protocol, we only need to add the config to add this as an integration, with the devices and entitities identified. Where am I making a mistake ?

many thanks in advance! :clap:

Hi, I used this config (thanks @runnerM!) and it worked without such issues

1 Like

Thanks for sharing that, @srg . Wonderful, I’ll have a look at it!

Hi,

Played with V300 C8 controller. If anybody need Komfovent external CO2 sensor (connected to C8 terminal pin 3-5 with wire) I managed to get the reading out by adding this sensor:

# Komfovent CO2 air quality sensor 
    - name: "Komfovent Air CO2 sensor 'ppm"
      address: 951
      data_type: uint16
      scale: 1
      unit_of_measurement: "ppm"
      state_class: measurement
      scan_interval: 30
1 Like

Is it possible to use komfovent switches in automations? I don’t see them in the UI and in YAML it requires device and entity id? Where should I add them?

Can you please post a screenshot with automation example? What do you write to modbus?

I was able to make it work:

That will put unit to “Away” mode value 1.

1 Like

Hello, can you help me integrate it my home assistant?