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¶
- Last person presses the shutdown button inside the space
- ESP32 detects button press, starts 120-second countdown
- LED flashes, buzzer beeps periodically (every 10 seconds)
- Person gathers belongings and heads to the exit
- Countdown reaches zero
- ESP32 sends LOCK command to NUKI via BLE
- Solid green LED + long confirmation beep
- Person exits through the door (mechanical exit always possible)
- Shutdown event logged:
{"event": "locked_by_button", "timestamp": ...}
Alternative Flows¶
A1: Countdown cancelled¶
- At any point during the countdown, someone presses the button again
- Countdown cancels, LED stops flashing
- Short buzzer pattern confirms cancellation
- Space remains open
A2: Someone scans card during countdown¶
- During countdown, a member scans their NFC card from outside
- Normal access evaluation proceeds — access granted if authorized
- Door unlocks, countdown is cancelled
- Shutdown must be re-initiated if still desired
Error Flows¶
E1: NUKI BLE connection fails¶
- At step 6, BLE command to NUKI fails
- ESP32 retries up to 3 times
- If still failing: red LED + error buzzer, shutdown event logged with error
- 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_MSin 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.