Advances towards smart ecosystems showcase Internet of Things (IoT) as a transversal strategy to improve energy eﬃciency in buildings, enhance their comfort and environmental condi- tions, and increase knowledge about building behavior, its relationships w ith users and the inter- connections among themselves and the environmental and ecological context. EU estimates that 75% of the building stock is ineﬃcient and more than 40 years old. Although many buildings have some type of system for regulating the ind oor temperature, only a small subset provides integrated Heating, Ventilation, and Air Conditioning (HVAC) systems. Within that subset, only a small per- centage includes smart sensors, and only a slight portion of that percentage integrates those sensors into IoT ecosystems. This work pursues two objectives. The ﬁrst is to understand the built environ- ment as a set of interconnected systems constituting a complex framework in which IoT ecosystems are key enabling technologies for improving energy eﬃciency and Indoor Air Quality (IAQ) by ﬁll- ing the gap between theoretical simulations and real measurements. The second is to understand IoT ecosystems as cost -eﬀective solutions for acquiring data through connected sensors, analyzing information in real -time, and building knowledge to make data -driven decisions. The dataset is publicly available for third-party use to assist the scientiﬁc community in its research studies. This paper details the functional scheme of the IoT ecosystem following a 3 -level method ology for: (1) identifying buildings (with regard to their use patterns, thermal variation, geographical orientation, etc.) to analyze their performance; (2) selecting representative spaces (according to their location, orientation, use, size, occupancy, e tc.) to monitor their behavior; and (3) deploying and conﬁguring an infrastructure with +200 geolocated wireless sensors in +100 representative spaces, collecting a dataset of +10000 measurements every hour. The results obtained through real installations with IoT as learning factory, include several learned lessons about building complexity, energy consump- tion, costs, savings, IAQ and health improvement. A proof -of-concept of building performance pre- diction based on neural networks (applied to CO 2 and temperature) is proposed. This ﬁrst learning shows that IAQ measurements meet recommended levels around 90% of the time and that an IoT - managed HVAC system can achieve energy consumption savings of between 10 and 15%. In sum- mary, in a real context involving economic restrictions, complexity, high energy costs, social vul- nerability, and climate change, IoT -based strategies, as proposed in this work, oﬀer a modular and interoperable approach moving towards smart com munities (buildings, cities, regions, etc.) by im- proving energy eﬃciency and environmental quality (indoor and outdoor) at low cost, with quick implementation, and low impact on users. Great challenges remain for growth and interconnection in IoT use, especially challenges posed by climate change and sustainability . Keyworks: Internet of Things (IoT); Indoor Air Quality (IAQ); Energy eﬃciency; Smart buildings; Learning factory prePrint · Internet of Things (IoT) in buildings: a learning factory 2 of 24 1. Introduction According to a special report by the European Court of Auditors [1], buildings are responsible for 40% of energy consumption and 36% of greenhouse gas emissions in Eu- rope. According to Eurostat [2], buildings have contributed approximately 25–28% to en- ergy consumption in Europe since 1995. Energy consumption in households is the main reason for the observed greenhouse gas emissions of the sector [3]. Buildings and house- holds, given their energy savings potential, have priority consideration in the European Union (EU) 2030 agenda to meet the EU’s Sustainable Development Goals (SDGs), with a commitment to reduce energy consumption by more than 30% by 2030 [4]. According to the United States (US) Environmental Protection Agency (EPA) [5] and the EU [6], people spend 80–90% of their time indoors, where air quality is 2 to 5 times worse than outdoors. High Indoor Air Quality (IAQ) is thus of utmost importance. Addressing these key challenges is not mandatory but rather the subject of policy recommendations. In this context, the main relevant European norm is the Energy Perfor- mance Buildings Directive (EPBD) 2018/84 4/EU [7]. EPBD promotes energy eﬃciency in buildings through several initiatives related to Internet of Things (IoT) technolog ies and Heating, Ventilation and Air Conditioning (HVAC) systems , among other key topics . Ac- cording to EP BD, the energy performance of buildings should be calculated on the basis of a methodology, which can be diﬀerentiated at national and regional levels . In addition to thermal characteristics, it considers other relevant factors, such as: heating and air con- ditioning installations, ventilation strategies, application of energy from renewable sources, building automation and control systems, smart solutio ns, passive heating and cooling elements, adequate natural light and air quality, and design of the building, among others. The methodology should be based on hourly or sub -hourly time steps, en- sure the representation of actual operating conditions, and en able the use of metered en- ergy to verify correctness and facilitate comparability. From these premises, proposed solutions should be transversal strategies and consider the following key aspects of build- ing environments: • Few buildings have complete HVAC s ystems; most have air conditioning only, heat- ing only, heating and air conditioning distribution or systems that provide combined ventilation, heating, and cooling. • Few buildings include IoT: although it is becoming more common to incorporate sen- sors that are used by Supervisory Control And Data Acquisition (SCADA) systems to control HVAC systems, integrating such systems into IoT ecosystems, as proposed in this paper, remains a challenge. • The European building stock is largely obsolete, so interventions t o improve energy eﬃciency must also ensure air quality to maintain a healthy and comfortable indoor environment with minimal energy use and environmental impact. • The built environment is huge, so transversal strategies need to be low in cost and economic ally sustainable. All these considerations call for consideration of which strategies are the most eﬀec- tive in improving building performance, especially energy eﬃciency and IAQ. This ques-tion is beginning addressed in research on the design and constr uction of new buildings called smart buildings when integrated with IoT technology. However, as mentioned pre- viously, the current reality of the built environment is that only a minority of buildings include IoT. It is necessary to assess how IoT -based str ategies can be cost -eﬀective and sustainable. Incorporating IoT technologies enables continuous collection of data to know how buildings behave and making da ta-driven decisions to improve IAQ and reduce its energy consumption and carbon footprint [8]. IoT allows the collection of vast amounts of data that, if properly transmitted and processed (by cloud or in -house facilities), can be converted into meaningful information [9]. This in formation, conveniently visualized and analyzed, generates knowledge, induces feedback on the acquisition and processing of data, and, most importantly, allows intelligent decisions based on valuable data [10]. prePrint · Internet of Things (IoT) in buildings: a learning factory 3 of 24 Thus, IoT monitoring oﬀers conﬁgurable solutions in a customized way for speciﬁc cases and contexts. Furthermore, each building is unique in its shape, construction solution, location, climate, and usage, making IoT monitoring a transversal solution, oﬀering both conﬁgurable options and the ability to adapt to each speciﬁc case and context. IoT is one of the technological paradigms destined to exponentially increase with a high impact on the daily behavior of potential users [11]. However, since this research area is an emerging ﬁeld, the available literature is still limited. In [12], assuming this scope is a relatively new development, a comprehensive review was detailed by analyzing the potential of connect- ing Building Information Modelling (BIM) and smart buildings with IoT -based data sources. In [13], several examples of IoT implementation (within the last ﬁve years) in residential and commercial buildings were reviewed. And in [14], a system was developed in an IoT lab system to monitor the ac tivities in the lab. The added value of this paper is to highlight IoT ecosystems as key elements in turning a building into a learning factory. And university buildings are especially suitable as experimental testbeds for current and future generations be cause of their heterogeneity, use variety (classrooms, oﬃces, labora- tories, study rooms, canteens, etc.), seasonality, high variability in occupancy and density, high energy demands, diversity of management systems, and other multiple factors. In this complex context, learning implies performance: learning by doing. Thus, this work proposes a methodology (from a real intervention in built environment through a de- signed, implemented, and deployed IoT ecosystem) as a learning factory in a continuous cycle for direct application in academic works, researching projects and institutional ini- tiatives, extendable to professional environments, tertiary buildings and smart cities, fo- cused on energy eﬃciency, IAQ and (building and human) behavior patterns. With regard to energy eﬃciency, in the current context in which climate change and environmental degradation pose serious global challeng es [15] [16], energy eﬃciency is essential to decarbonization and limiting, as set in the Paris Agreement in 2015, the in- crease in the global temperature to 1.5°C [17]. Some studies have examined the usefulness of continuous monitoring systems in improving the energy eﬃciency of bu ildings [18–20]. However, mos t such studies rely on BIM software models, unlike the methodology pro- posed in this paper, which is based on real building measurements. Other studies propose recognizing innovations in the energy eﬃciency and sustainability of existing buildings (as a Building Renovation Passport, BRP) but do not implement technological solutions to quantify their potential outcomes. This paper demonstrates how quantitative results can be obtained by the deployment and implementation of an entire IoT ecosystem. Batista e t al. [21] used an equipment control system to investigate the performance of the air condi- tioning system of a small auditorium in Brazil, achieving a 20% of energy consumption reduction and improving thermal comfort; but those outcomes are not correlate d with IAQ parameters such as CO 2 and occupancy. More recently, the occupancy of an oﬃce building was monitored with the objective of developing occupancy models and deter- mining their impact on the energy performance of the buil ding [22]; but the monitored spaces were not categorized according to their key characteristics, such as location, orien- tation, use, size, occupancy, etc. With regard to thermal comfort, Li et a l. [23] performed correlation analyses based on continuous thermal comfort measurements from four oﬃce buildings in Australia, supporting the use of continuous monitoring technologies for long - term thermal comfort evaluation. Furthermore, s everal key actions to improve building operation management have been shown to reduce energy deman d, such as rating tools and disclosure [24], energy audits [25], energy management systems [18], smart controls, and building passports [19]. The literature shows that buildings can be understood as complex systems and that there is a lack of publi shed research on quantitative analysis, such as this work, about interaction of building energy performance parameters interact-ing with factors such as weather, use patterns, occupancy variation, etc. With regard to IAQ, the World Health Organization (WHO) estimates that more than 100 diseases are associated with the eﬀects of unhealthy indoor environments. In this con- text, the United Nations (UN) has established various SDGs for 20 30 [20], paying special prePrint · Internet of Things (IoT) in buildings: a learning factory 4 of 24 attention to air quality [26] . According to the US EPA, IAQ refers to the air quality within and around buildings and structures, especially as it relates to the health and comfort of building occupants [5]. Good IAQ contributes to well -being, comfort, health, and produc- tivity in people. Some recomme ndations to improve IAQ include the following [27]: to choose building materials and furnishings with low pollutant emission rates (new build- ings or renovations), to reduce sources of pollutant emissions (stoves, clean ing products), purify the air (by pa rticle ﬁltration, removal of pollutant gases, and microbiological con- trol), and ventilate building interiors (which dilutes any type of pollutant through mixing with outside air). Although IAQ is not exclusively related to the CO 2 concentrat ion [28], some articles relate occupancy to CO 2 concentration and propose required air ventilation rates to keep the concentration below a set level [29–35]. The European Commission has analyzed the regulations on IAQ in countries and the existing varieties of venti lation sys- tems, concluding that there is still signiﬁcant progress to be made in IAQ measurement and quantitative analysis [36]. All these studies remark on the need for continuous moni- toring systems through IoT ecosystems that provide real measurements of building be- havior to improve IAQ in buildings. Moreover, given the relationship between energy eﬃciency and IAQ with people's behavior, as well as the building itself [37, 38], it is necessary to complement simulation studies with real quantitative measurements. In the last 20–30 years, notable advances have been made in building energy simulation, but much less progress has been made in terms of me asuring, analyzing, and learning about the real operation and performance of the buildings . Numerous s tudies [39–41] show that there is a large diﬀerence between theoretical values and real dat a on building environments, which has been called Building Performance Gap (BPG), especially in hetero geneous university buildings with high com- plexity and variable occupation. These diﬀerences are due to the numerous simplifying assumptions required to model and simulate the real behavior of buildings. Algorithms have been designed to reduce the BPG [42] . All this reveals that it is necessa ry to not only simulate buildings but also perform continuous IoT monitoring and data analysis to un- derstand how they behave under real operating conditions. In recent years, the integration of IoT technologies in bui ldings has emerged as a promising approach to enhance energy eﬃciency and indoor comfort [63][64]. However, buildings often face challenges in optimizing their HVAC systems as data can be dynamic and highly variable [65][66]. Nevertheless, IoT data a nalytics oﬀers a better opportunity to analyze such data and provide valuable insights for building management. Leveraging data-driven models such as Machine Learning (ML) and Deep Learning (DL) becomes es- sential for analyzing nonlinear relationships betw een buildings and occupants [67][68][69] . With numerous variables inﬂuencing indoor comfort and energy savings, predictive control methods like Model Predictive Control (MPC) can contribute signiﬁ-cantly to energy conservation eﬀorts [70][71][72]. Furthermore, in this technological context, in which buildings can be understood as complex dynamic processes, advances in MPC show promise for analyzing how variables such as occupancy, weather, climate, orientation, inﬁltration (air permeability), therma l inertia, and HVAC systems interact to improve energy eﬃciency and IAQ [43]. And, to continue developing MPC, it is key to have quality and structured data and therefore IoT ecosystems. In recent years, Recurrent Neural Network (RNN) modeling used to predict CO 2 and temperature has experienced signiﬁcant growth. In [44] , it was shown that a lin- ear regression model is not able to predict indoor environment indicators with high accu-racy, concluding that more complex models based on neural networks are needed. In [45], an RNN was used to predict CO 2 levels using 10 weeks of measurements with 75% of the data used to train the network and the remaining 25% used to test it. In [46] , a modelling and optimization approach was proposed to minimize energy consumption by develop- ing models to predict indoor environmental parameters (humidity, temperature, CO 2) and energy consumption in real time using neural networks and achieving very high reliabil-ity. prePrint · Internet of Things (IoT) in buildings: a learning factory 5 of 24 This paper aims two objectives. An objective is to under stand the built environment as a complex system in which IoT ecosystems are key to enabling technologies to move towards transversal strategies to improve energy eﬃciency and IAQ. Thus, this work pro- poses IoT as learning factory (from the Latin factorium , “place of doers, makers ”) where the data set is open and public for third- party use to contribute to the scientiﬁc community in its research eﬀorts (available from https://sensorizar.unizar.es) . Other objective is to under- stand IoT ecosystems as cost -eﬀective solutions that acquire data (from real measurements through connected sensors), analyze real -time information (to improve operations: maintenance, scheduling, etc.), and build knowledge (to make data -driven decisions). With these aims, in the cur rent context of the built environment (Building and IoT: reality and challenges section analyzes the main factors involved in the building reality) with economic restrictions, complexity, higher energy costs, social vulnerability and cli- mate change, this work proposes IoT -driven strategies as a novel and necessary contribu- tion due to its open, modular, interoperable, transversal and cost -eﬀective approach, as it is properly justiﬁed with the obtained outcomes in Results and Discussion section. The Ma- terial and Methods section details the functional scheme of the IoT ecosystem applied to built environment (as complex systems) focused on energy eﬃciency and IAQ. The Re- sults and Discussion section shows several results of experiments at building scale, fo- cused on CO 2 and energy consumption monitoring through real installations, to promote IoT as key to underst anding building complexity and proposing a proof -of-concept of prediction of CO 2 and temperature based on a neural network . Finally, the Conclusions section details the scientiﬁc contributions of the work from a critical point of view and proposes further research studies . 2. Building and IoT: reality and challenges The EU says in its “ Renovation wave for Europe ” strategy that a trend of renewal for Europe allows “greening our buildings, creating jobs, and improving our lives.” Its goal is to double the annual energy renewal rates in the next ten years. In 2014–2020, the EU allocated approximately €14 billion to improving the energy eﬃciency of buil dings [47]. In addition, member states <s: age, infrastructure, electriﬁcation, climatic and urban con- text, energy demand, diversity of stakeholders, and complexity. Age. The EU estimates that 75% of t he European building stock is ineﬃcient and more than 40 years old on aver age [48]. Buildings around the world (mostly in Europe), when they are appropriately designed, constructed, renovated, and maintained, are long - lasting structures capable of provide providing their occupants with suitable indoor con-ditions, protection from extremes of hot and cold temperatures, and low energy costs. As detailed i n Table 1 (from Eurostat [49]) , the average ages of buildings in Europ e are dis- tributed as follows: greater than 75 years (22.3%), 45–75 years (44.1%), 25–45 years (22.1%), and less than 25 years (9.8%). In Spain, there are approximately 10 million buildings (9,730,999 dwellings and 83,786 with other uses), with an average age of 37 years [49]. In addition, the percentage of new buildings (0.34%) is mi nimal compared to the total num- ber of buildings: at that rate, more than 300 years would be required to replace the entire building stock. Infrastructures . Although many buildings have some kind of system for regulating their indoor temperature, o nly a sma ll subset provides an entire HVAC system; within that subset, only a low percentage includes smart sensors, and only a minimum of that percentage integrates those sensors into IoT ecosystems. And these facts especially impact non-residential buildings (e.g., public institutions, government, services, etc.), mostly lo- cated in old monumental buildings that lack HVAC systems . From the HVAC systems engineering point of view, historic buildings that have not been aﬀected by recent mainte- nance work, whether ordi nary, extra ordinary, or preventive, are generally equipped with obsolete equipment. In many buildings, the thermal envelope is ineﬃcient. Existing heat- ing and air conditioning systems can be replaced but can be evidence of the past and, as prePrint · Internet of Things (IoT) in buildings: a learning factory 6 of 24 such, have his torical interest; therefore, they should be carefully recovered, valued, and, if possible, made useable. Table 1. Distribution of dwellings (% of all dwellings) by period of construction, (national averages and capital city regions). Source : Eurostat [49] Period of construction Before 1976 1946 -1980 1981 -2000 2001 -onwards Country Capital city region National Average Capital Region National Average Capital Region National Average Capital Region National Average Capital Region EU-28 22,3 − 44,1 − 22,1 − 9,8 − Belgium Arr.Bruxelles/Arr.van Brussel -Hoofdsta 37,1 51,7 38,2 37,0 16,5 7,1 8,2 4,1 Bulgaria Sofia (stolitsa) 10,5 5,6 55,4 45,8 25,5 3,2 8,6 15,4 Czech Republic Hlavní město Praha 19,0 29,4 37,1 30,4 20,5 20,7 7,7 7,4 Denmark Byen Københavr 34,1 68,1 44,6 21,8 14,0 5,7 7,2 4,4 Germany Berlin 24,3 42,3 46,5 36,3 23,1 19,2 6,1 2,1 Estonia(1) Põhja -Eesti 17,0 12,0 47,1 47,3 22,8 23,2 9,4 15,2 Ireland Dublin 13,0 13,9 22,9 30,8 20,7 20,2 22,0 18,0 Greece Attik 7,6 2,4 47,8 55,1 29,1 27,1 15,5 15,3 Spain Madrid Madrid 11,1 8,0 43,0 50,3 24,7 24,2 18,5 14,9 France Paris 28,7 59,7 37,0 26,0 23,9 11,7 10,4 2,5 Grad Zagreb Croatia 13,6 13,7 42,5 43,3 23,6 22,3 11,0 17,0 Italy Roma 20,7 12,3 51,4 60,1 19,8 20,4 7,9 7,1 Cyprus Kýpros 3,0 − 24,6 − 36,1 − 34,1 − Latvia Riga 22,7 23,5 46,6 48,4 24,3 21,7 5,1 6,1 Lithuania Vilniaus apskritis 13,6 12,7 49,6 43,3 28,9 30,2 6,2 12,6 Luxembourg Luxembourg 21,8 − 31,5 − 21,6 − 14,0 − Hungary Budapest 20,3 33,2 48,3 38,0 21,7 17,3 9,7 11,6 Malta Malta 13,0 13,5 23,2 24,3 23,4 24,1 8,7 9,1 Netherlands Groot -Amsterdam 18,9 32,7 41,9 29,7 26,4 25,0 9,5 10,1 Austria (2) Wien 25,5 42,4 40,1 35,4 22,7 14,6 11,7 7,6 Poland Miasto Warszawa 19,1 10,3 43,0 49,1 22,7 16,1 11,4 17,8 Portugal Grande Lisboal 10,7 9,8 37,1 46,0 36,0 31,4 16,3 12,8 Romania Bucureşti 11,2 7,7 59,1 60,3 19,0 23,3 8,0 5,5 Slovenia Osrednjeslovenska 21,3 16,6 45,0 47,9 25,0 23,7 8,7 11,8 Slovakia Bratislavský kraj 8,2 8,7 52,6 48,0 21,5 23,5 5,8 11,3 Finland Helsinki -Uusimaa 9,6 12,1 48,7 44,3 29,7 29,8 10,7 12,8 Sweden Stockholms lan 24,3 23,8 47,7 44,1 12,3 12,4 4,6 6,8 United Kingdom (3) Inner London (4) 37,8 57,7 39,7 26,6 15,6 10,4 6,9 5,3 Iceland Hofuôborgarsvæði 11,5 10,3 44,5 42,9 25,1 27,1 18,9 19,6 Liechtenstein Liechtensteir 9,7 − 38,0 − 33,1 − 16,0 − Norway Oslo 16,8 31,0 41,3 38,7 23,2 20,0 12,7 10,0 Switzerland Bern 26,6 32,3 41,1 41,2 21,5 18,3 10,8 8,2 (1) Also comprises dwellings in uncompleted buildings, in those case where a residential building under construction (2) Before 1945 instead of before 1946. 1945- 1980 instead of 1946- 1980 (3) Low reliability (4) Average of Inner London - West (NUTS UKI11) and of Inner London - East (UKI12) IoT technologies . Among all the techni cal characteristics of IoT technologies, in the context of this study, it is important to highlight three key features. The cost is minimal compared to the economic costs of any action at building scale. IoT wireless technologies oﬀer very high capabiliti es with a very low number of sensors, with lifetimes of years (even for photovoltaic batteries), without the need for wiring (neither for power nor for communications), and without impact in the infrastructures (by putting sensors on walls, windows or ceil ings). IoT ecosystems require highly qualiﬁed technical staﬀ, continuous management (for calibration and monitoring), managers with digitalization training, and analysts with data -driven vision to obtain operational conclusions. On the other hand, IoT technologies are already mature: once deployed, they require very little maintenance and return real -time data, that represent building performance well. Electriﬁcation . The climate emergency and dependence on fossil fuels have pro- moted policies to replace boilers in buildings with heat pumps. Following EPBD , the Eu- ropean Commission proposes that all newly buildings do not produce emissions from 2028 onward, as well as the elimination of fossil fuels from 2035 onward, with replacement by heat pump systems based on electricity or hydrogen (blended with natural gas or prePrint · Internet of Things (IoT) in buildings: a learning factory 7 of 24 waste), although some reports rule this out as being feasible on a large sca le [50,51] . Thus, continuous monitoring provided by IoT ecosystems appears to be the best option for HVAC systems (based on electrical energy) to adjust their regulation to the environment, consumption, behavior, and renewable energies. In addition, building systems whose op-eration is electrical are easier to regulate (than systems based on combustion) and allow adjustments with respect to energy demand both at the buildin g scale and at the city scale. The increasing adoption of HVAC systems and the rising demand for thermal comfort, coupled with the imperative to reduce emissions, has positioned it as a primary driver of global electricity demand growth [62]. Climatic and urban context. The cur rent climatic and energy context involves se- quenced boundary conditions: ( 1) extreme temperatures will involve extreme climate events (2) that will increase the demand for air conditioning and heating equipment (3) that will produce an increase in energy demand (4) in an aged built environment where majority of which is energy ineﬃcient (5) without a monitoring or management system. Furthermore, urban trends suggest that, i n 2030, 50.9% of Europeans will live in cities, 26.9% in tow ns and semi -dense areas, and only 20.6% in rural areas [52]. The combination of an aging population and highly urbanized ecosystems means that the population is becoming more vulnerable to heat and that demand for cooling in buildings is rising quickly. All of these concerns require intervention in buildings to examine key elements of sustainable cooling policies and their potential impacts on vulnerable groups by reduc- ing health risks, inequalities, and summer energy poverty. In the EU in 2022, compared with 1979, the need for heating a given building was approximat ely 20% lower, and the need to cool a given building was almost four times higher [53]. In the summer of 2022, with successive long heatwaves and high energy prices, heat stress created a sense of ur- gency about acquiring air conditioning devices. However , there is a gap between knowledge about overheating in buildings and the percentage of EU citizens unable to keep their homes comfortably cool during the summer. This growth in demand for ther-mal comfort and healthy environments with good IAQ creates a gr owth in energy de- mand, despite the current situation of economic restrictions, high energy costs, emissions consequences, and climatic, social, and environmental impacts [54]. Thus, IoT ecosystems, as proposed in this paper, provide transversal strategies for addressing this complex con- text and choosing customized solutions for each speciﬁc situation. Energy demand and IAQ . The growth in the need for thermal comfort and better IAQ implies increased energy demand. Environmental change is estimated to be respon- sible for an increase of 212% in energy use for cooling residential buildings between 2010 and 2019 [55]. The majority of European buildings lack air conditioning and ventilation systems, and only recently have buildings been designed in accordanc e with ene rgy cri- teria [48]. Therefore, various actions are necessary, such as: renovation of building enve- lopes, installation of photovoltaic panels, improvement of HVAC systems, promotion of passive strategies, eﬃcient air conditioning systems, insta llation of ventilation systems, urban revegetation policies (to avoid heat island eﬀects and extreme temperatures), access to renewable energy, and living in greener environments with lower traﬃc densities, among others. However, all these strategies ca rry high economic costs, are diﬃcult to pro- vide to vulnerable groups, and imply social inequities and energy poverty. Thus, IoT - based strategies, as proposed in this paper, means a cost -eﬀective contribution, technically feasible, and socially accessibl e, especially for public buildings and urban areas occupied by vulnerable group s. Diversity of stakeholders . Buildings are interconnected at various scales and levels (see Table 2): space (local), building (community), neighborhood (intra -local), city (local), region (intra -national), country (national), and zone (international). Thus, the widespread implementation of IoT transversal strategies at all scales is key to understanding building behavior in relation to human behavior by obtaining accurate information to make data - driven decisions at diﬀerent levels: prePrint · Internet of Things (IoT) in buildings: a learning factory 8 of 24 • For users, IoT enhances HVAC systems with low cost, time and impact. • For architects, IoT improves knowledge about the real behavior of buildings and us- ers (overcoming the gap between theoretical values and real data) for use in evidence - based architectural design. • For engineers, IoT facilitates the study of the most suitable energy system for each building according to its location, orientation, design, typology of spaces, uses, etc. • For urbanis ts, extrapolated to the urban scale and combined with Geographical In- formation System (GIS), IoT provides general strategies by zones. • For geographers, overcoming the urban scale, IoT learns social behaviors, patterns, trends, etc. • For epidemiologists and doctors, IoT makes it possible to correlate the spread of cer- tain diseases with IAQ and environmental parameters and trends. • For local, national, and international institutions, IoT provides data on behavior pat-terns for use in developing and implementing strategies for rehabilitation, energy management, etc., for energy, electricity, CO 2, etc. Table 2. Scaling the built environment and its types of users to understand IoT as learning factory. Source: own; from several studies, such as [1], [2], and [7], among others. Scale (level) Stakeholders Services for users IoT functionalities Space (personal) User Knowledge of environmental parameters (IAQ, temperature, humidity, occupancy) of specific spaces based on their activities, habits, and p