Thermoelectric coolers (TEC or Peltier) create a temperature differential on each side. One side gets hot and the other side gets cool. Therefore, they can be used either to cool or warm something, depending on which side is used. You can also use temperature differential to generate electricity.
A thermoelectric cooling (TEC) module is a semiconductor-based on electronic component that functions as a small heat pump. By applying DC power source to a TEC, heat will be transferred from one side of the module to the other. It creates a cold and hot side. They are widely used in industrial areas, for example, computer CPU, CCDs, portable refrigerators, medical instruments and so on.
When exposed to different temperatures on both sides it will also work as a generator and generate electricity depending on the temperature difference.