Buildings are currently non optimally controlled, using a weather compensation controller that depends only on external temperature. A rich amount of real-time data is available and can be used for better control. This work is focused on developing a general and dynamic model for utilizing the building as an energy storage for a peak-shaving control strategy.A dynamic grey-box model is developed using industry standard operators’ data from a multifamily building, Building A, located in Västerås, Sweden. The training period is set to 408 hours, and the prediction horizon to 48 hours. The model is verified in 4 steps: prediction ability on the historic data, parametric verification on the time constant, simulation of heat supply separated from the historic data and model generality by implementing the model on a second multifamily building, Building B. The modelling errors over a two-month simulated period are 8% for Building A and 9% for Building B. To demonstrate the utilization possibilities, an optimizer is constructed to evaluate a peak shaving control strategy. Different flexibilities for the indoor temperature have been examined yielding heat load peak shaving between 30 to 45%. Flexibility paves the way for improvement in pricing models for the heating sector. This work demonstrates the potential for utilizing building heat storage capacity to reduce peak consumption and costs.