Heating or cooling of the substrates