I have done exactly this...as well as controllers for large commercial air handlers/heating/cooling/lighting/and a variety of home automation projects. Can make with raw, old school electronics (in response to daylight outside, for instance), a microcontroller for more tunability, or a tiny computer that can be run autonomously with a C program or overridden by user input locally or remotely..say with your cel phone. Just need further specs.