A Sensor-to-API Data Infrastructure for Building Digital Twins: Harmonizing Multi-Rate IoT Energy and Indoor Data Streams for Proactive Analytics
Keywords: Digital Twin, Smart Buildings, Energy Forecasting, Machine Learning, IoT Sensors, 3D GIS
Abstract. Digital twins are increasingly used in smart buildings to monitor energy use. This requires reliable sensor data, geospatial information, and semantically rich 3D building geometry. However, building sensor data often has inconsistent sampling, missing timestamps, extreme spikes, and restricted access, hindering reproducibility and integration with spatial and 3D building models. This paper presents a sensor-to-API data infrastructure that prepares heterogeneous building sensor data for integration into a digital twin platform implemented at the GATE Institute. Circuit-level electricity data was replicated from the institutional PostgreSQL database into the researcher’s database environment. Data harmonisation took place, with data aligned to a strict 5-minute grid, and forward filling was used to address missing timestamps. The extreme peaks were also addressed through percentile-based clipping to improve data quality for machine learning forecasting. A RESTful API was then implemented using PostgREST, exposing the sensor database tables as endpoints and enabling secure access from visualisation dashboards. By linking time-series observations to rooms, floors, circuits and 3D building components, the infrastructure enabled spatially explicit interpretation of building performance. This geospatial linkage allowed analysis of energy and indoor behaviour by location, enabling room-level comparisons and facility management beyond dashboard monitoring. The result was a consistent and interoperable time-series data infrastructure that supports smart-building digital-twin applications. In combination with 3D building data, this forms a stronger basis for advanced applications such as real-time monitoring, spatially explicit visualisation, scenario simulation, analytics, and predictive modelling in smart buildings.
