Now the problem i have - it is simple logic, and i am not a programmer

I need a switch to turn on once for 5 seconds if a binary sensor goes on.
The "if then" can only turn on the switch, but not limit it to 5 seconds. I tried to look at several apps, but did not find any to do the trick.
The elaborate description

So i need the event from the door sensor to switch on the switch in the fan as if someone pulled the string


My environment - i took the beta
Firmware version v3.0.0-rc16
to resolve a problem where 237 were crashing, and indeed v3 is not crashing.
Running on raspberry3, raspbian stretch with razberry 2