"Softbutton" to trigger automation - simulate existing "hardbutton"

I have a few aqara mini wireless buttons (zigbee) that I’m using to trigger some automation. Among others as a “fail safe” for family members to be able to disable all automation should some sensors misbehave. Those buttons supports “single click”, “double click” and “long clock” so my automation have 3 different sets of actions per button. My automation basically has one condition for each button and then a “Choose” statement to execute the correct codeblock based on which button action was executed.

Now I would like to simulate these buttons in the Lovelace GUI, any idea how to do this in an efficient manner?

The “button” helper object is pretty much useless since it only supports “button pressed”. It would have been perfect if it supported double-press and long-press as well…

If I used a “button” card I can set different actions for single, double and long-press, but how do I use that in my existing automation? Is it even possible to pass an argument to an automation that can be used as a condition, when the automation is triggered from the GUI?

Any other ideas on how to do this without duplicating everything?

You may want to consider using the custom Button Card.

Thanks, but my challenge is how to call the existing automation from a button and pass parameters to indicate how the button was pressed. For various reasons, I don’t really want to rewrite my automation.

I’m guessing that might not even be possible. Anyone?

Or maybe I should just create a helper input_select entity and set that to a value that represents the different button clicks, and then check that entity in my automation. I guess that’s the best way to do this unless someone has a better suggestion.

Cards don’t generate events so I don’t know how you were planning to use a card to trigger your existing automation.

The custom button card can call a service. Basically you configure the card to call a script via the script.turn_on service. You can even pass variables to the script (for example, to identify which button-action occurred like tap, hold, or double-click).

You can create any event via a script. You just need to replicate the event data in an event call.