Sonoff mini button configuration

Good day.

I would like to bother with the question:

In the bathroom I have a switch that controls the fan. My plan now is to replace the switch with a button, add a sonoff mini and connect terminals S1 and S2 to the button.
For the mini Sonoff on Tasmota I chose the general module,
D3 GPIO0 Button1 - switch1 (9)
D2 GPIO4 - Button1 (17)
D6 GPIO12 Relay1 - Relay1 (21)
D7 GPIO13 Led1i - LED2 (53)

I have no problem with that, Sonoff works as I imagined. However, I would like to set some time after which the relay would turn off after pressing the sonoff mini button.
Can I make such a setting directly in the sonoff mini? Or do I need some automation in HA?

Later I plan to automate in HA based on a humidity sensor.

Thank you in advance for your sincere help.

Odpovím si znovu sám.

nastavit:

D3 GPIO0 Button1 - tlačítko1 (17)
D2 GPIO4 - Spínač1 (9)
D6 GPIO12 Relay1 - Relay1 (21)
D7 GPIO13 Led1i - LED2 (53)

V konzoli Tasmota rozhraní samotného zařízení:
pro typ tlačítka zadejte příkaz: SwitchMode 5
pro časování zadejte příkaz: PulseTime 100 + vteřin (460 = 6 minut = 360 + 100)