How to add non-existing trigger to yaml

I have a Zigbee button with a toggle command that is not avaible at the list the HA shows when trying to use it as a trigger.

The Developer tools zha_event sniffer gives me this data:

event_type: zha_event
data:
  device_ieee: a4:c1:38:4e:4e:9d:ad:fa
  device_id: 7b032bcff9c01acf131d6a9cc869b8f9
  unique_id: a4:c1:38:4e:4e:9d:ad:fa:1:0x0006
  endpoint_id: 1
  cluster_id: 6
  command: toggle
  args: []
  params: {}
origin: LOCAL
time_fired: "2025-11-30T14:07:34.919220+00:00"
context:
  id: 01KBAHE907DBE5RX24Q5TVTHED
  parent_id: null
  user_id: null

How do I use this as the trigger in this automation?

alias: New automation
description: ""
triggers:
  - type: turned_on
    device_id: 7b032bcff9c01acf131d6a9cc869b8f9
    entity_id: a2bb5d41f4de3db3793b3625f90b1fdc
    domain: switch
    trigger: device
conditions: []
actions:
  - type: toggle
    device_id: 3aac2074dcb4a2ae30063e2415fc0913
    entity_id: 24eb6985585db2cb811b9d97895c9c91
    domain: switch
  - type: toggle
    device_id: e15dcfe0d1742b1e8af4dd76ba901992
    entity_id: 64af755d2b82a912b39d46b09043c781
    domain: switch
  - type: toggle
    device_id: 3d7c9bf0b1a3a916878a22546684408b
    entity_id: b32c3ccdbaccbbf83452d7d36530bfe0
    domain: switch
mode: single

The single click event shows up in the event for the device


But the toggle is not an option when trying to use it:

You have to listen for a Zigbee event. I do something similar to get the config button from any of my Inovelli switches:

trigger: event
event_type: zha_event
event_data:
  command: button_3_hold

so, try this as a trigger:

trigger: event
event_type: zha_event
event_data:
  device_ieee: a4:c1:38:4e:4e:9d:ad:fa
  command: toggle

Is there something wrong in my code?

In the future, please follow Community Questions Guideline #14.

The config is missing the triggers key and the event trigger is improperly indented:

alias: New automation
description: ""
triggers:
  - trigger: event
    event_type: zha_event
    event_data:
      device_ieee: a4:c1:38:4e:4e:9d:ad:fa
      command: toggle
conditions: []
# the rest of it...

Thanks! I’m new to yaml, so it’s not really easy to troubleshoot these myself.
Now it works like it should.

Just FYI, you can set up Event triggers in the Automation Editor if you want to reduce the amount of messing with YAML. For your event it would look like: