Skip to main content

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

The system consists of five backend modules that work together:
  1. Swift Sensors API Client - Handles authentication and data fetching from Swift Sensors
  2. Equipment Module - Manages equipment units and threshold configuration
  3. Temperature Data Module - Stores and queries time-series data
  4. Alert System - Detects threshold violations and tracks alert status
  5. Notification System - Routes alerts to assigned users

Setup

1

Configure environment variables

Add your Swift Sensors credentials to your .env file:
.env
Never commit API credentials to version control. Use environment variables or a secrets manager.
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_assignments
4

Access the dashboard

Navigate to Equipment → Refrigeration in the admin dashboard to begin monitoring.

Database Schema

Equipment Table

The equipment 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 robot
string
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 humidity
number
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:
Configure thresholds per equipment unit to account for different requirements. Freezers typically need different thresholds than refrigerators.

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 both

Reports

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:
  1. Select an alert type
  2. Choose users to assign
  3. Select notification channels (email, SMS, in-app)
  4. 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:
  1. Select equipment from the dropdown
  2. Choose date range
  3. Select format (CSV for raw data, JSON for summary)
  4. Click Generate Report

Troubleshooting

  1. Verify credentials - Check that your Swift Sensors credentials are correct in .env
  2. Check sensor pairing - Ensure equipment records have swift_sensor_id_temperature set
  3. Review sync logs - Check the background sync job logs for errors
  4. Test API connection - Try fetching data directly from Swift Sensors API
  1. Check thresholds - Verify thresholds are configured for the equipment
  2. Verify readings - Ensure sensor data is being recorded in temperature_readings
  3. Review alert detection - Check that the alert detection service is running
  1. Check assignments - Verify notification assignments exist for the alert type
  2. Verify user data - Ensure assigned users have valid email/phone
  3. 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.