Can someone please explain to me how this function works? I have read the documentation multiple times and I still don’t understand what it does.
Device triggers are best avoided anyway. So unless you miss some functionality provided through triggers on entities, I would not bother to try to understand.
The device trigger mentioned in the docs is something else though, this is to send button presses from remotes to homekit, so they can trigger automations in Homekit. If you automate in Home Assistant (which is muc smarter) you should not need to do that either.
The documentation is pretty slim, and it’s also difficult to know exactly which devices (in HA) support triggers that will appear in Apple Home. Also if you are adding them via yaml, note you need to include the long hexanumeric device ID.
I tried bridging a Z-Wave switch (Zooz ZEN32) which has four physical buttons, and I got a trigger creation error (note this device does not have button entities, they only fire Z-wave events).
I also tried my custom esphome doorbell, which does have (one) button entity, and I got a new device in Apple Home with two buttons () that can be use to trigger (Apple Home) automations if you click the “Add” button (see screenshot). This would be useful if, as Edwin said, you wanted to make an Apple Home automation to do something when the button is pressed, instead of creating that automation in Home Assistant.
Edited to add: I also tried a Zooz ZEN37LR, which also has four buttons and no button entities, and while it too throws “error setting up trigger”, it DOES show up in Apple Home as an entity with 33(!) unconfigured buttons. So again I am at a loss how to determine which devices can be bridged with device triggers, or how the button count is determined or how they are distinguished from each other.
Thank you! This is so much clearer. So it’s effectively creating controller buttons that you can “press” and have that press event carry in to HomeKit, similar to how it works if you add something like a Lutron Pico or a Hue Dimmer Switch.