Rela AIRela AI Docs
Tutorials

Machine monitoring: from sensor to alert

Connect industrial sensors to Rela AI, visualize events in real time, and configure automatic alarms with task creation.

What you will achieve

By the end of this tutorial you will have a complete industrial monitoring flow: receive sensor data via webhook, visualize events, and trigger alarms that automatically create tasks. Estimated time: 25 minutes.

Prerequisites

  • An active Rela AI account with dashboard access
  • Access to a terminal with curl (Linux, macOS, or Windows with WSL)
  • A machine agent created (or we will create one in Step 1)

Step 1: Create a machine agent

  1. In the sidebar, click Agents.
  2. Click New Agent.
  3. Configure:
    • Name: Pump P-101 Monitor
    • Type: select Machine
    • Description: Monitors vibration and temperature of pump P-101
  4. Click Create.

You should see the machine agent configuration page with event sources and alarms sections.

Step 2: Add an HTTP event source

  1. On the agent page, go to Event Sources.
  2. Click New Source.
  3. Configure:
    • Type: HTTP Webhook
    • Name: P-101 Vibration Sensor
  4. Click Create.

You should see a generated webhook URL, similar to:

https://api.rela.ai/v1/events/webhook/abc123def456
Copy this URL. You will need it to send data from your sensor or SCADA system.

Step 3: Send a test event

Open your terminal and run the following curl command:

curl -X POST https://api.rela.ai/v1/events/webhook/abc123def456 \
  -H "Content-Type: application/json" \
  -d '{
    "timestamp": "2026-03-26T10:30:00Z",
    "machine_id": "P-101",
    "metrics": {
      "vibration_mm_s": 3.2,
      "temperature_c": 67.5,
      "pressure_bar": 4.1
    },
    "status": "running"
  }'

You should receive a successful response:

{
  "status": "accepted",
  "event_id": "evt_789xyz"
}
Replace the webhook URL with the actual URL generated in Step 2. The example URL will not work.

Step 4: View the event in the history

  1. Return to the dashboard and go to Agents > Pump P-101 Monitor.
  2. Click the Events tab.
  3. Look for the event you just sent.

You should see the event with its timestamp, metrics (vibration: 3.2 mm/s, temperature: 67.5 C, pressure: 4.1 bar), and status "running".

Events appear in real time thanks to WebSocket updates. You do not need to refresh the page.

Step 5: Create an alarm rule

  1. On the agent page, go to Alarms > Rules.
  2. Click New Rule.
  3. Configure the rule:
    • Name: High Vibration P-101
    • Condition: vibration_mm_s > 5
    • Priority: High
    • Action — Create task: enabled
    • Task title: Review high vibration on pump P-101
    • Task priority: urgent
    • Assigned to: select a technician
    • Action — Notify: enabled (email and/or WhatsApp)
  4. Click Save.

You should see the rule listed with status "Active" and the condition vibration_mm_s > 5 visible.

Step 6: Test the rule with a critical event

Send a new event with vibration above the threshold:

curl -X POST https://api.rela.ai/v1/events/webhook/abc123def456 \
  -H "Content-Type: application/json" \
  -d '{
    "timestamp": "2026-03-26T11:00:00Z",
    "machine_id": "P-101",
    "metrics": {
      "vibration_mm_s": 7.8,
      "temperature_c": 72.3,
      "pressure_bar": 4.0
    },
    "status": "running"
  }'

You should see the following:

  1. Active alarm — In Alarms a new "High Vibration P-101" alarm appears with High priority.
  2. Task created — On the Kanban board the task "Review high vibration on pump P-101" appears in todo status.
  3. Notification sent — The assigned technician receives an email and/or WhatsApp message.
If you do not receive the notification, verify that the assigned technician has an email or phone number configured in their profile. Notifications require valid contact data.

Summary

StepActionResult
1Create machine agentAgent configured for pump P-101
2Add event sourceWebhook URL available
3Send test eventEvent received successfully
4View historyEvent visible in dashboard
5Create alarm ruleActive rule with condition and actions
6Test with critical eventAlarm, task, and notification generated

Next steps

On this page