Model originally uploaded to Thingiverse at https://www.thingiverse.com/thing:3435504.
I thought I had an original idea, but it seems others faced the same issue I had. Waking in the middle of the night to turn on the fan, only to accidentally flood the bedroom with light.
This is my take on it. In my case, my ceiling fans have standard pull-chains with a pull-chain coupling clasp at the end. This model is designed to accept this. Earlier drafts of this model just had the wider hole out the bottom, but I decided to make this a screw cap, so it was more pleasant. The screw cap isn't strictly necessary, but it looks much nicer with it.
I printed this on a Prusa i3 MK3S @ 0.1mm layer height in PLA and the screw cap fits perfectsly and snug enough I don't worry about it coming loose on its own.
It requires supports, but the separate cap helps to reduce the height of them a little.
I've included the Fusion 360 file. Be warned, this is only the second time I used it. LOL.