Push button pulse ha

Hi I’m new, I have automation experiences with different protocols such as opehab and souliss, but I wanted to interface with other systems and I noticed esphome and home assistant. But I have an initial problem, I need a button on the home page of ha and not a switch … I loaded the code on esp, which activates and deactivates a gpio immediately as if it were a button … But in ha I find myself a switch that remains in the on position when in reality the gpio and off … This I need to control a relay step by step … But I can not find the way to be able to create a button in ha … Thanks for the 'Help

Have a look here: https://www.home-assistant.io/lovelace/button/

Or if you want fancier buttons: https://github.com/custom-cards/button-card

If you want the logic to happen all on the esp unit after hitting the button, you can also look at an esphome user defined service and call it in a script in homeassistant.