KNX: Expose cover to KNX

Dear all,

I recently installed IKEA Fyrtur shades, which I would like to control from a KNX switch (MDT Glastaster).

In this endeavor I need to overcome two challenges:

  1. Expose the state of the shades to the switch
  2. Configure HA to listen on a GA and interpret and execute the commands from the switch

Wrt. 1.: I was able to expose the state. Unfortunately, HA treats 100% as opened, while KNX treats this as closed. What’s the recommended approach here? E.g. template entity that’s inverting the original one?
Wrt. 2.: Is there anyone having done that successfully? Are there chances to reuse and adapt the blueprint by @farmio for dimming?

I would appreciate any feedback or comment!

Regards

1 Like

Hi :wave:!

Ad 1: yes, expose a helper or template sensor. Or use a custom automation that listens for state changes.

Ad 2: This should not be necessary. Dimming is not a thing HA offers services for - you can just set a new brightness value (there is no light.stop_dimming). Therefore the quite complex blueprint.
With covers, you can just call the cover.open_cover / cover.stop_cover services in an automation based on received telegram payload.

1 Like

Thank you, @farmio. I was able to set up everything.

By now, I can control the IKEA shades as well as some Shelly 2.5ers from the MDT Glastaster. The latter was a bit more complicated as pushing the same button for a 2nd time while the cover is moving wouldn’t stop the cover.

I’m contemplating publishing this as a blueprint, but will have to make it more generic first.

1 Like

Hey,

I’m trying to resolve the same thing at this moent. Would it be possible to share your exact setting? I’m trying to the same at this moment with some Zwave shades and GVS v40 as a switch.

thanks,

Hi @jogie,

let me see whether I can help You with the below.

  1. KNX configuration YAML
knx:
  event:
  - address:
    - "0/4/20" # GA for cover going up / down or stop
  expose:
    - type: percent
      entity_id: sensor.cover_04_31_rolladen_fensterlinks_position_invert
      address: "0/4/21" # GA for cover state
      default: 0
  1. Automations for responding to events from the switch:
- id: 'automation.04_rollo_links_ab'
  alias: Steuere Keller Rollo Fenster links
  description: ''
  trigger:
  - platform: event
    event_type: knx_event
    event_data: {}
    condition:
    - condition: template
      value_template: '{{ trigger.event.data.destination == ''0/4/20'' and trigger.event.data.data == 1 }}'
    action:
    - service: cover.stop_cover
      data: {}
      target:
        entity_id: cover.04_31_rolladen_fensterlinks
    - service: cover.close_cover
      data: {}
      target:
        entity_id: cover.04_31_rolladen_fensterlinks
  mode: single
- id: 'automation.04_rollo_links_auf'
  alias: Steuere Keller Rollo Fenster links
  description: ''
  trigger:
  - platform: event
    event_type: knx_event
    event_data: {}
    condition:
    - condition: template
      value_template: '{{ trigger.event.data.destination == ''0/4/20'' and trigger.event.data.data == 0 }}'
      action:
      - service: cover.stop_cover
        data: {}
        target:
          entity_id: cover.04_31_rolladen_fensterlinks
    - service: cover.open_cover
      data: {}
      target:
        entity_id: cover.04_31_rolladen_fensterlinks
  mode: single
  1. Inverted sensor as Home Assistant reports the state position differently
- sensor:
  - name: cover_04_31_rolladen_fensterlinks_position_invert
    state: "{{ 100 - (state_attr('cover.04_31_rolladen_fensterlinks', 'current_position') | int) }}"

Hope this helps. I had to reintent the lines after copying. Not sure why white spaces were omitted upon pasting. But that could be a potential source of error, if these lines don’t work you.

Regards

This is great, thanks a lot. Will try it this week, and revert back if I have any questions.

cheers, J