Modbus Sensor TCP for Komfovent

Using the TCP Modbus interface is to me preferable as some functionality is not exposed directly in the UI, although some things are only in the UI.

Not a fan of scraping, but yes an integration would be good.

Komfovent modbus integration is broken. Maybe because of 2023.12 update?

1 Like

yes, Scrapping is dirty way of achieving something however it is internal users resource scrapped, not a site in the outside internet so I believe that will be stable enough and no vendor policies will be in scope. On the other hand I am interested on the performance of it. how often and how much data that will require to ensure it runs fine.
With modbus interface. due to modbus integration is designed to be fit for majority of use cases on the high level it will never fully work with Komfovent and I find it hard to live with constant errors in the log :slight_smile: In addition when I turned on debug logging I was amazed how much of the traffic modus is actually creating. Out of all mine HA traffic (~ 80 devices), most of it was actually from modbus integration.

adding author to the post:
@ProstoSanja

maybe new integration could use scrapping and modbus for some parts that are not accessible online?

you deleted the post. Did you found a fix?

EDIT: Did a restart for the ventilation unit and not it’s working again.

I had different issue with komfovent.yaml config file. Issue with “count: 2”

1 Like

For me the same with this integration

borpin/ha_komfovent_config: Set of files for configuring MODBUS connection to a Komfovent Unit (github.com)

Invalid config for 'modbus' at komfovent.yaml, line 227: Komfovent Supply Flow volume: `count` illegal with `data_type: uint32` 'modbus->2->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->2->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->2->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->2->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->2->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->2->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->2->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->2->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->2->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->2->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->2->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}

@arva have you managed to get things working?

Just remove 'count': 2 parameters from your config lines. data_type is enough.

You problably figured it out allready but who ever has trouble with this may find some help here. I’m no expert but there is something wrong with the sensor the button card reads the values from.

It reads values from “sensor.komfovent_operation_mode” but this sensor isnt available. In the config YAML theres a template part that should convert numeric values (0 - 10) of operation mode into text values (like away, normal, boost etc). For some reason this doesnt work.

I created a workaround for the moment and used the numeric values of the sensor “sensor.komfovent_mode_num”:

type: vertical-stack
cards:
  - type: vertical-stack
    cards:
      - type: horizontal-stack
        cards:
          - type: custom:button-card
            entity: sensor.komfovent_mode_num
            color: grey
            tap_action:
              action: call-service
              service: modbus.write_register
              service_data:
                address: 4
                hub: Komfovent
                unit: 1
                value: 1
            hold_action:
              action: none
            name: Away
            show_name: true
            icon: mdi:home-export-outline
            color_type: card
            state:
              - value: 1
                color: CornflowerBlue
          - type: custom:button-card
            entity: sensor.komfovent_mode_num
            color: grey
            tap_action:
              action: call-service
              service: modbus.write_register
              service_data:
                address: 4
                hub: Komfovent
                unit: 1
                value: 2
            hold_action:
              action: none
            name: Normal
            show_name: true
            icon: mdi:home-account
            color_type: card
            state:
              - value: 2
                color: CornflowerBlue
          - type: custom:button-card
            entity: sensor.komfovent_mode_num
            color: grey
            tap_action:
              action: call-service
              service: modbus.write_register
              service_data:
                address: 4
                hub: Komfovent
                unit: 1
                value: 3
            hold_action:
              action: none
            name: Intensive
            show_name: true
            icon: mdi:weather-windy
            color_type: card
            state:
              - value: 3
                color: CornflowerBlue
          - type: custom:button-card
            entity: sensor.komfovent_mode_num
            color: grey
            tap_action:
              action: call-service
              service: modbus.write_register
              service_data:
                address: 4
                hub: Komfovent
                unit: 1
                value: 4
            hold_action:
              action: none
            name: Boost
            show_name: true
            icon: mdi:fan
            color_type: card
            state:
              - value: 4
                color: CornflowerBlue

Also noticed the modbus documentation doesnt seem to correspond to reality. Registers 906 - 909 should show supply and extract flow but in reality it shows fan intensity. I dont know if this was ever working as i didnt look into it that much before. Can someone confirm if they see flow values also? maybe a firmware update issue. I’v polled different register but cant seem to find anything usefull

I was planning on removing the control display and replace it with a NSpanel pro to reduce the amount of displays on my wall :slight_smile: This way i could have underfloor heating and several other controls in one display. Would be nice to have also supply flow in m3/h shown.

Here is the modbus data poll in boost mode:

Hello, maybe you can explain how to do it step by step

Hello. Thanks guys for nice hints and lovelace cards examples. Was able to create something like below:

Hi, could you share your card and yaml? im struggligng with Kitchen mode, and overide. i want to use it some time as mode to reduce humidity from time to time. i dont know how to activate it on my yaml.

I have totally messed my yaml file and VAC unit is turned off due to ongoing construction in my house. Building new house. Will update and share my yaml asap then.

Cant directly control kitchen or override over modbus. You need to connect dry-contact to komfovent controller to use these modes. Use some cheap smart switch and convert signal to dry contact with pcb relay.

Hello! Many people have shared their yaml configs here earlier, which has been a great help. However I was personally looking for a more out of the box support for the Komfovent devices, so I’ve spent some time to write a full integration for the C6, C6M and C8 modules. This is very easily installable if you have HACS set up. Please keep in mind that this is an early release still, but any help and feedback is appreciated.

3 Likes

Got an error
komfovent

No devices or entities

Failed setup, will retry: Modbus Error: [Connection] Not connected[AsyncModbusTcpClient 192.168.0.182:502]

Unexpected error fetching komfovent data
Traceback (most recent call last):
File “/config/custom_components/komfovent/modbus.py”, line 50, in read_holding_registers
raise ModbusException(f"Error reading registers at {address}")
pymodbus.exceptions.ModbusException: Modbus Error: Error reading registers at 999

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File “/config/custom_components/komfovent/coordinator.py”, line 101, in _async_update_data
firmware_block = await self.client.read_holding_registers(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
registers.REG_FIRMWARE, 6
^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File “/config/custom_components/komfovent/modbus.py”, line 57, in read_holding_registers
raise ConfigEntryNotReady from error
homeassistant.exceptions.ConfigEntryNotReady: Modbus Error: Error reading registers at 999

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py”, line 380, in _async_refresh
self.data = await self._async_update_data()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/config/custom_components/komfovent/coordinator.py”, line 110, in _async_update_data
raise ConfigEntryNotReady from error
homeassistant.exceptions.ConfigEntryNotReady: Modbus Error: Error reading registers at 999

ERROR FIXED IN LAST UPDATE OF INTERGRATION

If you have issues seeing the data correctly, then please open a ticket in the GitHub repository with:

  • the model of your device, controller type and firmware version
  • a data dump taken with the modbus_dump.py tool
  • screenshots of the data in the Komfovent app or web interface

Please share this card :slight_smile:

Ah, that is excellent.

However, the register layouts change depending on the firmware version. Can you state what firmware version you are working to for the C6M? The latest I have has C6M_22-09 in the footer.

Download will have to wait :frowning: I don’t upgrade until the end of the month :rofl:

2025.3.1 or newer