The optimization model is based on a Mixed Integer Linear Program (MILP) and includes different kinds of small-scale cogenerators, geothermal heat pumps, boilers, heat storages, solar thermal and photovoltaic panels. In addition, absorption machines, supplied with cogenerated heat, can be used instead of conventional electrical chiller to face the cooling demand. The aim of the analysis is to address the question if advanced demand strategies and supply strategies have to be regarded as alternatives, or if they have to be simultaneously applied, in order to obtain the maximum energy and economic benefit.