HA Button that triggers ESPHome switch

I have an Avatto S06 IR transmitter, which I am going to use as a remote control for my ceiling lamp. Basically I have it working already with this config:

remote_receiver:
  pin:.
    number: GPIO5
    inverted: true
  dump: all

remote_transmitter:
  pin:.
    number: GPIO14
    inverted: false
  carrier_duty_percent: 50%
  id: "s06_transmitter"

switch:
  - platform: template
    name: "BrightnessUp"
    turn_on_action:
      remote_transmitter.transmit_jvc:
        data: 0xE41B
  - platform: template
    name: "BrightnessDown"
    turn_on_action:
      remote_transmitter.transmit_jvc:
        data: 0xA857

The inconvinience I see is BrightnessUp/BrightnessDown are propagated to Home Assistant as switches, while in fact it should behave like a push buttons. I am quite new to ESPHome, and could not figure out how to make this yet.

What is the right way for making a Home Assistant button in ESPHome?

They’re switched because you’ve configured them as switches.

Have a look here: https://esphome.io/components/api.html#user-defined-services

You should be able to make a button in ha front end that calls a service, to tell the esp to do something

Then rather than configuring it as a switch in esphome, that service is a trigger for the remote action

You could probably also make a custom light in esphome that uses the or controls

Thank you for your ideas. User service works for me.

Not sure whether I could use light module. I am emulating lamp remote control, that is sending button codes (e.g. ‘brighter’, or ‘warmer’), but does not has a state (e.g. 75% brightness). Can I still define light object if I have only limited set of commands?