Help with Esp home thermostat integration with API

Hello, is there a template thermostat or an easier way to make one. I am trying to make a esphome based thermostat and will like to integrate it to home assistant via the esphome API.
There is a new feature in esphome where you can create your own service so I want to use that
will like to make a call service for mode, fan mode and the target temp I have looked into making a Lovelace card to call the services but don’t have enough knowledge for that