Skip to main content
Build a live motor dashboard with AI in about 90 minutes. Start with one RPM gauge, then expand it with AI. Your PC sends simulated motor data from Node-RED; no physical motor is needed. You will use prompts to create the device, dashboard and alarm rules, then approve the proposed changes. Node-RED supplies the data; AI designs the display. Start with the simple gauge so you can check the connection before adding more widgets.
Part of the Code & Compile ThingsBoard series. ThingsBoard (Edge Setup) built the same simulated motor on a local ThingsBoard Edge, and Real-Time Vibration Monitoring with ThingsBoard and Calculated Fields used a real Balluff sensor with hand-built rules. This guide moves to ThingsBoard Cloud and lets AI do the dashboard and alarm work.
By the end of this guide, you will have:
  • Your local Node-RED simulation connected to ThingsBoard Cloud over MQTT.
  • A compact motor dashboard built with the Configure with AI feature in ThingsBoard, including electrical readings and vibration trends.
  • Alarm conditions for motor faults, high vibration and high temperature.
Allow about 90 minutes for registration, Node-RED motor simulation setup and checks, or about 60 minutes if your ThingsBoard account and Node-RED are ready. Optional manual styling comes last.

Five steps, from your first prompt to alarms

Step 1: Create your account

Sign in to ThingsBoard Cloud EU.

Step 2: Prompt a simple gauge

Create one motor device and an RPM dashboard.

Step 3: Connect live simulation

Import our Node-RED flow and link it over MQTT.

Step 4: Expand with AI

Add readings, trends and a Details view.

Step 5: Add and check alarms

Set fault, vibration and temperature conditions.

Before you start

Use these Code & Compile resources if you need the basics:
Want to get started with ThingsBoard Cloud?Create an account or sign in here.

Hardware & Software Used

Hardware
  • Development PC / laptop with an internet connection. No physical motor is needed.
Software Keep your Cloud account and Node-RED editor open in separate browser tabs. You will move between them to copy device credentials, publish data and check the dashboard.

Step 1 – Create your Cloud account

Open ThingsBoard Cloud EU. Sign in or select Sign up, complete registration, and verify your email.
ThingsBoard Cloud EU login and Sign up page

ThingsBoard Cloud EU sign-in page.

Use Tenant Administrator access. Let AI create Industrial Motor 01 in Step 2; do not manually add another device.

Step 2 – Create a simple RPM dashboard

1

Enter the simple prompt

Open AI solution creator → New solution and enter:
Motor RPM prompt in AI Solution Creator

The simple prompt in AI Solution Creator.

2

Review and create the solution

Select Skip interview if offered. Check the proposed device name, speedRpm key, and 0–1600 RPM gauge. The telemetry key is the name Node-RED sends; it must match exactly, including capital letters.Review the full proposal. Approve only one motor device and its RPM dashboard. Ask AI to remove unrequested users, roles, assets, devices, calculated fields, alarm rules or emulators before installing; alarms come in Step 5.Continue through Dashboard Design, then click Create Solution.Open Motor RPM. Connect Node-RED next to supply its data.
Already have a motor dashboard? Export a backup, then use Configure with AI on it instead of installing another solution.

Step 3 – Connect the example Node-RED simulation

The attached flow packages the Edge demo’s motor simulation with a secure MQTT connection. Install Node-RED first using the links under Before you start.
1

Import the project

Start Node-RED and open localhost:1880. Select Menu → Import, choose the attached JSON project, and click Import. Reuse the existing flow if it is already imported; running two copies would publish duplicate samples.

industrial-motor-cloud-flow.json

Node-RED motor simulation flow with MQTT output and Debug samples

Inject → motor simulation → JSON → ThingsBoard MQTT, with Debug samples.

Import only the JSON project. It contains the complete Industrial motor simulator Function. The plain-text source under Resources is optional; do not add another simulator.The Inject node starts each sample. The Function calculates the motor readings, JSON serialization prepares the message, and the MQTT node sends it to ThingsBoard. Debug lets you inspect the same readings locally.
2

Link the motor device

In ThingsBoard, open Devices & assets → Devices → Industrial Motor 01. Select Manage credentials → Access token → Copy access token, or use its Copy access token shortcut.
Industrial Motor 01 device details and credential controls

The motor device's credential controls.

New to device access tokens? The Edge Setup guide shows step by step where to find a device’s MQTT connection details.In Node-RED, double-click Publish to ThingsBoard Cloud EU and edit its Server configuration. The download already has these connection settings; enter only your token under Security → Username:
Node-RED MQTT settings using port 8883, TLS and certificate verification

MQTT uses port 8883 with TLS and certificate verification.

Click Update → Done → Deploy. The Inject node sends every 5 seconds. Check that MQTT shows connected.If it stays disconnected, recheck the hostname, token and internet connection. Use the token belonging to Industrial Motor 01, not another device: that token determines which device receives the data.
Keep your token private. Never disable certificate verification or include the token in shared project files.
3

Check the data in ThingsBoard

  1. Open Devices & assets in ThingsBoard.
  2. Click Devices.
  3. Open Industrial Motor 01.
  4. Click Latest telemetry.
  5. Find speedRpm, the simulated motor speed.
  6. Watch its value and Last update time for at least 15 seconds. Timestamps should advance every 5 seconds.
  7. Open Dashboards.
  8. Open Motor RPM to see the gauge follow the speed.
Industrial Motor 01 Latest telemetry showing speedRpm and update time

