A device (20) for generating energy on the basis of sunlight, which is destined to be applied in a building such as a greenhouse (1), comprises a number of elongated spectral reflectors (21) extending alongside each other like lamellae, which have spectral selective characteristics, wherein the reflectors (21) are capable of allowing visible light to pass and reflecting heat radiation. Furthermore, the device (20) comprises a single absorber (22) for receiving the heat radiation reflected by the spectral reflectors (21). A surface (23) of the spectral reflectors (21) which is destined to face the absorber (22) has a concave shape, as seen along the width of the reflectors (21), in order to achieve good focus of the reflected heat radiation, so that the absorber (22) can be as small as possible, whereby costs are saved. The absorber (22) may be equipped with any suitable circuit of solar cell modules.