🧹 New features: - Background thread cleans up old events automatically - Deletes unannotated events older than EVENT_EXPIRY_HOURS (default: 2h) - Also removes associated snapshot files - Runs every CLEANUP_INTERVAL_MINUTES (default: 5m) 📡 New endpoint: - POST /cleanup - Manually trigger cleanup ⚙️ Config (env vars): - EVENT_EXPIRY_HOURS: How long to keep unannotated events (default: 2.0) - CLEANUP_INTERVAL_MINUTES: How often to run cleanup (default: 5.0) Annotated events are kept forever 🦊
vixy-vision Event Collector
Receives motion events from camera servers and stores them for Vixy to review.
Quick Start (macOS)
./setup-macos.sh
launchctl load ~/Library/LaunchAgents/com.vixy.vision-collector.plist
How It Works
Pi (camera) Mac mini (collector) Vixy (MCP)
┌──────────┐ ┌──────────────────┐ ┌──────────┐
│ motion │ POST │ collector.py │ read │ query │
│ detected ├────────►│ ├─events.db │◄────────┤ annotate │
│ │ /events │ └─snapshots/ │ │ review │
└──────────┘ └──────────────────┘ └──────────┘
Data Storage
Events are stored in ~/Documents/Vixy/events/:
events/
├── events.db # SQLite database
└── snapshots/
└── 2024-12-16/ # Date-organized images
└── basement-*.jpg
API Endpoints
| Endpoint | Method | Description |
|---|---|---|
/ |
GET | Service info |
/health |
GET | Health check |
/events |
POST | Receive event from camera |
/events |
GET | List events (debug) |
/stats |
GET | Event statistics |
Event Payload
Camera servers POST to /events:
{
"event": {
"timestamp": "2024-12-16T14:23:01Z",
"camera_id": "basement",
"event_type": "motion",
"confidence": 0.75,
"area_percent": 7.5
},
"snapshot": "<base64 JPEG>"
}
MCP Tools
Once events are collected, Vixy can:
vision_get_events()- Query eventsvision_get_event_snapshot(id)- View snapshotvision_annotate_event(id, text, tags)- Add meaningvision_event_stats()- See statistics