In a device for generating electrical energy comprising at least a first thermoelectric generator (20) arranged between a surface (12) subjected to thermal exposure and a container (16) containing a phase change material (14), the container (16) is surrounded by at least one heat conducting element (22) which is thermoconductively connected to said surface (12) and which is thermo-conductively connected to the circumference of said container (16) through plural thermoelectric generators. Thus, the overall efficiency of the device is increased by avoiding waste heat and by increasing the contact area of the thermoelectric generators (20) with the phase change material (14).