   } else {
      digitalWrite(RelayPin,LOW);
   }
+  
 }
 
 

   }
   if (Bridge.get("state", tempSetBuf, 8) > 0) {
     String setState = String(tempSetBuf);
     Console.println(setState);
     if (setState.equals("on")){
       //turn the PID on
       myPID.SetMode(AUTOMATIC);
       windowStartTime = millis();
       opState = RUN; 
     }  else {
       myPID.SetMode(MANUAL);
       digitalWrite(RelayPin, LOW);
       opState = OFF;

   
   switch (opState) {
     case OFF:
       Bridge.put("cState", "off");
       Console.println("OFF");
       break;
     case SETP:
       Bridge.put("cState", "learn");
       Console.println("LEARN");
       break;
     case RUN:
       Bridge.put("cState", "on");
       Console.println("ON");
       DoControl();
       break;
