 Serial.print(F(", ledMoveInterval: "));
 Serial.println(ledMoveInterval);
 
+      }
+      break;
+
+    case doorBlockedPir:
+      if (pirTrigger == LOW) {
+
+// hold the door open if button pressed
+// TODO: another possibility would be to fall-through to doorBlocked
+// and close the door instead. which way is better?
+if (swTrigger == LOW) {
+  motorFree();
+  debug(currentMillis, F("Button switch triggered - door blocked\r\n"));
+  setLeds1(red, ledSolid);
+  doorState = doorBlocked;
+  swTrigger = HIGH;
+  break;
+}
+
+        if (swBack == LOW) {
+          debug(currentMillis, F("IR sensor LOW - door open\r\n"));
+          openMillis = 0;
+          setLeds1(green, ledBlink);
+          doorState = doorOpen;
+        } else {
+          debug(currentMillis, F("IR sensor LOW - door blocked\r\n"));
+          setLeds1(red, ledSolid);
+          doorState = doorBlocked;
+        }
       }
       break;
 

    debounce(switchTrigger, &swTrigger, &swTriggerDeglitch, &swTriggerDebounce);
    debounce(switchFront, &swFront, &swFrontDeglitch, &swFrontDebounce);
    debounce(switchBack, &swBack, &swBackDeglitch, &swBackDebounce);
  }



        break;
      }

if (pirTrigger == HIGH) {
  debug(currentMillis, F("Motion sensor triggered - door blocked by PIR\r\n"));
  setLeds1(yellow, ledBlink);
  doorState = doorBlockedPir;
  break;
}

      openMillis += elapsedMillis;
      if (openMillis >= openInterval || swBack == HIGH) {
        if (swBack == HIGH) {
