Easily adaptable indoor temperature and heat demand models were applied in the predictive optimization of the heat demand at the city level to improve energy efficiency in heating. Real measured district heating data from 201 large buildings, including apartment buildings, schools and commercial, public, and office buildings, was utilized. Indoor temperature and heat demand of all 201 individual buildings were modelled and the models were applied in the optimization utilizing two different optimization strategies. Results demonstrate that the applied modelling approach enables the utilization of buildings as short-term heat storages in the optimization of the heat demand leading to significant improvements in energy efficiency both at the city level and in individual buildings.