Tasmota Integration: Allow to configure a switch as button

I have a 4 relay Itead board, running Tasmota.
Two of them are configured as “Momentary Switch” (like a pushbutton) and when activated have been deactivated after 0.5 s, they control the Home Gate.

Now I have configured these switches as buttons using the MQTT yaml files.
I would like to configure the switches using the tasmota integration, but using tasmota integration a switch can be configured as switch, outlet, cover, fan, light, lock, siren, or valve, but not button.

Could you add the ability to configure the switch as a button as well?

The problem is in Home Assistant a switch and a button are fundamentally different things. A switch is a physical entity with an actual state (on off).

A button has no state, it just creates an event. and the closest thing to a state is the timestamp of the last time it sent an event.

So no, HA is not built that way and changing that is VERY unlikely.

Input Button - Home Assistant.

I’m clear what is a button ad what is a switch, but to open the front gate, with its own control board, I only need “an event”. The event is generated by a tasmota relay, configured to be deactivated 0.5s after the activation.
For this reason, now this relay is configured as button entity in configuration.yaml:

# MQTT Entities
  - unique_id: 'cancello_auto'
    name: "Cancello Auto"
    icon: mdi:gate
    command_topic: "cmnd/GateControls/POWER1"
    payload_press: "TOGGLE"
      - topic: "tele/GateControls/LWT"
        payload_available: "Online"
        payload_not_available: "Offline"

The entity is assigned to a button card, so i can genetate the ‘toggle’ command at button press.

I only need a way to do the same by the tasmota integration.

1 Like