A processor may control air quality in an enclosed space. A processor may receive an external air condition index dataset associated with a geographical location. A processor may receive an internal air condition index dataset from one or more data collection devices in the enclosed space. A processor may apply an optimization criteria to the external air condition index dataset and the internal air condition index dataset. A processor may, responsive to applying the optimization criteria, determine an air exchange plan. The processor may perform the air exchange plan.