// Mock IoT Data
export interface Sensor {
id: string;
name: string;
type:
| "temperature"
| "pressure"
| "vibration"
| "humidity"
| "flow"
| "level";
unit: string;
location: string;
equipmentId: string;
status: "active" | "inactive" | "error";
minThreshold?: number;
maxThreshold?: number;
}
export interface SensorReading {
id: string;
sensorId: string;
timestamp: string;
value: number;
unit: string;
status: "normal" | "warning" | "critical";
}
export interface Device {
id: string;
name: string;
type: string;
location: string;
status: "online" | "offline" | "error";
lastSeen: string;
firmwareVersion: string;
batteryLevel?: number;
signalStrength?: number;
}
export interface Alert {
id: string;
deviceId: string;
sensorId?: string;
severity: "info" | "warning" | "critical";
message: string;
timestamp: string;
acknowledged: boolean;
acknowledgedBy?: string;
acknowledgedAt?: string;
}
export const mockSensors: Sensor[] = [
{
id: "sensor-001",
name: "Temperature Sensor - Assembly Line 1",
type: "temperature",
unit: "°C",
location: "Building A - Floor 1",
equipmentId: "eq-001",
status: "active",
minThreshold: 15,
maxThreshold: 35,
},
{
id: "sensor-002",
name: "Vibration Sensor - CNC Machine 1",
type: "vibration",
unit: "mm/s",
location: "Building A - Floor 2",
equipmentId: "eq-002",
status: "active",
minThreshold: 0,
maxThreshold: 10,
},
{
id: "sensor-003",
name: "Pressure Sensor - Packaging Station 1",
type: "pressure",
unit: "bar",
location: "Building B - Floor 1",
equipmentId: "eq-003",
status: "active",
minThreshold: 0,
maxThreshold: 8,
},
{
id: "sensor-004",
name: "Humidity Sensor - Quality Control",
type: "humidity",
unit: "%",
location: "Building A - Floor 1",
equipmentId: "eq-004",
status: "active",
minThreshold: 30,
maxThreshold: 70,
},
{
id: "sensor-005",
name: "Flow Sensor - Cooling System",
type: "flow",
unit: "L/min",
location: "Building A - Basement",
equipmentId: "eq-005",
status: "active",
minThreshold: 10,
maxThreshold: 50,
},
];
export const mockSensorReadings: SensorReading[] = [
{
id: "reading-001",
sensorId: "sensor-001",
timestamp: new Date().toISOString(),
value: 25.5,
unit: "°C",
status: "normal",
},
{
id: "reading-002",
sensorId: "sensor-002",
timestamp: new Date().toISOString(),
value: 3.2,
unit: "mm/s",
status: "normal",
},
{
id: "reading-003",
sensorId: "sensor-003",
timestamp: new Date().toISOString(),
value: 6.5,
unit: "bar",
status: "normal",
},
{
id: "reading-004",
sensorId: "sensor-004",
timestamp: new Date().toISOString(),
value: 45.0,
unit: "%",
status: "normal",
},
{
id: "reading-005",
sensorId: "sensor-001",
timestamp: new Date(Date.now() - 300000).toISOString(),
value: 38.2,
unit: "°C",
status: "warning",
},
{
id: "reading-006",
sensorId: "sensor-002",
timestamp: new Date(Date.now() - 600000).toISOString(),
value: 12.5,
unit: "mm/s",
status: "critical",
},
];
export const mockDevices: Device[] = [
{
id: "device-001",
name: "IoT Gateway - Building A",
type: "Gateway",
location: "Building A - Floor 1",
status: "online",
lastSeen: new Date().toISOString(),
firmwareVersion: "v2.3.1",
signalStrength: 95,
},
{
id: "device-002",
name: "IoT Gateway - Building B",
type: "Gateway",
location: "Building B - Floor 1",
status: "online",
lastSeen: new Date().toISOString(),
firmwareVersion: "v2.3.1",
signalStrength: 88,
},
{
id: "device-003",
name: "Wireless Sensor Node - Zone 1",
type: "Sensor Node",
location: "Building A - Floor 1",
status: "online",
lastSeen: new Date(Date.now() - 60000).toISOString(),
firmwareVersion: "v1.5.2",
batteryLevel: 85,
signalStrength: 72,
},
{
id: "device-004",
name: "Wireless Sensor Node - Zone 2",
type: "Sensor Node",
location: "Building A - Floor 2",
status: "offline",
lastSeen: new Date(Date.now() - 3600000).toISOString(),
firmwareVersion: "v1.5.2",
batteryLevel: 15,
signalStrength: 0,
},
];
export const mockAlerts: Alert[] = [
{
id: "alert-001",
deviceId: "device-001",
sensorId: "sensor-001",
severity: "warning",
message: "Temperature reading above normal threshold: 38.2°C",
timestamp: new Date(Date.now() - 300000).toISOString(),
acknowledged: false,
},
{
id: "alert-002",
deviceId: "device-001",
sensorId: "sensor-002",
severity: "critical",
message:
"Vibration level critical: 12.5 mm/s - Equipment may need immediate attention",
timestamp: new Date(Date.now() - 600000).toISOString(),
acknowledged: true,
acknowledgedBy: "operator-001",
acknowledgedAt: new Date(Date.now() - 550000).toISOString(),
},
{
id: "alert-003",
deviceId: "device-004",
severity: "warning",
message: "Device offline - Last seen 1 hour ago",
timestamp: new Date(Date.now() - 3600000).toISOString(),
acknowledged: false,
},
{
id: "alert-004",
deviceId: "device-003",
severity: "info",
message: "Battery level below 20% - Consider replacement soon",
timestamp: new Date(Date.now() - 7200000).toISOString(),
acknowledged: true,
acknowledgedBy: "tech-001",
acknowledgedAt: new Date(Date.now() - 7000000).toISOString(),
},
];