To have my house ventilation on max speed when taking a shower, I used a [W1401 thermostat](https://aliexpress.com/item/32801482651.html) taped to my hot water pipe.
It switches a contact in the house fan.
When I take a shower, the hot water pipe rapidly heats and the fan switches to high setting, preventing the mirror to fog.
It takes 10 minutes for the pipe to cool, so the fan continues to remove moist air to dry the bathroom.
The thermostat was picked because it can be used to switch on high temperature ("cooling") and has adjustable hysteresis (which I can use to set the running time of the fan when the pipe cools).
Source files on [Github](https://github.com/koen-lee/OpenSCAD-designs/tree/master/W1401%20Thermostat%20housing)
Technical
The PCB is placed inside and can be screwed.
I was lazy and used some tywraps to hold the housing together and mount it on the house ventilation system, right next to the hot water supply.
Depending on the fan model, the switch may carry high voltage so take care.