Monitor sensors & alerts (Operator workflow)
This page is for operators who monitor occupancy sensors and respond to alerts.
Your goals
- Ensure sensors are online and reporting accurate data.
- Respond to capacity alerts and sensor issues.
- Maintain data quality for public dashboards.
1) Sensor status monitoring
Viewing sensor status
- Navigate to Occupancy → Sensor Equipment in Django Admin.
- Check the sensor list for status indicators:
- ✅ Active + recent
last_seen: Sensor is working - ⚠️ Active + stale
last_seen: May be offline - ❌ Inactive: Sensor is disabled
Key fields to monitor
| Field | What it tells you |
|---|---|
| Device ID | Unique sensor identifier |
| Sensor Type | AI Camera or Infrared Counter |
| Is Active | Whether sensor is enabled |
| Last Seen | When sensor last reported data |
| Location | Geographic position |
Identifying offline sensors
Check for sensors where:
- last_seen is more than 30 minutes old (threshold may vary)
- Status is Active but no recent readings exist
2) Alert management
Types of alerts
| Alert Type | Severity | Meaning |
|---|---|---|
| Capacity Warning | Medium | Occupancy approaching limit (e.g., 80%) |
| Capacity Critical | High | Occupancy at or exceeding limit |
| Sensor Offline | Medium | Sensor stopped reporting data |
| Data Anomaly | Low | Unusual patterns detected |
Responding to alerts
- Navigate to Occupancy → Alerts in Django Admin.
- Review unresolved alerts (filter by
is_resolved = False). - Investigate the issue:
- For capacity alerts: Verify on-site conditions
- For sensor alerts: Check physical device or network
-
For anomalies: Review raw data for patterns
-
Take action:
- Dispatch staff if needed
- Contact technical support for sensor issues
-
Adjust thresholds if alerts are too frequent
-
Mark resolved:
- Set
is_resolved = True - Add resolution notes
Alert context
Each alert includes context data:
{
"current_occupancy": 95,
"capacity": 100,
"percentage": 95.0,
"threshold": 90
}
Use this to understand the severity and specifics.
3) Data quality checks
Verifying sensor readings
Periodically check that readings make sense:
- Navigate to Occupancy → Sensor Readings (if accessible).
- Filter by sensor and recent time range.
- Look for:
- Consistent data flow (no large gaps)
- Reasonable counts (not negative, not impossibly high)
- Correct object types being detected
Common data issues
| Issue | Possible cause | Action |
|---|---|---|
| Negative occupancy | Exit counted without entry | Check gate configuration |
| Stuck at zero | Sensor offline or misconfigured | Verify sensor status |
| Unrealistic spikes | Detection errors or vandalism | Review camera footage |
| Missing data gaps | Network or power issues | Check infrastructure |
4) Sensor maintenance coordination
When equipment module is enabled
If sensors are linked to Equipment records: - View maintenance history for each sensor - Schedule preventive maintenance - Track repair costs
Without equipment module
Keep manual records of: - Cleaning schedules (camera lenses) - Battery replacements (if applicable) - Firmware updates - Physical inspections
5) Ingestion error monitoring
Viewing ingestion errors
- Navigate to Occupancy → Ingestion Errors in Django Admin.
- Review recent errors by type:
- Connection errors: Network/database issues
- Parsing errors: Malformed data from sensors
- Validation errors: Data fails business rules
- Sensor not found: Unknown device ID
- Duplicate messages: Already processed
Handling errors
For each error:
1. Review the raw_data to understand what was received
2. Check error_message for specific failure reason
3. Determine if it's:
- A transient issue (retry may work)
- A configuration problem (needs fix)
- A data quality issue (sensor misconfigured)
- Mark for retry or resolution as appropriate
6) Real-time monitoring
Using WebSocket feeds
The system supports real-time updates via WebSocket: - Dashboard shows live occupancy changes - Alerts appear immediately when triggered - No need to refresh pages
Monitoring during events
During high-traffic periods: - Monitor dashboards more frequently - Be ready to respond to capacity alerts - Coordinate with on-site staff
Behind the scenes (grounded in code)
- Sensor model:
apps/occupancy/models.py→SensorEquipment - Alert model:
apps/occupancy/models.py→OccupancyAlert - Ingestion errors:
apps/occupancy/models.py→IngestionError - WebSocket:
apps/occupancy/consumers.py - Alert checking: Background tasks in
apps/occupancy/tasks.py