Help me understand boolean

No problem, just me in a playful mood.

Marmotjr: if (lighton) {     // do this } if (lightoff)  {   // do this }

For a single element like this that can only have two states, why even bother with two boolean variables? It only seems to add complexity and confusion.

The only reason, as I see it, for using boolean type variables is to make the code more readable and reduce the need for comments. So it can seem very attractive to be able to code "if (lighton)" where you need to do something when the light is on and "if (lightoff)" where you need to do something if the light is off. The danger is that, as I demonstrated, very easy to arrive at the point where you have written code that can result in both being true or both being false. I seems far better to me to use enumerated types and '==' in the code, just as readable and convenient, but without danger mentioned. For the project of the OP

enum state_of_heating {toolow,OK,toohigh};
enum state_of_heating temperature;

could also be of benefit

enum state_of_heating {toolow,OK,toohigh};
enum state_of_heating temperature;
void setup() {
 }
void loop() {
switch (temperature){
   case toohigh :
        //turn off heating
        break;
   case toolow :
        //turn on heating
        break;
   case OK:
        // check outside temperature, falling/rising
        break;
}
}

neither the boolean nor the enumerated types allow you to do

Serial.println(lights);
Serial.println(temperature);

and expect to see 'on' or 'OK' . In the example quoted temperature takes on the value of 0, 1 or 2 in the order enumerated. It is perfectly possible to override these defaults by coding, for example

enum state_of_heating {toolow = -1, OK = 0, toohigh =1};

so don't get too carried away with boolean, sometimes enum will serve you better. Dave