If you want a switch to function as a pushbutton, e.g. to send an impulse to a gate, go to the settings of the device in question and under "Type of switch" select "Pushbutton".
This way the current will only flow when the button is physically pressed. A pulse of about 1 second long will be sent from the app allowing you to open (and when possible also close) the gate.