I would like to fire a custom event pressing a button in the Front End.
I could link the button to the execution of a Python script and inside it fire the event with hass.bus.fire().
Is there a more straightforward method to do it, without passing through a Python script?
ok, but I guess I can’t link that action directly to a button to press in the Front End, can I?
Do I have to put it in a script and trigger the script from an Entity Button?
This links an automation to an entity button.
I was asking for a link between an entity button and a custom event firing (because I will use it in something more complicated of an automation). Is there something I’m missing?
Like @niedejb said you can call an automation from your button like he did in his example and then simply fire the event as is shown on the page I linked to e.g.:
action:
event: YOUR_EVENT
If you want to pass in some parameters, you can add them to event_data: