Equipment Monitoring System
The Equipment Monitoring System provides real-time temperature and humidity monitoring for your refrigeration equipment, integrated with Swift Sensors hardware.Real-time Monitoring
Monitor temperature and humidity across all your fridges and freezers
Smart Alerts
Receive notifications via email, SMS, or in-app when thresholds are exceeded
Historical Reports
Generate reports for compliance and analysis
Multi-channel Notifications
Configure who receives which alerts through which channels
Architecture Overview
- Swift Sensors API Client - Handles authentication and data fetching from Swift Sensors
- Equipment Module - Manages equipment units and threshold configuration
- Temperature Data Module - Stores and queries time-series data
- Alert System - Detects threshold violations and tracks alert status
- Notification System - Routes alerts to assigned users
Setup
1
Configure environment variables
Add your Swift Sensors credentials to your
.env file:.env
2
Register the modules
Equipment API routes are registered in the Hono API at
apps/api/src/routes/v1/equipment/. No additional module registration is needed.3
Run database migrations
Create the required database tables by adding a new Supabase migration in
supabase/migrations/:Terminal
Verify the migration created these tables:
equipment, equipment_thresholds, temperature_readings, equipment_alerts, alert_notification_assignments4
Access the dashboard
Navigate to Equipment → Refrigeration in the admin dashboard to begin monitoring.
Database Schema
Equipment Table
Theequipment table stores your refrigeration units:
string
required
Primary key for the equipment record
string
required
Human-readable name (e.g., “Walk-in Fridge 1”)
string
required
Equipment type:
refrigerator, freezer, handheld, or robotstring
Link to associated inventory group for location tracking
integer
Swift Sensors temperature sensor ID
integer
Swift Sensors humidity sensor ID (optional)
boolean
Whether the equipment is currently monitored
Equipment Thresholds Table
Configure custom alert thresholds for each equipment unit:string
required
Foreign key to the equipment record
string
required
Either
temperature or humiditynumber
Value below which a critical alert is triggered
number
Value below which a warning alert is triggered
number
Value above which a warning alert is triggered
number
Value above which a critical alert is triggered
Alert Types
The system monitors for these alert conditions:API Endpoints
Equipment Management
Alert Management
Time Series Data
Retrieve historical readings for analysis and reporting:Get Time Series
integer
required
Start timestamp in milliseconds
integer
required
End timestamp in milliseconds
string
default:"both"
Filter by
temperature, humidity, or bothReports
Generate historical reports for compliance and analysis:Generate CSV Report
Dashboard Features
Equipment Monitoring Tab
The monitoring tab provides:- Active Alerts Section - View and manage current alerts with one-click resolve/acknowledge
- Equipment Grid - Cards showing current temperature, humidity, and status for each unit
- Status Indicators - Color-coded badges (green/orange/red) for normal/warning/critical states
Equipment Detail Modal
Click any equipment card to open the detail view:- Historical Charts - Temperature and humidity over time with selectable ranges (1h, 6h, 24h, 7d, 30d)
- Active Alerts - Alerts specific to this equipment
- Configuration - Sensor IDs and threshold settings
Notifications Management Tab
Configure which users receive which alerts:- Select an alert type
- Choose users to assign
- Select notification channels (email, SMS, in-app)
- Optionally limit to specific equipment
Users only receive notifications for alert types they are explicitly assigned to. Unassigned users will not receive any equipment alerts.
Historical Reporting Tab
Generate reports for compliance and analysis:- Select equipment from the dropdown
- Choose date range
- Select format (CSV for raw data, JSON for summary)
- Click Generate Report
Troubleshooting
No data appearing in the dashboard
No data appearing in the dashboard
- Verify credentials - Check that your Swift Sensors credentials are correct in
.env - Check sensor pairing - Ensure equipment records have
swift_sensor_id_temperatureset - Review sync logs - Check the background sync job logs for errors
- Test API connection - Try fetching data directly from Swift Sensors API
Alerts not triggering
Alerts not triggering
- Check thresholds - Verify thresholds are configured for the equipment
- Verify readings - Ensure sensor data is being recorded in
temperature_readings - Review alert detection - Check that the alert detection service is running
Notifications not sending
Notifications not sending
- Check assignments - Verify notification assignments exist for the alert type
- Verify user data - Ensure assigned users have valid email/phone
- Review notification logs - Check the notification service logs
Next Steps: When Sensors Arrive
1
Install sensors
Follow Swift Sensors installation documentation to mount sensors in your refrigeration units.
2
Note sensor IDs
Log into the Swift Sensors dashboard and note the sensor IDs for each device.
3
Pair sensors to equipment
Update each equipment record with the corresponding sensor IDs via the API.
4
Configure thresholds
Set appropriate temperature and humidity thresholds for each unit type.
5
Set up notifications
Assign users to receive alerts through their preferred channels.
6
Begin monitoring
The dashboard will start showing real-time data once sensors are paired.