In many countries, a large share of the existing buildings lack mechanical supply-exhaust ventilation systems. Even during renovation, the integration of such systems is often technically infeasible or economically unjustifiable. As a result, natural ventilation remains the only viable option in numerous cases. However, natural ventilation is inherently unpredictable, reliant on external environmental factors, and typically requires manual operation by building occupants. To address these challenges, this study presents an automated window control system designed to enhance natural ventilation based on real-time indoor environmental and occupancy data. The system integrates sensors and a camera to continuously monitor indoor air temperature, CO₂ concentration, as well as human location within the room. A pre-trained AI model processes the visual data to detect and localize occupants. This spatial and environmental information is then processed by custom-developed algorithms that autonomously manage window operations to maintain indoor air quality (IAQ) while minimizing thermal discomfort. Performance analysis of the system demonstrated its capability to accurately identify occupants and their proximity to operable windows while effectively regulating ventilation. IAQ indicators—temperature, relative humidity, and CO₂ levels—were monitored alongside occupant feedback gathered through surveys. Participants reported no significant noise disturbance from window operation. Although a few participants reported localized sensations of cold drafts, overall comfort levels remained within acceptable ranges. Occupant surveys showed over 85 % reporting thermal comfort despite external temperatures of +5 ◦C. The findings suggest that the proposed system is a viable solution for improving IAQ in naturally ventilated spaces without compromising occupant comfort.