Adapt automation to work with multiple KNX telegrams

I want that a double push to any of the KNX push buttons in a house turns off all lights. I have written an automation that works as expected when you double click the KNX button with KNX group address 1/0/9. Is there a way to adapt this code to make it work for several KNX group addresses (1/0/1, 1/0/2,…,1/0/16)?

alias: Doble click apaga todas las luces
description: ""
trigger:
  - platform: knx.telegram
    destination: 1/0/9
condition: []
action:
  - wait_for_trigger:
      - platform: knx.telegram
        destination: 1/0/9
    timeout:
      hours: 0
      minutes: 0
      seconds: 0
      milliseconds: 400
    continue_on_timeout: true
  - if:
      - condition: template
        value_template: "{{ wait.trigger == none }}"
    then: null
    else:
      - wait_for_trigger:
          - platform: knx.telegram
            destination: 1/0/9
        timeout:
          hours: 0
          minutes: 0
          seconds: 0
          milliseconds: 400
        continue_on_timeout: true
      - if:
          - condition: template
            value_template: "{{ wait.trigger == none }}"
        then:
          - service: light.turn_off
            target:
              entity_id: all
            data: {}
        else: null

Hi :wave:!
You could try to template the destination here

action:
  - wait_for_trigger:
      - platform: knx.telegram
        destination: "{{ trigger.destination }}"

so it only waits for samt GAs, regardless of which invoked the automation (to not have a double-tap when you tap 2 individual switches simultaneously).

In the first trigger, just add multiple GAs.

Not sure why you need 2 wait_for_trigger for a double-tap. Wouldn’t one suffice?

I tried it, but I get the following error: “Message malformed: ‘{’[object Object]‘: None}’ is not a valid KNX group address: Invalid type ‘dict’ @ data[‘destination’][0]”

The second wait_for_trigger is for the triple tap action.

Did you copy my example 1:1? I did miss "" around the template. Fixed it above, but can’t test right now.