System for supplying energy to a building with a roof, such as a green house. The system has a thermal energy storage system (20) for providing heat and/or cooling to the building, with a heat storage well (21) and a cold storage well (22), and a thermal energy pump system for pumping a thermal energy system fluid into or from the heat storage well (21) and/or cold storage well (22). A solar energy collector system (8) is part of the system and is based on circulation of a heat transfer fluid having at least one solar collector unit (3), which during operation is exposed to solar radiation and arranged to transform the solar radiation to thermal energy in the heat transfer fluid. The solar energy collector system (8) is integrated with the thermal energy storage system (20).