hello and welcome to HCM,
Since you have mentioned that when you turn the fan away your pain disappears then thats the best solution to your problem!
You must know that ear is very sensitive to temperature changes and this may manifest anytime. When the air from the fan or AC strikes the ear, this may cause the ear to pain.
If this simple act solves the problem then continue to cover your ears when you sleep and do not allow the direct blast of fan to fall on the ear. If the problem is increasing in severity and your have hearing loss
you may consult an ENT who will advice an audiometric evaluation for further management.
Dr Sriram Nathan