One fifth of the electricity consumption of Swiss buildings is due to electric lighting. Integrated control of sun shading and artificial lighting can mitigate this demand while maintaining user comfort. However, the drawback of existing building control approaches is that they do not consider one of the main aspects of human-centric lighting: visual comfort. An ‘on-the-fly’ measurement of a visual comfort index, Daylight Glare Probability (DGP), by a novel High Dynamic Range (HDR) vision sensor was introduced into the building control system optimizing the sun shadings position and electric lighting status. As the first approach, this novel solution was tested during a short-term experiment for 15 afternoons at the LESO solar experimental building. The long-term effect of such novel system was evaluated during an eight-month data monitoring campaign. This experiment was carried out in the same building in order to study the ability of a novel control approach to maintain optimal visual and thermal comfort conditions while reducing the energy performance gap of a room as well as its electric lighting demand. The experimental results showed that the advanced controller mitigated the performance gap during the heating season by 72% with regard to a simulated scenario where a standard occupant manually controls the sun shadings and electric lightings; and by 19% with respect to an experimented scenario with best-practice integrated automated shading and lighting system. This system reduced backup heating demand leading to lower CO2 gas emissions. At the same time, visual comfort constraints regarding DGP and workplane horizontal illuminance were respected for 88.1% of work hours.