Termostat problems

Thanks for the picture and code.
Your connections look okay to me.
But in your code you mix analog with digital.

pinMode(1) sets the digital pin '1'. That's mixing digital with analog.
For an analog input, using analogRead(), you don't need to set it with pinMode().
The led is the only digital output, so use pinMode() only for the led.
Remove the two other pinMode() and see what it does.