Latest speedRpm and its update time.

Briefly pause the local publisher: timestamps should stop, then resume when you restart it. 0 RPM can simply mean that the simulated motor is stopped.
Motor RPM dashboard connected to the Node-RED simulation

The Motor RPM gauge follows the simulated speed.

Step 4 – Build the bigger dashboard with AI

AI layouts can vary. Use the same telemetry keys and supported widgets; the arrangement need not match the images exactly.
Open Motor RPM and click Configure with AI. Keep the existing device and refine the installed dashboard; do not click Create Solution again. Use built-in status cards, a ring or arc RPM gauge, charts and navigation. Keep the main screen focused on motor health; the Details view holds the secondary measurements.
Configure with AI panel beside the motor dashboard

Configure with AI opens beside the dashboard.

Paste this prompt:
Review each proposal, Approve the intended changes, and save. Check readability; request horizontal label-and-value cards if square cards make values too small. Check the rendered dashboard, not just the text proposal. Its widgets must still point to the existing motor device, with readings updating from Node-RED. Read cycle time only while motorOn=true: the simulator sends null for cycleTimeSec while stopped, and a widget may retain its last non-null value. To view your larger dashboard:
  1. Open Dashboards.
  2. Open Motor Overview.
  3. Watch the electrical values, RPM gauge and vibration chart change as the simulation runs.
  4. Click Details to see the secondary measurements.
  5. Click Back to return to the overview.
Motor Overview showing simulated readings and cleared alarms.

Step 5 – Add alarm conditions with AI

An Alarms Table displays alarms; the rules below create them.
1

Open the alarm assistant

Open Alarms → Alarm rules → Configure with AI. Confirm that the assistant targets Industrial Motor 01 before approving any changes.
Motor Fault, High Vibration and High Temperature alarm rules

The three motor alarm rules.

2

Give the alarm prompt

Check the target device, severities, and clear conditions before approving:Vibration uses one alarm type; Critical takes priority above 9 mm/s. Check device/profile scope and reuse matching rules, avoiding duplicates. These are simulation thresholds, not real-motor operating limits.
Want to compare with hand-built alarm rules? Step 5 of the Vibration Monitoring guide configures ISO 10816 alarm rules manually on a device profile, using real sensor data and calculated fields.
3

Check the result

Return to Motor Overview. Its Alarms Table must use the same device and show active and cleared alarms to reveal automatic clearing.The normal simulation may not cross every threshold during your check. Use the two controlled payloads below to demonstrate both alarm creation and clearing, then restore the repeating simulation.Pause the repeating Inject and startup injection, then Deploy. Add a non-repeating Inject with a JSON payload, connected directly to Serialize telemetry as JSON. Send:
Expect Motor Fault and High Vibration to be CRITICAL, and High Temperature to be WARNING. Send the following normal values to clear them:
Cleared alarms remain in history but disappear from an active-only table. Restore the five-second Inject and startup injection, then Deploy.

Where AI still needs a human

  • Unrequested resources: Review proposals and remove extras before approving.
  • Needle gauge: AI cannot select the analogue Speed gauge. Use the optional manual instructions below, or see the ISO-banded Speed gauge built by hand in the Vibration Monitoring guide.
  • Font size and scaling: These controls are not exposed in this AI workflow; use Edit mode when available.
  • Alarm history: AI cannot set a separate Alarms Table time window here. Select a longer global dashboard window for older alarms.
  • Rule scope: AI may attach rules to a device profile, affecting every device using it. Confirm the intended scope.

Your result – a bigger dashboard using AI-supported widgets

You now have electrical readings, motor status, speed, vibration, Details navigation and alarms that activate and clear. This completes the AI workflow.
AI-generated Motor Overview with RPM gauge, electrical readings, status cards, vibration chart and cleared alarms

Motor Overview with electrical readings, status cards, RPM, vibration and alarm history.

Use Edit mode for optional appearance changes, separate from the AI prompts and opening GIF. See Edge Setup Step 5: Create Dashboard for widget basics.To add a needle gauge, open Edit mode → Add widget → Analogue gauges → Speed gauge. Use the existing motor alias and speedRpm; set RPM, min 0, max 1600, and 0 decimal digits, then enable the digital value. For the pictured style, use Motor speed as the Units title, #048AD3 for Arrow and scale default color, and white for Plate color. Replace the old RPM widget and Save. See the Speed gauge guide.
Manual widget preview of the optional blue needle RPM gauge

The optional needle gauge in the manual widget preview.


Resources

Node-RED Motor Simulation Flow

The complete flow: five-second Inject, motor simulator Function, JSON serialization, secure MQTT output and Debug. Add only your device access token after import.

industrial-motor-cloud-flow.json

Simulator Source Code (optional)

The same Function code as plain text, for reading or building a flow manually. It is already included in the flow above; do not add it again.

industrial-motor-simulator.txt

ThingsBoard Dashboard and Alarm Rules

The Node-RED flow, the AI-generated Motor Overview dashboard export, all three alarm definitions and a README with import notes. No tokens or telemetry history are included.

motor-ai-example-project.zip

To learn how to import a dashboard and update its entity alias, refer to ThingsBoard (Edge Setup). Alarm rules are not part of the dashboard export; recreate them in your account with Step 5.

Further reading

Work With Me

I regularly test industrial automation and IIoT devices. If you’d like me to review your product or showcase it in my courses and YouTube channel: Email: rajvir@codeandcompile.com or drop me a message on LinkedIn