 
   // event Timer
   int TempCEvent      = t.every(2000, doUpdateTempC);
-  int TempCArrayEvent = t.every(4000, doUpdateTempCArray);
-  /*
   int updateTempCArrayEvent = t.every(300000, doUpdateTempCArray);
-  */
-
-}
-
+
+}
+
+
+// PIR
+void remove_poweron_error()
+{
+  detachInterrupt(0);
+  attachInterrupt(0, PIRCHECKING, CHANGE);
+}
 
 void loop()
 {

    return;
  } else {

    pirOnOff = !digitalRead(PIR_IN_PIN);
    Serial.println("PIR rising called");
    pir_Mills = millis();
  }
}


void tvOnTimer()
{
  t.stop(tvIsOffEvent);
  tvIsOnEvent = t.every(3000000, doTvOffTimer);
}

void tvOffTimer()
{
  t.stop(tvIsOnEvent);
  tvIsOffEvent = t.every(600000, doTvOnTimer);
}

void doTvOffTimer()

    } else {
      switch (onoff) {
        case 1:
          if ( tvPowerStatus == 0 || bywhat == 1 )
          {
            irsend.sendNEC(tv_input, 32);
            delay(3000);
