This paper describes a methodology for an automatic system for controlling the lighting and window shading in a commercial building. The system utilizes a microcomputer to monitor solar radiation and illumination levels and interior and exterior air temperatures, processing the input parameters to determine the optimum lighting level, window area, and solar film position to minimize building heating and cooling loads due to windows and lighting. The control methodology and logical flow are presented. The response of the system to various combinations of weather conditions is examined.