     o_r = r;
   }
 
-
-  if ( pirOnOff != o_pirOnOff ) {
-    if (pirOnOff == 1) {
-      Serial.println("PIR rising called");
-      o_pirOnOff = pirOnOff;
-      lcd.setCursor(15, 0);
-      lcd.write(6);
-      turn_onoff_tv(1);
-      delay(100);
-    } else {
-      Serial.println("PIR timer called");
-      o_pirOnOff = pirOnOff;
-      lcd.setCursor(15, 0);
-      lcd.print(" ");
-      if ( timerOnOff == 1) {
-        turn_onoff_tv(0);
-      }
-      delay(100);
-    }
-  }
-  delay(100);
+  delay(500);
 }
 
 void displaytimeleft(float a) {

    irrecv.enableIRIn();
  } else {
    Serial.println("IRSend CH change called");
    if ( a == 1) {
      irsend.sendNEC(tv_input, 32);
      delay(3000);
      for ( int i = 0 ; i < o_channelGap ; i++ ) {


// timer
long startMills;
long tv_onoff_Mills;
long tempMills;
long o_tempMills;

// temp
int o_tempminpassed = 0;
