The prime goal in automation systems is to increase productivity while at the same time save production costs. Nevertheless, in recent years there is increasing concern about the ecological footprint of production systems and a growing demand for energy optimization. Heating, ventilating and air conditioning (HVAC) systems in large industrial buildings consume a substantial amount of energy and typically run independently of the actual production processes. Integrating the two systems, however, can be beneficial in terms of overall energy optimization. This paper proposes a modular modelling of the building thermal load with the aim of connecting this model with the typical architecture of Manufacturing Execution Systems (MES). As the building automation system is distributed, the idea is to bind it with a set of generic cells that encapsulate a thermal model of the physical surrounding as well. With this approach the cell thermal load behaviour can be predicted for energy optimization. To allow implementation on the existing embedded devices and controllers with limited computational resources, a reduced complexity model is developed. As the model is to be used for model predictive control (MPC), also the first steps towards the development of the control algorithm are introduced and the benefits compared to traditional approaches are shown.