Ceiling fan automation plans

That's the path I'd be tempted to take and just make a box to put the MHCOZY in the fan-ceiling cover bell. Been really impressed with that little card.

EDIT: BUT WAIT ! Let's remember these AREN'T powered by 120VAC so there's that to deal with up there ! ""Two working voltage: USB 5V or AC/DC 7-32V""

UNLESS this would do everything you needed.