It depends on how you have your system setup but I am running pretty much what you are after at the moment.
My bathroom fans are connected to Sonoff T1's and Home assistant. I have Xioami bluetooth temp/humidity sensors in each bathroom.
Only US$19.99, buy best xiaomi mijia bluetooth temperature humidity sensor lcd screen digital thermometer hygrometer moisture meter sale online store at wholesale price.
www.banggood.com
Those are reading back to an ESP32 running Esphome and it is reading the output of the two bathrooms all of the time. When a certain level is reached the extractors turn on and then turn back off when humidity levels drop.
I also have an automation in Home assistant that if you turn the extractor on from the switch it will run for 10 mins and then turn itself off again. This leaves more than enough time to shower and make sure the bathroom is back to normal levels afterwards.
The placement of the humidity sensors is key though, I found having an ESPx and BME280 in the ceiling wasnt effective.