I already have a z-wave hub for other home automation.
My stinky cat litter solution:
Battery operated motion sensor - you can mount this anywhere - I put min by the kitty litter box
www.samsung.com
There are many options for controlling your fan. You can get something like this
www.leviton.com
You will need some sort of hub/controller for your z-wave devices to communicate with. Set timers for how long the fan runs after motion detected etc.
You can buy a room occupancy sensor switch as well for larger areas.
My stinky cat litter solution:
Battery operated motion sensor - you can mount this anywhere - I put min by the kitty litter box
SmartThings Motion Sensor | GP-U999SJVLBDA | Samsung CA
Keep tabs on your home with the SmartThings Motion Sensor which tells you when movement is detected – regardless of whether it’s expected or not.

There are many options for controlling your fan. You can get something like this
DZPA1-2BW - Indoor 15A Decora Smart with Z-Wave Plus Technology Plug-in Outlet - Leviton
Indoor 15 Amp Decora Smart with Z-Wave Plus Technology Plug-in Outlet
You will need some sort of hub/controller for your z-wave devices to communicate with. Set timers for how long the fan runs after motion detected etc.
You can buy a room occupancy sensor switch as well for larger areas.