The project aims to develop an optimization tool for the design of an energy system for a given building with given boundary conditions (building geometry, building standard, climatic conditions, occupancy) and an algorithm for optimal control of the indoor environment in an nZEB building with renewable sources implemented in the controller . The project focuses on two different types of systems for nZEB. On the one hand, there are buildings with purely electric heating (direct heating radiant panels) in combination with battery storage and a PV system, on the other hand they are buildings with hot water systems connected to heat pumps (heating, cooling) associated with heat storage.