Setting up relays for HomeKit


I recently installed a Zigbee Tuya relay module (ZB-SW01) via MQTT on my gate. This relay acts as a button (when pressed and released, the gate opens)

The problem is that when I connected this relay to HomeKit, and I press the button to open the gate, it says in the Home app that it is open and immediately closed, although in reality the gate is just starting to open.

My task is to add this relay to HomeKit so that after a certain time interval, the HomeKit application writes that the gate is open.