One line two devices?

A device like this one might work in your situation.

But as @anon36505037 said, it would help to understand how your fan/light is wired now. Do you have a wireless receiver module in your fan canopy that gives you independent control of fan and lights with a remote?