@blueharford/scrypted-spatial-awareness 0.2.1 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +83 -9
- package/dist/main.nodejs.js +1 -1
- package/dist/main.nodejs.js.map +1 -1
- package/dist/plugin.zip +0 -0
- package/out/main.nodejs.js +679 -4
- package/out/main.nodejs.js.map +1 -1
- package/out/plugin.zip +0 -0
- package/package.json +1 -1
- package/src/core/tracking-engine.ts +376 -10
- package/src/main.ts +175 -1
- package/src/ui/editor-html.ts +256 -0
package/README.md
CHANGED
|
@@ -44,20 +44,28 @@ This plugin **tracks objects across your entire camera system**, understanding t
|
|
|
44
44
|
|
|
45
45
|
## Features
|
|
46
46
|
|
|
47
|
+
### Core Tracking
|
|
47
48
|
- **Cross-Camera Tracking**: Correlate objects (people, vehicles, animals) as they move between cameras
|
|
48
49
|
- **Journey History**: Complete path history for each tracked object across your property
|
|
49
50
|
- **Entry/Exit Detection**: Know when objects enter or leave your property
|
|
50
51
|
- **Movement Alerts**: Get notified when objects move between camera zones
|
|
51
|
-
- **LLM-Enhanced Descriptions**: Rich, contextual alerts like "Man in red shirt walking from garage towards front door" (requires LLM plugin)
|
|
52
|
-
- **Visual Floor Plan Editor**: Configure camera topology with an intuitive visual editor
|
|
53
|
-
- **MQTT Integration**: Export tracking data to Home Assistant for automations
|
|
54
|
-
- **REST API**: Query tracked objects and journeys programmatically
|
|
55
52
|
- **Smart Cooldowns**: Prevent alert spam with per-object cooldowns
|
|
56
53
|
- **Loitering Threshold**: Only alert after objects are visible for a configurable duration
|
|
57
54
|
- **Multiple Notifiers**: Send alerts to multiple notification services simultaneously
|
|
58
55
|
|
|
59
|
-
###
|
|
56
|
+
### LLM-Enhanced Descriptions
|
|
57
|
+
- **Rich Contextual Alerts**: Get alerts like "Man in red shirt walking from garage towards front door" (requires LLM plugin)
|
|
58
|
+
- **Configurable Rate Limiting**: Prevent LLM API overload with configurable debounce intervals
|
|
59
|
+
- **Automatic Fallback**: Falls back to basic notifications when LLM is slow or unavailable
|
|
60
|
+
- **Configurable Timeouts**: Set maximum wait time for LLM responses
|
|
61
|
+
|
|
62
|
+
### Visual Floor Plan Editor
|
|
63
|
+
- **Drag-and-Drop**: Place cameras, landmarks, and connections visually
|
|
64
|
+
- **Live Tracking Overlay**: See tracked objects move across your floor plan in real-time
|
|
65
|
+
- **Journey Visualization**: Click any tracked object to see their complete path drawn on the floor plan
|
|
66
|
+
- **Drawing Tools**: Add walls, rooms, and labels without needing an image
|
|
60
67
|
|
|
68
|
+
### Spatial Intelligence
|
|
61
69
|
- **Landmarks & Static Objects**: Define landmarks like mailbox, shed, driveway, deck to give the system spatial context
|
|
62
70
|
- **Camera Context**: Describe where each camera is mounted and what it can see for richer descriptions
|
|
63
71
|
- **Field of View Configuration**: Define camera FOV (simple angle or polygon) to understand coverage overlap
|
|
@@ -65,6 +73,16 @@ This plugin **tracks objects across your entire camera system**, understanding t
|
|
|
65
73
|
- **AI Landmark Suggestions**: System learns to identify landmarks from camera footage over time
|
|
66
74
|
- **Spatial Relationships**: Auto-inferred relationships between cameras and landmarks based on position
|
|
67
75
|
|
|
76
|
+
### Automatic Learning (NEW in v0.3.0)
|
|
77
|
+
- **Transit Time Learning**: Automatically adjusts connection transit times based on observed movement patterns
|
|
78
|
+
- **Connection Suggestions**: System suggests new camera connections based on observed object movements
|
|
79
|
+
- **Confidence Scoring**: Suggestions include confidence scores based on consistency of observations
|
|
80
|
+
- **One-Click Approval**: Accept or reject suggestions directly from the topology editor
|
|
81
|
+
|
|
82
|
+
### Integrations
|
|
83
|
+
- **MQTT Integration**: Export tracking data to Home Assistant for automations
|
|
84
|
+
- **REST API**: Query tracked objects and journeys programmatically
|
|
85
|
+
|
|
68
86
|
## Installation
|
|
69
87
|
|
|
70
88
|
### From NPM (Recommended)
|
|
@@ -97,6 +115,7 @@ npm install @blueharford/scrypted-spatial-awareness
|
|
|
97
115
|
3. **Optional - Enable LLM Descriptions**:
|
|
98
116
|
- Install an LLM plugin (OpenAI, Ollama, etc.)
|
|
99
117
|
- Enable "Use LLM for Rich Descriptions" in settings
|
|
118
|
+
- Configure rate limiting and fallback options
|
|
100
119
|
- Get alerts like "Woman with stroller" instead of just "Person"
|
|
101
120
|
|
|
102
121
|
4. **Optional - Enable MQTT**:
|
|
@@ -104,6 +123,11 @@ npm install @blueharford/scrypted-spatial-awareness
|
|
|
104
123
|
- Configure broker URL and credentials
|
|
105
124
|
- Use in Home Assistant automations
|
|
106
125
|
|
|
126
|
+
5. **Optional - Enable Learning Features**:
|
|
127
|
+
- Enable "Learn Transit Times" to auto-adjust connection timing
|
|
128
|
+
- Enable "Suggest Camera Connections" to discover new paths
|
|
129
|
+
- Enable "Learn Landmarks from AI" for automatic landmark discovery
|
|
130
|
+
|
|
107
131
|
## How It Works
|
|
108
132
|
|
|
109
133
|
The plugin listens to object detection events from all configured cameras. When an object (person, car, animal, package) is detected:
|
|
@@ -126,10 +150,12 @@ To prevent alert spam and reduce noise:
|
|
|
126
150
|
### LLM Integration
|
|
127
151
|
|
|
128
152
|
When an LLM plugin is installed and enabled, the plugin will:
|
|
129
|
-
1.
|
|
130
|
-
2.
|
|
131
|
-
3.
|
|
132
|
-
4.
|
|
153
|
+
1. Check rate limiting (configurable, default: 10 second minimum between calls)
|
|
154
|
+
2. Capture a snapshot from the camera
|
|
155
|
+
3. Send it to the LLM with context about the movement
|
|
156
|
+
4. Apply timeout (configurable, default: 3 seconds) with automatic fallback
|
|
157
|
+
5. Get a rich description like "Man in blue jacket" or "Black pickup truck"
|
|
158
|
+
6. Include this in the notification
|
|
133
159
|
|
|
134
160
|
This transforms generic alerts into contextual, actionable information.
|
|
135
161
|
|
|
@@ -144,7 +170,18 @@ This transforms generic alerts into contextual, actionable information.
|
|
|
144
170
|
| Visual Matching | ON | Use visual embeddings for correlation |
|
|
145
171
|
| Loitering Threshold | 3s | Object must be visible this long before alerting |
|
|
146
172
|
| Per-Object Cooldown | 30s | Minimum time between alerts for same object |
|
|
173
|
+
|
|
174
|
+
### AI & Spatial Reasoning Settings (NEW in v0.3.0)
|
|
175
|
+
| Setting | Default | Description |
|
|
176
|
+
|---------|---------|-------------|
|
|
147
177
|
| LLM Descriptions | ON | Use LLM plugin for rich descriptions |
|
|
178
|
+
| LLM Rate Limit | 10s | Minimum time between LLM API calls |
|
|
179
|
+
| Fallback to Basic | ON | Use basic notifications when LLM unavailable |
|
|
180
|
+
| LLM Timeout | 3s | Maximum time to wait for LLM response |
|
|
181
|
+
| Learn Transit Times | ON | Auto-adjust transit times from observations |
|
|
182
|
+
| Suggest Connections | ON | Suggest new camera connections |
|
|
183
|
+
| Learn Landmarks | ON | Allow AI to suggest landmarks |
|
|
184
|
+
| Landmark Confidence | 0.7 | Minimum confidence for landmark suggestions |
|
|
148
185
|
|
|
149
186
|
### Alert Types
|
|
150
187
|
| Alert | Description | Default |
|
|
@@ -170,6 +207,7 @@ The plugin exposes a REST API via Scrypted's HTTP handler:
|
|
|
170
207
|
|----------|--------|-------------|
|
|
171
208
|
| `/api/tracked-objects` | GET | List all tracked objects |
|
|
172
209
|
| `/api/journey/{id}` | GET | Get journey for specific object |
|
|
210
|
+
| `/api/journey-path/{id}` | GET | Get journey path with positions for visualization |
|
|
173
211
|
| `/api/topology` | GET | Get camera topology configuration |
|
|
174
212
|
| `/api/topology` | PUT | Update camera topology |
|
|
175
213
|
| `/api/alerts` | GET | Get recent alerts |
|
|
@@ -178,6 +216,11 @@ The plugin exposes a REST API via Scrypted's HTTP handler:
|
|
|
178
216
|
| `/api/floor-plan` | GET/POST | Get or upload floor plan image |
|
|
179
217
|
| `/ui/editor` | GET | Visual topology editor |
|
|
180
218
|
|
|
219
|
+
### Live Tracking Endpoints (NEW in v0.3.0)
|
|
220
|
+
| Endpoint | Method | Description |
|
|
221
|
+
|----------|--------|-------------|
|
|
222
|
+
| `/api/live-tracking` | GET | Get current state of all tracked objects |
|
|
223
|
+
|
|
181
224
|
### Landmark & Spatial Reasoning Endpoints
|
|
182
225
|
| Endpoint | Method | Description |
|
|
183
226
|
|----------|--------|-------------|
|
|
@@ -190,6 +233,13 @@ The plugin exposes a REST API via Scrypted's HTTP handler:
|
|
|
190
233
|
| `/api/landmark-templates` | GET | Get landmark templates for quick setup |
|
|
191
234
|
| `/api/infer-relationships` | GET | Get auto-inferred spatial relationships |
|
|
192
235
|
|
|
236
|
+
### Connection Suggestion Endpoints (NEW in v0.3.0)
|
|
237
|
+
| Endpoint | Method | Description |
|
|
238
|
+
|----------|--------|-------------|
|
|
239
|
+
| `/api/connection-suggestions` | GET | Get suggested camera connections |
|
|
240
|
+
| `/api/connection-suggestions/{id}/accept` | POST | Accept a connection suggestion |
|
|
241
|
+
| `/api/connection-suggestions/{id}/reject` | POST | Reject a connection suggestion |
|
|
242
|
+
|
|
193
243
|
## MQTT Topics
|
|
194
244
|
|
|
195
245
|
When MQTT is enabled, the plugin publishes to:
|
|
@@ -236,6 +286,30 @@ Without LLM:
|
|
|
236
286
|
- "Car moving from Street towards Driveway"
|
|
237
287
|
- "Dog moving from Back Yard towards Side Gate"
|
|
238
288
|
|
|
289
|
+
## Changelog
|
|
290
|
+
|
|
291
|
+
### v0.3.0
|
|
292
|
+
- **Live Tracking Overlay**: View tracked objects in real-time on the floor plan
|
|
293
|
+
- **Journey Visualization**: Click any tracked object to see their complete path
|
|
294
|
+
- **Transit Time Learning**: Automatically adjusts connection times based on observations
|
|
295
|
+
- **Connection Suggestions**: System suggests new camera connections
|
|
296
|
+
- **LLM Rate Limiting**: Configurable debounce intervals to prevent API overload
|
|
297
|
+
- **LLM Fallback**: Automatic fallback to basic notifications when LLM is slow
|
|
298
|
+
- **LLM Timeout**: Configurable timeout with automatic fallback
|
|
299
|
+
|
|
300
|
+
### v0.2.0
|
|
301
|
+
- **Landmark System**: Add landmarks for spatial context
|
|
302
|
+
- **RAG Reasoning**: Context-aware movement descriptions
|
|
303
|
+
- **AI Learning**: Automatic landmark suggestions
|
|
304
|
+
- **Camera Context**: Rich camera descriptions for better alerts
|
|
305
|
+
|
|
306
|
+
### v0.1.0
|
|
307
|
+
- Initial release with cross-camera tracking
|
|
308
|
+
- Entry/exit detection
|
|
309
|
+
- Movement alerts
|
|
310
|
+
- MQTT integration
|
|
311
|
+
- Visual topology editor
|
|
312
|
+
|
|
239
313
|
## Requirements
|
|
240
314
|
|
|
241
315
|
- Scrypted with NVR plugin
|