Replacing fan controller with arduino

Hi,
I'm currently redoing my bathroom, and I want to replace my current ventilation fan controller with an Arduino.
I've been googling around trying to find a soultion, but nothing so far, and I was wondering if some of you guys might have an answer to my problem...
I'm currently using a MTY-1A fan controller.

What I'm trying to accomplish is to be able to regulate the speed of the fan depending on the humidity in the bathroom.

Have anyone tried this before?

Thanks!

Do you have to keep the same 240V fan? It's much easier to control a 12V computer fan. Most of them have dedicated control wires that can be attached directly to an Arduino. Getting the Arduino to control 240V (or 110V) requires extra circuitry that will end up costing more than that mass-produced item.

The BME280 is an absolutely brilliant humidity sensor. It's more expensive but it is astoundingly accurate across a huge range of temperatures and humidities. It's also magically quick at sensing changes in humidity. The datasheet claims you can use the humidity sensor for indoor navigation where GPS doesn't work.

Thanks for your reply. I have to keep the duct fan, because it sits deep inside my wall, and Im not going to trear down my whole house. That's why I'm looking for a solution to control the fan that I already have..

The bme280 looks interesting. I'm currently using a dht22 sensor.