How to configure button to open gate/cover

Hi, I have a ZB-SW01 switch from eWeLink, whose entity type is light, and it works like a button :wink: When I turn it on, after a while it turns itself off.
I use it to initiate the opening of the gate.

Instead of light.gate, I would like to have cover.gate. How to do it properly?

  1. i could make in .yaml switch.gate and use the UI helper to change to cover, but that gives very little editing options
  2. in .yaml I have already done:
  - platform: template
        device_class: gate
        friendly_name: "Main Gate"
        unique_id: tplMainGate
        value_template: "{{ is_state('light.gate', 'on') }}"
          - service: light.toggle
              entity_id: light.gate
          - service: light.toggle
              entity_id: light.gate

it displays as a gate and the opening works correctly, but after a while it shows as closed.
I have no way to add any physical sensor, so how would it be best to set the correct status based on time?

The gate has only one button, when it is pressed it opens and after half a minute it closes. Pressing the button again interrupts the closing and opens again