Energy efficiency in building sector is attracting an increasing interest in the scientific community, due to its strong impact in terms of greenhouse gas emissions. In this context, the REMOURBAN H2020 project has carried out a pilot deep refurbishing work on a small cluster of 10 homes, implementing energy saving measures and a hybrid energy-supply system to satisfy the heating and domestic hot water demand. The system aims to achieve near-zero-energy homes level of performance at reasonable cost by offsetting the energy consumption with local energy microgeneration. It is designed as a local low temperature district heating system and includes ground source heat pumps, photovoltaic panels, electric and thermal energy storage devices. The management of the complex hybrid system requires a suitable control strategy to optimise the energy consumption and consequently running cost. With this purpose a co-simulation tool has been developed, coupling a model of the energy system built using Dymola-Modelica and the EnergyPlus model of the buildings. This allows to develop different control strategies aiming to reduce the energy consumption from the grid, maximize the self-consumption of photovoltaic energy and ultimately move away from fossil fuel to sustainable energy resources.