Fan or Dimmer outlet that reports temperature too

I would replace the existing switch (is it a standard wall switch?) with the GE fan control switch, place a device with temperature reporting in the space, and connect both of those through this SmartApp:

I use it (or the 4-speed variant for my Hampton Bay Wink controllers) for all our ceiling fans and it works great.

Pick a sensor whose other features you can use - for instance, if the fan is noisy and you want it to turn off when you enter the attic, use a contact sensor and have it turn off when you open the attic door / hatch. If you might need to run a dehumidifier, get a temp/humidity sensor. Etc.