 byte state = STATE_INITIAL;
 
 //analog pin assignments
-const byte tempSensorPin = 0;
 const byte tempPotPin    = 0;
 const byte humPotPin     = 1;
 


  servo1.attach(servo1Pin); // Attaches the servo on pin 14 to the servo1 object
  servo1.write(180);  // Put servo1 at home position
  delay(1000);
  servo1.detach();

  // Open serial communications and wait for port to open:

        }
    }
    else{
      Serial.println("send data failed!");
    }
  }else{
    Serial.println("D'OH! Conn. fail!");
    setupWifi();
  }
  //esp seems wery slow at times, so just in case...
  delay(500);
}

char *get_temp_warn()
{
  if (tempSensorValue <=5) return "WARN!";
  if (tempSensorValue < 15 && tempSensorValue >5) return "cold";
  if (tempSensorValue < 20 && tempSensorValue >14) return "chilly";
  if (tempSensorValue < 31 && tempSensorValue >19) return "OK";
  if (tempSensorValue > 30) return "HOT!";
  return "";
}

void homepage(uint8_t ch_id) {
  //create dynamic content first, so that we get the length.
  String tempstr = "<p>Temperature:";
  tempstr += tempSensorValue;
  tempstr += "&deg;C ";
  tempstr += get_temp_warn();
  tempstr += "</br>min:";
  tempstr += minC;
  tempstr += " max:";
  tempstr += maxC;
  tempstr += " ";
  tempstr += "</p>\r\n";
  String humstr = "<p>Hum:";
  humstr += humSensorValue;
  humstr += "&#37;</p>\r\n";
  String windowstr = "<p><b>Window is ";
  windowstr += ((hatchOpen)?"Open</b></p>\r\n":"Closed</b></p>\r\n");
  //count dynamic lengts together and Set Content Len in header
  String hdrContLen = "Content-Length: ";
  hdrContLen += String((tempstr.length() +
