Simulator Guide

Goal: Test your workspace with simulated data before connecting real devices.


What is the Simulator?

The OpenIndustrial simulator:

FeatureDescription
Custom dataConfigure any telemetry structure you need
Three tabsSettings, Variables, and Template for full control
CustomizableAdjust data ranges, frequencies, device IDs
InstantData flows immediately after deployment

Use simulators for testing queries before connecting production devices. Same data shape, zero risk.


Prerequisites

  • Active workspace
  • At least one data connection created

Option A: Using the UI

Step 1: Add Simulator to Canvas

  1. Locate the Simulator in the Node Bank (flask icon, top of the left panel)
  2. Drag the Simulator onto the canvas

Step 2: Configure Settings

Click the Simulator node to open the Inspector. In the Settings tab:

SettingDescriptionExample
NameSimulator identifier"BreweryTelemetry"
Message Interval (ms)Milliseconds between messages5000 (5 seconds)
Messages per DeviceTotal messages to send (0 = infinite)0
Simulator Inspector showing the Settings tab with Name, Message Interval, and Messages per Device fields

Step 3: Define Variables

In the Variables tab, click Add Variable to create data points for things you want to simulate:

Variable NameTypeConfiguration
temperatureRandom IntegerMin: 65, Max: 75
humidityRandom IntegerMin: 40, Max: 60
pressureRandom FloatMin: 14.5, Max: 15.5

Available variable types:

TypeDescription
StaticFixed value that never changes
Random IntegerRandom whole number between min/max
Random FloatRandom decimal between min/max
IncrementingIncreases by 1 each message
Thinking Tip:

You only need to create variables for data you want to simulate. The deviceId (from your connection) and timestamp are automatically included.

Step 4: Define Message Template

In the Template tab, use the UI to map your variables to the message structure. Define field names and assign your variables to each field.

The Template UI lets you visually build your message structure without writing JSON directly.

Step 5: Connect to Data Connection

  1. Draw a line from the Simulator to your data connection node
  2. The edge will show "simulates" label
  3. Commit and deploy to start data flow

Option B: Ask Azi

Example prompts:

  • "Create a simulator for my connection with temperature and humidity"
  • "Add a simulator to brew-data that sends pressure readings every 5 seconds"
  • "Set up simulated telemetry for test-sensors"

Verifying Data Flow

After attaching the simulator:

  1. Click your data connection node
  2. Open the Inspector panel (right side)
  3. You should see impulses arriving:
{
  "timestamp": "2026-01-18T10:30:00Z",
  "deviceId": "sim-temp-01",
  "temperature": 72.5,
  "humidity": 45.2
}
Live data stream showing incoming telemetry
Thinking Tip:

Data should appear within 5-10 seconds. If not, check that the simulator is attached to the correct connection.


Customizing Simulator Output

You can adjust simulator behavior:

SettingWhat It Controls
FrequencyHow often data is generated (default: 5 seconds)
Device countNumber of simulated devices
Value rangesMin/max for numeric fields
NoiseRandomness in generated values

To Customize:

  1. Click the simulator node
  2. Open Inspector
  3. Adjust settings in the configuration panel
  4. Changes apply immediately

Troubleshooting

IssueSolution
No data appearingCheck simulator is attached (line should connect to data connection) and deployed
Data stoppedSimulator may have been paused - check status in Inspector
Wrong data formatUpdate your Variables and Template tabs to match expected structure
Too much dataIncrease the Message Interval (ms) in Settings tab
Thinking Tip:

Simulators run continuously while attached. Detach them when not testing to avoid unnecessary data accumulation.


Best Practices

  1. Test queries first - Build warm queries against simulated data before production
  2. Match data shapes - Configure simulators to match your real device schemas
  3. Clean up - Detach simulators after testing to keep workspace tidy
  4. Document settings - Note variable names and template structure for team members

Custom Code Simulators

For more complex simulation scenarios, you can write your own simulator in any language that supports the Azure IoT Hub SDK:

LanguagePackage
TypeScript/JavaScript@azure/iot-device
Pythonazure-iot-device
C#Microsoft.Azure.Devices.Client
Javacom.microsoft.azure.sdk.iot

Custom simulators connect the same way as real devices - using the device connection string from your Connection node.

Custom simulators are useful for: replay of historical data, complex state machines, integration testing, and simulating failure scenarios.

Getting the Connection String

  1. Click your Connection node to open the Inspector
  2. Find the Device Connection String in the connection details
  3. Use this string in your custom simulator code

Example: TypeScript Simulator

import { Client } from 'azure-iot-device';
import { Mqtt } from 'azure-iot-device-mqtt';

const connectionString = 'YOUR_DEVICE_CONNECTION_STRING';
const client = Client.fromConnectionString(connectionString, Mqtt);

async function sendTelemetry() {
  const message = {
    deviceId: 'custom-sensor-001',
    temperature: Math.random() * 10 + 65,
    humidity: Math.random() * 20 + 40,
    timestamp: new Date().toISOString()
  };

  await client.sendEvent(JSON.stringify(message));
  console.log('Sent:', message);
}

// Send every 5 seconds
setInterval(sendTelemetry, 5000);

Next Steps

If you want to...Go to...
Connect real devicesIoT Hub Guide →
Route data to surfacesSurfaces Guide →
Build queries on this dataWarm Queries Guide →

Simulators are your sandbox. Test everything here before production deployment.

On this page