In the context of so-called smart grids, buildings are expected to integrate in a cooperative manner and to expose their currently unused flexibility of operations (shiftable loads, load shedding, duty-cycling, etc.), supported by building automation and information technology. Building optimization and grid optimization, typically decoupled in existing solutions, shall be harmonized.