ECE-BOT includes a machine monitoring system that continuously ingests sensor telemetry from connected hardware over MQTT and stores every reading in PostgreSQL. Operators and admins can view the latest readings, aggregated summaries, and trend charts for each machine from the dashboard. Access is restricted to users with the operator or admin role.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Kr-Yogsa/ECE-BOT/llms.txt
Use this file to discover all available pages before exploring further.
MQTT ingestion
A standalone MQTT worker subscribes to sensor topics and persists each message to the database as it arrives. The worker runs separately from the Flask app and is configured entirely through environment variables. Default topic:factory/machine/+/telemetry
The + wildcard matches any machine ID (for example, factory/machine/cnc/telemetry). You can override this with the MQTT_TOPIC environment variable.
Expected payload
The MQTT worker accepts JSON payloads with the following structure:| Field | Type | Required | Description |
|---|---|---|---|
machine_id | string | Recommended | Machine identifier (melfa, plc, or cnc). If omitted, ECE-BOT falls back to the second-to-last segment of the MQTT topic. |
temperature | number | No | Temperature in degrees Celsius. |
humidity | number | No | Relative humidity as a percentage. |
vibration | number | No | Vibration magnitude. |
timestamp | string | No | ISO 8601 timestamp. Defaults to server time if omitted or invalid. |
Timestamps before 2025 (for example, ESP8266 uptime-based
1970-01-01 placeholders) are discarded and replaced with the server’s current UTC time.Machine IDs
Machine IDs in telemetry payloads correspond directly to the hardware assistant IDs used throughout ECE-BOT:| Machine ID | Hardware |
|---|---|
melfa | Mitsubishi MELFA robot |
plc | Programmable logic controller |
cnc | CNC machine |
Machine online and offline status
A machine is considered online if its most recent telemetry reading arrived within the lastMACHINE_OFFLINE_AFTER_SECONDS seconds. The default is 15 seconds. If no reading arrives within that window, the machine status switches to offline.
You can tune this threshold by setting MACHINE_OFFLINE_AFTER_SECONDS in your environment:
Dashboard
The dashboard endpoint returns everything the frontend needs in a single request: the latest reading, per-window summaries, and a short trend series for charts.Latest reading
The most recent row stored for the machine, including temperature, humidity, vibration, and therecorded_at timestamp.
Summaries
Average temperature, humidity, and vibration computed over multiple time windows (for example, last 5 minutes, last hour). This lets operators spot gradual drift without scrolling through raw history.Trend chart
A short series of recent readings suitable for rendering a sparkline or line chart. The series is ordered chronologically and sized to fit the dashboard layout without overloading the browser.machine_id values: melfa, plc, cnc.
Reading history
The history endpoint returns a paginated list of raw telemetry readings for export, analysis, or custom charts.| Parameter | Default | Maximum | Description |
|---|---|---|---|
limit | 100 | 1000 | Number of readings to return, newest first. |
API endpoints
All machine monitoring endpoints require an
operator or admin role. Requests from accounts with the user role receive a 403 Forbidden response.