Modbus Sensor TCP for Komfovent

Thank you.
But do you see posibility to update states for Auto , Power and Eco ? If i change state on controler HA will not notice it…

I’ve found that in the modbus switch configuration if you set verify: (without any attributes) then the switch state tracks the value that is set in the register.

So now my modbus switch configuration looks like:

  switches:
    - name: "Komfovent Auto Mode"
      address: 3
      command_on: 1
      command_off: 0
      verify:
    - name: "Komfovent Power"
      address: 0
      command_on: 1
      command_off: 0
      verify:
    - name: "Komfovent Eco Mode"
      address: 2
      command_on: 1
      command_off: 0
      verify:
1 Like

I find “kitchen” mode useful as it creates positive pressure (supply fan 80%, exhaust fan 20%) which helps the stove fume extractor do its job better.

I’ve looked at the HTTP request the komfovent Web UI is doing when enabling kitchen mode for 20 minutes, and it is sending 282=20 command to the backend. However if I try to set 282 register to value 20 using modbus directly, it complains about invalid value to the register. So it looks like the backend has a special interpretation for this command and possibly executes multiple modbus commands.

So I have created a shell_command service, which logs into the UI and enables kitchen mode for 20 minutes:

shell_command:
  komfovent_kitchen_mode: >-
    curl 'http://192.168.86.200/' --data-raw '1=user&2=user' &&
    curl 'http://192.168.86.200/ajax.xml' --data-raw '282=20'

This service then can be used from the lovelace ui:

          - type: horizontal-stack
            cards:
              - type: 'custom:button-card'
                entity: sensor.komfovent_mode
                tap_action:
                  action: call-service
                  service: shell_command.komfovent_kitchen_mode
                hold_action:
                  action: none
                name: Kitchen
                show_name: true
                icon: 'mdi:pot-steam-outline'
                state:
                  - value: '5'
                    color: '#f7d958'
                  - operator: default
                    color: '#4e729a'
              - type: 'custom:button-card'
                entity: switch.komfovent_eco_mode
                name: Eco
                icon: 'mdi:snowflake-variant'
                hold_action: more-info

Resulting in this panel:

2 Likes

Hello,

Have anybody figured out how to configure connection to C4 controller (PING2)?
I have tried several examples from this thread but it is not really working.

This thread is more about TCP rather then RS485. connection. I would suggest getting C2 specs first. And make sure your 485 connection is actually working using simple modbus clients based on the C2 specs you will find.

Hi, Thanks for your replay. It think it is TCP also, because it is sort of working… I can see some values changing for eg. Supply fan level. if I activate override function manually, I can see supply fan level goes to 100%, but other values seems to be mixed up a bit, so I think that register values are not 100% correct. Also switches does not work. Although I took it from a manual I found here:

My configuration looks like this:

modbus:
  - name: Komfovent PING
    type: tcp
    host: 192.168.31.9
    port: 502
    switches:
      - name: "Komfovent Power"
        address: 1000
        command_on: 1
        command_off: 0
      - name: "Override mode"
        address: 1111
        command_on: 1
        command_off: 0
    sensors:
      - name: "Supply air temp"
        scan_interval: 60
        address: 1200
        input_type: holding
        unit_of_measurement: °C
        scale: 0.1
        precision: 1
      - name: "Setpoint temp"
        scan_interval: 60
        address: 1201
        input_type: holding
        unit_of_measurement: °C
        scale: 0.1
        precision: 1
      - name: "Water temp"
        scan_interval: 60
        address: 1205
        input_type: holding
        unit_of_measurement: °C
        scale: 0.1
        precision: 1
      - name: "Supply fan level"
        scan_interval: 60
        address: 1115
        input_type: holding
      - name: "Exhaust fan level"
        scan_interval: 60
        address: 1116
        input_type: holding
      - name: "Alarm Status"
        scan_interval: 60
        address: 1009
        input_type: holding
      - name: "System status"
        scan_interval: 60
        address: 1000
        input_type: holding
      - name: "Warning status"
        scan_interval: 60
        address: 1007
        input_type: holding
      - name: "Recuperator level"
        scan_interval: 60
        address: 1010
        input_type: holding
      - name: "Electric heater level"
        scan_interval: 60
        address: 1011
        input_type: holding
      - name: "Water heating level"
        scan_interval: 60
        address: 1012
        input_type: holding
      - name: "Ventilation level"
        scan_interval: 60
        address: 1100
        input_type: holding
      - name: "Override status"
        scan_interval: 60
        address: 1111
        input_type: holding

Yep, I remember that specs usually say address that you have to substract 1. So if your register says on Supply Air Temp is on address 1200 , you can try to see 1199 . Give it a try. Also you can download SimplyModBUS software and try to talk to PING using that software. Its probably going to speed up your debugging process.

