 
 void SecRelais1(char mode){
   /*
-   * Relais 1 with state check
+   * Relais 1 with state check (DOWN)
    */
   if (mode == "ON") {
     if (S1State == false && S2State == false) {
       S1State=true;
+      //liftdown=true;
+      //liftup=false;
       digitalWrite(S1, LOW);
-    } else if (S1State == false && S2State == false) {
+    } else if (S1State == false && S2State == true) {
       digitalWrite(S2, HIGH);
       S2State=false;
+      //liftup=false;
       delay(80);
       S1State=true;
+      //liftdown=true;
       digitalWrite(S1, LOW);
     } else if (S1State == true && S2State == false) {
       // do nothing

  //Serial.print("Code = ");
  //Serial.println(receivedCode);

  if (receivedCode == 531272){
    task2 = millis();
    //Serial.println("Switch Relais 1 ON");
    SWRelais("ON");
    SecRelais1("ON");
  
  } else if (receivedCode == 531380){
    //Serial.println("Switch Relais 2 ON");
    task2 = millis();
    SWRelais("ON");
    SecRelais2("ON");
  
  } else if ( receivedCode == 531276 || receivedCode == 531436 || receivedCode == 531384){
    //Serial.println("Switch Relais 1 and 2 OFF");
    SecRelais2("OFF");
    SecRelais1("OFF");
  }
  
}

void loop() {
  unsigned long currmillis = millis();
  
  if ((unsigned long)(currmillis - task2) >= worktime) {
    if ( S1State == true || S2State == true ) {
      //Serial.println("Switch Relais after worktime OFF");
      SecRelais1("OFF");
      SecRelais2("OFF");
    }
  }

  // schalte das Relais nach eingestellter Zeit aus
  if ((unsigned long)(currmillis - task2) >= relaistime) {
    if (ROState == true) {

 * GND = GND
 * PB1 = Transistor (PNP)
 * PB2 = DATA (433Mhz Empfänger)
 * PB3 = Relais 1 (AB)
 * PB4 = Relais 2 (AUF)
 * 
 * Info:
 * Falls ein anderer Arduino Controller verwendet wird, muss man die Pins anpassen.
