Another thread mentioned using ZHA Event Triggers to simplify the processing (as shown below).
That solves my problem, as I only have to list the device_ieee for each switch once now:
alias: Direct Button Press
mode: parallel
description: ""
triggers:
- trigger: event
event_type: zha_event
event_data:
cluster_id: 6
conditions:
- condition: template
value_template: "{{ switch_name != '' }}"
variables:
event_data: "{{ trigger.event.data }}"
switch_map:
8c:65:a3:ff:fe:c7:bf:71: bedroom_desk
a4:c1:38:ef:72:f4:18:11: bedroom_entry
8c:65:a3:ff:fe:b0:f6:ec: living_entry
94:b2:16:ff:fe:50:53:4d: kitchen_entry
a4:c1:38:6a:fe:dd:d9:c9: dining_desk
press_map:
remote_button_short_press: single
remote_button_double_press: double
remote_button_long_press: hold
switch_name: "{{ switch_map[event_data.device_ieee] }}"
press_type: "{{ press_map.get( event_data.command ) }}"
button_number: "{{ event_data.endpoint_id }}"
actions:
- action: script.button_pressed
metadata: {}
data:
switch_name: "{{ switch_name }}"
press_type: "{{ press_type }}"
button_number: "{{ button_number }}"