Combine 3 knx switches and create fan

Hey!

I have a central ventilation system that I can control at four levels using three KNX actuators (a, b, c, d), with settings (on, off). The correct combination of these actuators determines the appropriate fan level:
A 0
B 0
C 0
D 0
= Level 2

A 0
B 0
C 0
D 1
= Level 1

…And so on

How can I create a 4-stage slider or fan controller in Home Assistant that sets the correct actuators to the correct positions?

C

You could use a helper (dropdown or number) and create an automation triggering on state changes. As action use knx.send.
Or maybe find a template entity to do it all in yaml.

Here is my implementaion of Kitchen Hood, that technically is just 3 relays. You can prepare your implementation based on that:

kitchen_hood:

  fan:
    - platform: template
      fans:
        kitchen_hood_fan:
          friendly_name: "Kitchen Hood: Fan"
          unique_id: kitchen_hood_fan
          value_template: >-
            {{
              is_state("switch.kitchen_hood_s3", "on") 
            or
              is_state("switch.kitchen_hood_s2", "on") 
            or
              is_state("switch.kitchen_hood_s1", "on") 
            }}
          turn_on:
            - service: switch.turn_on
              target:
                entity_id: switch.kitchen_hood_s1
          turn_off:
            - service: switch.turn_off
              target:
                entity_id:
                  - switch.kitchen_hood_s1
                  - switch.kitchen_hood_s2
                  - switch.kitchen_hood_s3
          speed_count: 3
          preset_modes:
            - low
            - medium
            - high
          preset_mode_template: >-
            {% if is_state("switch.kitchen_hood_s3", "on") %}
              high
            {% elif is_state("switch.kitchen_hood_s2", "on") %}
              medium
            {% elif is_state("switch.kitchen_hood_s1", "on") %}
              low
            {% else %}
              off
            {% endif %}
          set_preset_mode:
            - service: switch.turn_on
              target:
                entity_id: >-
                  {% if preset_mode == 'high' %}
                    switch.kitchen_hood_s3
                  {% elif preset_mode == 'medium' %}
                    switch.kitchen_hood_s2
                  {% elif preset_mode == 'low' %}
                    switch.kitchen_hood_s1
                  {% endif %}

also see docs: Template fan - Home Assistant