No need for occupancy sensor. I have mine set to turn on when bathroom humidity is both above 70%, and 10% greater than my living room humidity. It’ll run a minimum 5 minutes, and then once the humidity is back within 10% of the living room, or below 68%, it’ll shut off. It’s been working great for over a year.
I also have it set to auto shut off 20 min after manually being turned on, but just before shutting down it checks the humidity to make sure it doesn’t meet the above criteria. This avoids the event where you turned the fan on while dropping a deuce but then got in the shower right after - don’t want the fan shutting down early. Also, if I ever manually turn the fan back on within 5 minutes of it auto shutting off, it will run for 10 min before shutting down vs the normal 20.
I’m using aqara temp/humidity sensors throughout the house. I’m not sure what the fan is, it’s just a standard exhaust fan, but its controlled with a Kasa smart switch.