In the last few years, the technology re-evolution has deeply transformed several aspects of everyday life. For sure, one technology with a strong impact is the so-called Internet of Things (IoT). The IoT paradigm made it possible to break down the data barrier between the vertical domains on which the traditional information and communication technology (ICT) world was organized. Recently, the designers of home automation systems have begun looking to the IoT paradigm to ease the deployment of systems that are able to collect data from different plants. Such a situation has driven further evolution from the traditional automation system, where logic is defined by the programmer or by the user, to a cognitive system that is able to learn from the user’ habits regarding what should be the best configuration of plants. Several countries are funding renovations of public and private buildings for improving energy efficiency. Generally, such renovations are only focusing on the structure of the building and of its energy performance (e.g., the thermal envelope, window units, air-conditioning plants, and renewable generators) and largely ignoring the use of intelligent devices. On the contrary, scientific literature and practice have demonstrated that the wider use of IoT sensors, as well as distributed and remote intelligence, is fundamental to optimize energy consumption. This research work aimed to identify issues due the application of cognitive solutions during the renovation phase of buildings. In particular, the paper presents a cognitive architecture to support the operation and management phases of buildings, thanks to the massive digitalization of the entire supply chain of the construction sector from the single building element to the entire construction process. Such an architecture is capable of combining data from the IoT sensors and actuators of smart objects installed during the renovation phase, as well as legacy building automation systems. As an indication of the capability of the proposed solution, an intelligent window device was developed and validated. Within the Energy, Life Styled, and Seismic Innovation for Regenerated Buildings (ELISIR) project, window units are equipped with sensors to monitor indoor and outdoor condition behaviours of users. In addition, windows are able to react to changes in the environment by means of actuators that enable motorized opening and shading. Thanks to the cognitive layer designed in the project, the window is able to automatically define the best rules for opening and shading by using the local controller to satisfy user’s habits and energy efficiency targets. The cognitive layer defines the appropriate rules for opening and shading using the decision tree algorithm applied to the data generated by the sensors in order to infer users’ preferences. For this research, two prototypes of the window units were installed in two offices of Politecnico di Milano, Italy. The accuracy of this algorithm to classify the users’ behaviour and preferences was found to be around 90%, considering an observation interval of two months.