Measuring and manipulating the temperature of cold molecules trapped on a chip