Spanish Total.js
Slovenčina
Dokumentácia Pre AI agentov
Obsah

Simulations

Replay readings from a CSV file to an endpoint to test drivers and devices without hardware.

.md Web

Táto stránka ešte nie je preložená. Čítaš originál.

Na tejto stránke

A simulation sends the rows of a CSV file to an address, one row at a time, at a frequency you choose. Use it to test a driver, a device or a zone before the hardware is installed.

The Simulations screen with a running simulation

Add an endpoint

An endpoint is the address the simulation sends to, usually the address of a driver on your stream.

  1. Open Simulations and select Endpoints.
  2. Select Add endpoint.
  3. Fill in the Name and the URL, for example https://stream.example.com/demoweather/.
  4. If the driver expects a token, fill in Token. The simulation sends it in the x-token header.
  5. Select SUBMIT.

The list of endpoints

Prepare the CSV file

The first line holds the names of the fields of the JSON that the simulation sends. Put + in front of a name to send the value as a number. Each next line is one message.

sn,+temperature,+humidity,+battery
WS-0002,16.2,61,60
WS-0002,16.0,62,60
WS-0002,15.8,63,59

The first data line becomes this message:

{ "sn": "WS-0002", "temperature": 16.2, "humidity": 61, "battery": 60 }

Create a simulation

  1. Select Create.
  2. Select the File field and choose the CSV file. The name of the file becomes the name of the simulation.
  3. Choose the Endpoint.
  4. Set the Frequency in minutes, for example 1 sends one row every minute.
  5. Check Launch to start right away. Check Data circulation to start again from the first row after the last one.
  6. Select SUBMIT.

The Create simulation form

Without Data circulation, the simulation stops after the last row and Launched turns off. To run it again, open it, check Launch and submit.

Vyrobené v Európe