Map KNX Cover and VELUX Cover Types

Hello everyone,

First, let me introduce myself. As you’ve probably noticed, I’ve registered on this forum to post this thread. I’m David, 38 years old, and I own a single-family house in NRW. I’ve automated a lot of things in my home using KNX. However, since not everything is available in KNX, I use Home Assistant to integrate third-party systems. So far, it has worked well for me, enabling me to access weather data in KNX and have my living room lights toggle when someone rings the doorbell.

My latest project involves controlling VELUX windows together with a KLF 200 Gateway using a KNX switch with the help of Home Assistant. I’m facing some challenges with this project, and the results are not satisfactory to me.

I’m using the HA Velux Integration and HA KNX Integration for this. Both of these integrations have the “Cover” data type.

I’ve set up an automation to close the VELUX cover when the KNX cover is set to “Close.” However, this is working quite poorly. It gets disrupted if the VELUX rain sensor interferes or if I use the VELUX remote control.

My automation.yaml file looks as follows:

- id: "1693424552737"
  alias: EG_Bad_Dachfenster_Öffnen
  description: ""
  trigger:
    - platform: state
      entity_id:
        - cover.eg_bad_dachfenster
      to: opening
      for:
        hours: 0
        minutes: 0
        seconds: 1
  condition: []
  action:
    - service: cover.open_cover
      data: {}
      target:
        entity_id: cover.2
  mode: single
- id: "1693424804388"
  alias: EG_Bad_Dachfenster_Schließen
  description: ""
  trigger:
    - platform: state
      entity_id:
        - cover.eg_bad_dachfenster
      to: closing
  condition: []
  action:
    - service: cover.close_cover
      data: {}
      target:
        entity_id: cover.2
  mode: single
- id: "1693425286843"
  alias: EG_Bad_Dachfenster_Position
  description: ""
  trigger:
    - platform: state
      entity_id:
        - cover.eg_bad_dachfenster
      to: set_cover_position
  condition: []
  action:
    - service: cover.set_cover_position
      data:
        position: "{{ states.cover.eg_bad_dachfenster.set_cover_position.data }}"
      target:
        entity_id: cover.2
  mode: single

Is there a way to directly map the two covers together without dealing with complex automations?

I basically just want to do a cover.2=cover.eg_bad_dachfenster.

Does anyone have any tips for me? Unfortunately, I haven’t found anything in that direction through Google and similar sources. I’ve seen something similar with Philips Hue and KNX combined in HA, but it didn’t help me much.

Can you provide some assistance on this? Do I need to work with blueprints, perhaps?

Thank you, and have a great Sunday!

Best regards,
David

Hi :wave:!

I’d not recommend tu even use 2 cover entities. A Knx cover expects an actuator with all its normal functionality and state updates - that’s not what you are providing here.

Consider using expose to map state of the velux cover entity to Knx and use events or Knx interface device triggers to call services on the velux entity.

Hi Matthias,

KNX event works for me for closing/opening and stopping the window, but not for the position:

 id: "1693424552737"
  alias: EG_Bad_Dachfenster_Öffnen
  description: ""
  trigger:
    - platform: event
      event_type: knx_event
      event_data:
        destination: 3/1/60
        data: 0
  condition: []
  action:
    - service: cover.open_cover
      data: {}
      target:
        entity_id: cover.2
  mode: single
- id: "1693424804388"
  alias: EG_Bad_Dachfenster_Schließen
  description: ""
  trigger:
    - platform: event
      event_type: knx_event
      event_data:
        destination: 3/1/60
        data: 1
  condition: []
  action:
    - service: cover.close_cover
      data: {}
      target:
        entity_id: cover.2
  mode: single
- id: "1693425286843"
  alias: EG_Bad_Dachfenster_Position
  description: ""
  trigger:
    - platform: event
      event_type: knx_event
      event_data:
        destination: 3/3/60
  condition: []
  action:
    - service: cover.set_cover_position
      data:
        position: "{ { trigger.event.data.data } }"
      target:
        entity_id: cover.2
  mode: single
- id: "1711725288276"
  alias: EG_Bad_Dachfenster_Stopp
  description: ""
  trigger:
    - platform: event
      event_type: knx_event
      event_data:
        destination: 3/2/60
  condition: []
  action:
    - service: cover.stop_cover
      target:
        entity_id:
          - cover.2
      data: {}
  mode: single

Do you have any suggestions how i get the event data in the Cover Position?
- service: cover.set_cover_position
data:
position: “{ { trigger.event.data.data } }”
target:
entity_id: cover.2

Best regards,
David

Hi :wave:!
Set a type for your event and use
position: “{ { trigger.event.data.value } }”
instead of ...data.data.

Or use the interface device trigger instead of events. Those are a bit easier to handle.