Add passive presence daemon — multi-signal WiFi/ARP/DHCP/BLE with exponential decay
Implements DevTrack #530: Person Presence Intelligence daemon for BigBrother drop implant. Core components: - presence_daemon.py: 4 sensor threads (probe, ARP, DHCP, BLE) with exponential decay - presence_schema.sql: SQLite schema for persons, devices, signals, occupancy log - install.sh: Deployment script (copies to /opt/sensor/, creates systemd service) - AUDIT_impl.md: Implementation notes, limitations, audit checklist Features: - Exponential decay model (lambda=0.08/min) for signal certainty - Presence anchor (45-min hold time prevents false VACANT) - Person state machine: UNKNOWN → PRESENT ↔ ABSENT - Multi-signal fusion: max + 0.08×min for device aggregate - Thread-safe in-memory state with SQLite persistence - Matrix webhook alerting (if configured) - HTTP status endpoint on 127.0.0.1:9191 - Graceful BLE degrade if bleak unavailable - No tool fingerprints in output or service names
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
CREATE TABLE IF NOT EXISTS persons (
|
||||
id INTEGER PRIMARY KEY,
|
||||
name TEXT NOT NULL,
|
||||
notes TEXT
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS devices (
|
||||
mac TEXT PRIMARY KEY,
|
||||
person_id INTEGER REFERENCES persons(id),
|
||||
label TEXT,
|
||||
added_at REAL DEFAULT (unixepoch())
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS signals (
|
||||
id INTEGER PRIMARY KEY,
|
||||
mac TEXT NOT NULL,
|
||||
signal_type TEXT NOT NULL,
|
||||
certainty REAL NOT NULL,
|
||||
ts REAL DEFAULT (unixepoch())
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS occupancy_log (
|
||||
id INTEGER PRIMARY KEY,
|
||||
person_id INTEGER REFERENCES persons(id),
|
||||
old_status TEXT,
|
||||
new_status TEXT NOT NULL,
|
||||
ts REAL DEFAULT (unixepoch())
|
||||
);
|
||||
|
||||
CREATE INDEX IF NOT EXISTS idx_signals_mac ON signals(mac);
|
||||
CREATE INDEX IF NOT EXISTS idx_signals_ts ON signals(ts);
|
||||
CREATE INDEX IF NOT EXISTS idx_occupancy_person ON occupancy_log(person_id);
|
||||
CREATE INDEX IF NOT EXISTS idx_devices_person ON devices(person_id);
|
||||
Reference in New Issue
Block a user