You set the triggers in your Automation and you give an id for every one.
Then in your actions you have an Option Select with condition: trigger and the id you need to use.
Example:
alias: My Automation
description: 'Select Scenes'
trigger:
- device_id: <The id from your Switch>
domain: zha
platform: device
type: first_button_short_press
subtype: first_button_short_press
id: first_short
- device_id: <The id from your Switch>
domain: zha
platform: device
type: first_button_long_press
subtype: first_button_long_press
id: first_long
condition: []
action:
- choose:
- conditions:
- condition: trigger
id: first_short
sequence:
- action: {{<What you need to do if there is a short press on the first button > }}
- conditions:
- condition: trigger
id: first_long
sequence:
- action: {{<What you need to do if there is a long press on the first button >}}
default: []
mode: restart