An arrangement and a method in connection with a solar energy system. The arrangement comprises solar panels (1) and a converter (2) for converting the DC voltage from the solar panels, which converter is arranged inside a container or a similar closed structure. The arrangement also comprises means for producing heat (4) from the energy produced by the solar panels, which means are arranged inside the container or a similar closed structure and to be electrically connectable to the solar panels.