EDIT:

Looks like my solution was far too complicated and resulted wrong outcome. Urility meter did now work, because initial data should have been in kwh instead of w, as in komfovent integration.

Found out about the Integration Sensor - Integration - Riemann sum integral - Home Assistant

So tried this way:

Configuration.yaml

- platform: integration
    source: sensor.komfovent_power_consumption_w
    name: komfovent_current_energy
    unit_prefix: k
    round: 2

Again got an error if trying to add state_class: total_increasing and device_class: energy.

Did it in customize.yaml:

sensor.komfovent_current_energy:
  state_class: total_increasing
  device_class: energy

Now was able to add sensor.komfovent_current_energy to Energy Monitoring.

Let’s see if it works.

Edit: Works like a charm

Checked the HA logs and there are many warnings on Komfovent integration:

2021-11-28 10:10:47 WARNING (MainThread) [homeassistant.components.modbus.validators] Komfovent Power  with int is not valid, trying to convert

2021-11-28 10:10:47 WARNING (MainThread) [homeassistant.components.modbus.validators] Komfovent Eco  with int is not valid, trying to convert

2021-11-28 10:10:47 WARNING (MainThread) [homeassistant.components.modbus.validators] Komfovent Mode  with int is not valid, trying to convert

2021-11-28 10:10:47 WARNING (MainThread) [homeassistant.components.modbus.validators] Komfovent Auto  with int is not valid, trying to convert

2021-11-28 10:10:47 WARNING (MainThread) [homeassistant.components.modbus.validators] Komfovent Shedule  with int is not valid, trying to convert

2021-11-28 10:10:47 WARNING (MainThread) [homeassistant.components.modbus.validators] Komfovent Supply temperature 'C  with int is not valid, trying to convert

2021-11-28 10:10:47 WARNING (MainThread) [homeassistant.components.modbus.validators] Komfovent Extract temperature 'C  with int is not valid, trying to convert

2021-11-28 10:10:47 WARNING (MainThread) [homeassistant.components.modbus.validators] Komfovent Supply Flow '%  with int is not valid, trying to convert

2021-11-28 10:10:47 WARNING (MainThread) [homeassistant.components.modbus.validators] Komfovent Extract Flow '%  with int is not valid, trying to convert

2021-11-28 10:10:47 WARNING (MainThread) [homeassistant.components.modbus.validators] Komfovent Supply Fan Intensivity '%  with int is not valid, trying to convert

2021-11-28 10:10:47 WARNING (MainThread) [homeassistant.components.modbus.validators] Komfovent Extract Fan Intensivity '%  with int is not valid, trying to convert

2021-11-28 10:10:47 WARNING (MainThread) [homeassistant.components.modbus.validators] Komfovent Outdoor temperature 'C  with int is not valid, trying to convert

2021-11-28 10:10:47 WARNING (MainThread) [homeassistant.components.modbus.validators] Komfovent Filter Dirt, %  with int is not valid, trying to convert

2021-11-28 10:10:47 WARNING (MainThread) [homeassistant.components.modbus.validators] Komfovent Filter Impurity, %  with int is not valid, trying to convert

2021-11-28 10:10:47 WARNING (MainThread) [homeassistant.components.modbus.validators] Komfovent Heating power, W  with int is not valid, trying to convert

2021-11-28 10:10:47 WARNING (MainThread) [homeassistant.components.modbus.validators] Komfovent Power consumption, W  with int is not valid, trying to convert

2021-11-28 10:10:47 WARNING (MainThread) [homeassistant.components.modbus.validators] Komfovent Power consumption Month, kWh  with int is not valid, trying to convert

2021-11-28 10:10:47 WARNING (MainThread) [homeassistant.components.modbus.validators] Komfovent Heating Recovery Month, kWh  with int is not valid, trying to convert

2021-11-28 10:10:47 WARNING (MainThread) [homeassistant.components.modbus.validators] Komfovent Heating Recovery Total, kWh  with int is not valid, trying to convert

2021-11-28 10:10:47 WARNING (MainThread) [homeassistant.components.modbus.validators] Komfovent Heat Recovery, W  with int is not valid, trying to convert

2021-11-28 10:10:47 WARNING (MainThread) [homeassistant.components.modbus.validators] Komfovent Heat exchanger efficiency, %  with int is not valid, trying to convert

2021-11-28 10:10:47 WARNING (MainThread) [homeassistant.components.modbus.validators] Komfovent Energy saving, %  with int is not valid, trying to convert

2021-11-28 10:10:47 WARNING (MainThread) [homeassistant.components.modbus.validators] Komfovent Specific power (SPI)  with int is not valid, trying to convert

