Skip to content

UC-008: Space Shutdown (Shutdown Button)

Actor: Any person inside the space (typically the last keyholder) Priority: Must Status: Implemented (protocol definition)

Summary

The last person leaving the space presses the physical shutdown button inside to initiate space shutdown — securing the door via NUKI without needing to scan an NFC card from outside.

Preconditions

  • Shutdown button is wired to ESP32 GPIO 33 (active LOW, internal pull-up)
  • NUKI Smart Lock is reachable via BLE
  • At least one person is still inside the space

Main Flow

  1. Last person presses the shutdown button inside the space
  2. ESP32 detects button press, starts 120-second countdown
  3. LED flashes, buzzer beeps periodically (every 10 seconds)
  4. Person gathers belongings and heads to the exit
  5. Countdown reaches zero
  6. ESP32 sends LOCK command to NUKI via BLE
  7. Solid green LED + long confirmation beep
  8. Person exits through the door (mechanical exit always possible)
  9. Shutdown event logged: {"event": "locked_by_button", "timestamp": ...}

Alternative Flows

A1: Countdown cancelled

  1. At any point during the countdown, someone presses the button again
  2. Countdown cancels, LED stops flashing
  3. Short buzzer pattern confirms cancellation
  4. Space remains open

A2: Someone scans card during countdown

  1. During countdown, a member scans their NFC card from outside
  2. Normal access evaluation proceeds — access granted if authorized
  3. Door unlocks, countdown is cancelled
  4. Shutdown must be re-initiated if still desired

Error Flows

E1: NUKI BLE connection fails

  1. At step 6, BLE command to NUKI fails
  2. ESP32 retries up to 3 times
  3. If still failing: red LED + error buzzer, shutdown event logged with error
  4. Space may remain unsecured — admin notification queued

Postconditions

  • Door is locked via NUKI (space is closed)
  • Shutdown event logged for audit trail

Access Rule

  • Not tied to a specific NFC card or access type
  • Any person physically inside can use the button

Notes

  • The 120-second countdown is configurable via LOCKUP_COUNTDOWN_MS in config.h.
  • The countdown gives people time to exit before the door locks.
  • This is important for the hackerspace's "last person out shuts down the space" culture — no need to have your NFC card accessible from outside after stepping out.
  • Mechanical exit is always possible regardless of NUKI lock state (fire safety requirement).
  • A door being locked (auto-relock after each entry) is routine and does not mean the space is closed. Space shutdown is the deliberate act of closing the space entirely. See terms.md.