Now I use this module to set my Ducobox mechanical home ventilation system to 'High' whenever the light in the bathroom is on.
If you are going to follow the instructions below please be very careful because you will be working with exposed mains voltage.
The Ducobox can be controlled by (expensive) wireless Duco wall modules but also via a hardwired plug (via Perilex).
The Sonoff module has one relay which can turn on a mains voltage peripheral.
What you need to do is make sure the L3 terminal of Ducobox gets connected to the mains voltage line (L) when the relay switches on.
If the Ducobox detects 230V on L3, the fan will be set the High. (You could also connect it to L2, it will go to half power).
You need to connect the Sonoff exactly like the picture above. It is important that you do it this way, otherwise you will connect the N (neutral/blue) line to the Ducobox L3 when the relay is turned on, which will short circuit the box.
Also make sure the brown cable of the plug of the Ducobox is actually connected to L and not to N.
The Sonoff module is small enough to fit inside the Ducobox, and because it is powered by the mains voltage you don't need an additional power supply.

Now you setup a switch in Domoticz like the usual ESPEasy method.
And afterwards create a Blockly to turn it on when needed:
I use it via the bathroom light but you could also add a humidity sensor etc.