2021-11-28 10:10:47 WARNING (MainThread) [homeassistant.components.modbus.validators] Komfovent Power  with int is not valid, trying to convert

2021-11-28 10:10:47 WARNING (MainThread) [homeassistant.components.modbus.validators] Komfovent Eco  with int is not valid, trying to convert

2021-11-28 10:10:47 WARNING (MainThread) [homeassistant.components.modbus.validators] Komfovent Mode  with int is not valid, trying to convert

2021-11-28 10:10:47 WARNING (MainThread) [homeassistant.components.modbus.validators] Komfovent Auto  with int is not valid, trying to convert

2021-11-28 10:10:47 WARNING (MainThread) [homeassistant.components.modbus.validators] Komfovent Shedule  with int is not valid, trying to convert

2021-11-28 10:10:47 WARNING (MainThread) [homeassistant.components.modbus.validators] Komfovent Supply temperature 'C  with int is not valid, trying to convert

2021-11-28 10:10:47 WARNING (MainThread) [homeassistant.components.modbus.validators] Komfovent Extract temperature 'C  with int is not valid, trying to convert

2021-11-28 10:10:47 WARNING (MainThread) [homeassistant.components.modbus.validators] Komfovent Supply Flow '%  with int is not valid, trying to convert

2021-11-28 10:10:47 WARNING (MainThread) [homeassistant.components.modbus.validators] Komfovent Extract Flow '%  with int is not valid, trying to convert

2021-11-28 10:10:47 WARNING (MainThread) [homeassistant.components.modbus.validators] Komfovent Supply Fan Intensivity '%  with int is not valid, trying to convert

2021-11-28 10:10:47 WARNING (MainThread) [homeassistant.components.modbus.validators] Komfovent Extract Fan Intensivity '%  with int is not valid, trying to convert

2021-11-28 10:10:47 WARNING (MainThread) [homeassistant.components.modbus.validators] Komfovent Outdoor temperature 'C  with int is not valid, trying to convert

2021-11-28 10:10:47 WARNING (MainThread) [homeassistant.components.modbus.validators] Komfovent Filter Dirt, %  with int is not valid, trying to convert

2021-11-28 10:10:47 WARNING (MainThread) [homeassistant.components.modbus.validators] Komfovent Filter Impurity, %  with int is not valid, trying to convert

2021-11-28 10:10:47 WARNING (MainThread) [homeassistant.components.modbus.validators] Komfovent Heating power, W  with int is not valid, trying to convert

2021-11-28 10:10:47 WARNING (MainThread) [homeassistant.components.modbus.validators] Komfovent Power consumption, W  with int is not valid, trying to convert

2021-11-28 10:10:47 WARNING (MainThread) [homeassistant.components.modbus.validators] Komfovent Power consumption Month, kWh  with int is not valid, trying to convert

2021-11-28 10:10:47 WARNING (MainThread) [homeassistant.components.modbus.validators] Komfovent Heating Recovery Month, kWh  with int is not valid, trying to convert

2021-11-28 10:10:47 WARNING (MainThread) [homeassistant.components.modbus.validators] Komfovent Heating Recovery Total, kWh  with int is not valid, trying to convert

2021-11-28 10:10:47 WARNING (MainThread) [homeassistant.components.modbus.validators] Komfovent Heat Recovery, W  with int is not valid, trying to convert

2021-11-28 10:10:47 WARNING (MainThread) [homeassistant.components.modbus.validators] Komfovent Heat exchanger efficiency, %  with int is not valid, trying to convert

2021-11-28 10:10:47 WARNING (MainThread) [homeassistant.components.modbus.validators] Komfovent Energy saving, %  with int is not valid, trying to convert

2021-11-28 10:10:47 WARNING (MainThread) [homeassistant.components.modbus.validators] Komfovent Specific power (SPI)  with int is not valid, trying to convert

My configuration:

modbus:
  - name: Komfovent
    type: tcp
    host: 192.168.1.34
    port: 502
    switches:
      - name: "Komfovent Auto Mode"
        slave: 1
        address: 3
        command_on: 1
        command_off: 0
      - name: "Komfovent Power"
        slave: 1
        address: 0
        command_on: 1
        command_off: 0
      - name: "Komfovent Eco Mode"
        slave: 1
        address: 2
        command_on: 1
        command_off: 0
    sensors:
      - name: "Komfovent Power"
        address: 0
        scan_interval: 10
      - name: "Komfovent Eco"
        address: 2
        scan_interval: 10
      - name: "Komfovent Mode"
        address: 4
        scan_interval: 10
      - name: "Komfovent Auto"
        address: 3
        scan_interval: 10
      - name: "Komfovent Shedule"
        address: 5
        scan_interval: 10
      - name: "Komfovent Supply temperature 'C"
        address: 901
        scan_interval: 10
        unit_of_measurement: °C
        scale: 0.1
        precision: 1
      - name: "Komfovent Extract temperature 'C"
        address: 902
        scan_interval: 10
        unit_of_measurement: °C
        scale: 0.1
        precision: 1
      - name: "Komfovent Supply Flow '%"
        address: 905
        scan_interval: 10
        count: 2
        unit_of_measurement: '%'
        precision: 1
      - name: "Komfovent Extract Flow '%"
        address: 907
        scan_interval: 10
        count: 2
        unit_of_measurement: '%'
        precision: 1
      - name: "Komfovent Supply Fan Intensivity '%"
        address: 909
        scan_interval: 10
        unit_of_measurement: '%'
        scale: 0.1
        precision: 1
      - name: "Komfovent Extract Fan Intensivity '%"
        address: 910
        scan_interval: 10
        unit_of_measurement: '%'
        scale: 0.1
        precision: 1
      - name: "Komfovent Outdoor temperature 'C"
        address: 903
        scan_interval: 10
        unit_of_measurement: °C
        scale: 0.1
        precision: 1
      - name: "Komfovent Filter Dirt, %"
        address: 918
        scan_interval: 10
      - name: "Komfovent Filter Dirt, %"
        address: 917
        scan_interval: 10
      - name: "Komfovent Filter Impurity, %"
        address: 916
        scan_interval: 10
        unit_of_measurement: '%'
      - name: "Komfovent Heating power, W"
        address: 912
        scan_interval: 10
        unit_of_measurement: W
      - name: "Komfovent Power consumption, W"
        address: 920
        scan_interval: 10
        unit_of_measurement: W
      - name: "Komfovent Power consumption Month, kWh"
        address: 928
        scan_interval: 10
        unit_of_measurement: kWh
        count: 2
        precision: 0
        scale: 0.001
      - name: "Komfovent Heating Recovery Month, kWh"
        address: 940
        scan_interval: 10
        unit_of_measurement: kWh
        count: 2
        precision: 0
        scale: 0.001
      - name: "Komfovent Heating Recovery Total, kWh"
        address: 942
        scan_interval: 10
        unit_of_measurement: kWh
        count: 2
        precision: 0
        scale: 0.001
      - name: "Komfovent Heat Recovery, W"
        address: 922
        scan_interval: 10
        unit_of_measurement: W
      - name: "Komfovent Heat exchanger efficiency, %"
        address: 923
        scan_interval: 10
        scale: 1
        precision: 0
        unit_of_measurement: '%'
      - name: "Komfovent Energy saving, %"
        address: 924
        scan_interval: 10
      - name: "Komfovent Specific power (SPI)"
        address: 925
        scan_interval: 10
        scale: 0.001
        precision: 2

Any idea what would cause that?

Same problem here any ideas ?

I keep this here, maybe helps someone:

1 Like

update your comfovent firmware it helped . All good now

How can you update the komfovent firmware ? What tool do you use and where do you find the firmware updates?
I have never updated the firmware.

1 Like

Ops,
I updated and now i can’t see the version on the panel. Anyone who know what to do?

Hi All, i’m new in this community and i was looking for the modbus connection between home assistant and komfovent. i was wondering if it’s possible tot read/write value’s from knx tot the komfovent modbus. Vallue’s like CO2, temp, humidity,… Maybe someone has some examples…

Looking forward for your reply’s :smile:

1 Like

solved, just had to do a hard power reset and the panel went back online again showing the current firmware version.

Does anyone have the C6M Modbus protocol? is it just an extension of the C6 protocol or is it completely different?

You need to state the data_type - seems the default doesn’t actually work (or is not as stated). one of those listed here Modbus - Home Assistant

I found that where the doc says unsigned char you need to use uint16

1 Like

Really interesting and negates the need for physical relays.

Quick check and the commands for the modes are…

  • 282 Kitchen (as you said)
  • 283 Fireplace
  • 284 Override

All need a time the mode will be used for. Not yet experimented with this but can see some possibilities.

[edit]
I have created a Package File to combine all these good ideas into a single file. Please view and commit any additions and changes as you feel necessary.

I have started a new thread Komfovent C6 & C6M Controller Package File

This is still under development but wanted to share what I have.

[Edit]
Has anyone put anything in place to control the fan speed or change the setpoint of the Ventilation Unit via a Lovelace card? I know how to do it from a MODBUS perspective, it is the Lovelace/entity part I’m struggling with.

I have found the GitHub - htmltiger/numberbox-card: Replace input_number sliders with plus and minus buttons to provide the control to provide the incrementing UI, just working out how to actually use this.

The Template Fan integration is not really any use as it requires an on/off action which isn’t really appropriate.

1 Like