Connections, commands and devices
Connect nodes with each other and with commands, define and send commands, follow their history and try them out with the device simulator.
Basic concepts#
A connection passes every new value of a node automatically on to another node or to a command. A command is a named action on a node with typed parameters, for example Close valve with the parameter Duration. A device that is connected to LooT carries out the commands of its nodes and reports success or failure.
Connections and commands in the web interface are described in Connections and Commands. The path of a value into LooT is explained in The Path of Your Data.
| Command | Purpose |
|---|---|
loot connection list | Show the connections of a node |
loot connection create | Connect a source node with a target node or a command |
loot connection delete | Delete a connection |
loot command list | List the commands of a node |
loot command define | Define a command with parameters |
loot command delete | Delete a command |
loot command send | Trigger a command |
loot command history | Show the history of triggers |
loot device run | Start the device simulator for development and tests |
Of these commands only loot connection list supports --json.
Rules for connections in short: an output can feed any number of connections, an input has at most one incoming connection. Every connection has a level, the common parent node of both ends. Cycles are not allowed. Direction and permissions are explained in Connections and Commands.
loot connection list#
Shows the connections of a node: incoming, outgoing and those that have the node as their level.
loot connection list <path> [--json]| Argument or option | Meaning |
|---|---|
<path> | Node whose connections are shown |
--json | Print the connections as JSON |
$ loot connection list "Brewery/Plant.Line1"
Id Quelle Ziel Ebene Umwandlung Problem
-- ------ ----------------- ----- ------------ -------
12 103 110 102 IntegerToReal
13 103 111: Close valve 102 -The columns show the connection id, the source and target (node ids; for a command target the node id, the command name and, in brackets, the parameter), the level (node id) and the conversion. A dash stands for "no conversion". A text in the Problem column says why a connection currently does not work, for example because a permission is missing.
loot connection create#
Creates a connection from a source node to a target node or to a command of the target node. You need Manage on the level, Read on the source and Write on the target, or Execute on the command node.
loot connection create <source> <target> [--command <name>] [--param <parameter>] [--scope <path>]
[--conversion <kind>] [--rounding <Round|Truncate>] [--threshold <number>]
[--expires <seconds>]| Argument or option | Meaning |
|---|---|
<source> | Path of the source node (direction out or inout) |
<target> | Path of the target node (direction in or inout), or of the node that carries the command |
--command <name> | The target is this command of the target node instead of its value |
--param <parameter> | Only with --command: the parameter that receives the value. Without it the value triggers a command that has no parameters. |
--scope <path> | Level of the connection (node path). Default: the deepest common ancestor of source and target. |
--conversion <kind> | Conversion when the value types differ: BoolToNumber, IntegerToReal, NumberToBool, RealToInteger, TextToValue or ToText |
--rounding <Round|Truncate> | For RealToInteger: Round (default) or Truncate |
--threshold <number> | For NumberToBool: true from this value on. Without it every value other than 0 is true. |
--expires <seconds> | For command targets: lifetime of the triggers in seconds (default 300) |
--param without --command ends with exit code 2. If the value types of source and target differ, loot checks first and tells you which conversion is needed; repeat the command with --conversion:
$ loot connection create "Brewery/Plant.Line1.Counter" "Brewery/Plant.Line1.Temperature"
Fehler: Die Werttypen verlangen eine Umwandlung: --conversion IntegerToReal.
$ loot connection create "Brewery/Plant.Line1.Counter" "Brewery/Plant.Line1.Temperature" --conversion IntegerToReal
Verbindung 12 angelegt (Ebene 102).| Conversion | Meaning |
|---|---|
IntegerToReal | Integer to floating point number |
RealToInteger | Floating point number to integer, rounded or truncated (--rounding) |
NumberToBool | Number to bool: not 0, or with --threshold from the threshold on |
BoolToNumber | Bool to number (0 or 1) |
ToText | Number or bool to text |
TextToValue | Text to number or bool |
A connection to a command: a value that arrives at the source triggers the command and sets the named parameter; the other parameters get their default value.
$ loot connection create "Brewery/Plant.Line1.Level" "Brewery/Plant.Line1.Valve" --command "Close valve" --param Duration --conversion RealToInteger --rounding Truncate --expires 600
Verbindung 13 angelegt (Ebene 102).A connection to a command is allowed only if all other required parameters have a default value, and it triggers only when the value has changed.
loot connection delete#
Deletes a connection. Needs Manage on the level.
loot connection delete <id>| Argument | Meaning |
|---|---|
<id> | Id of the connection (from loot connection list) |
$ loot connection delete 13
Verbindung 13 gelöscht.loot command list#
Lists the commands of a node with their parameters.
loot command list <path>| Argument | Meaning |
|---|---|
<path> | Path of the node |
$ loot command list "Brewery/Plant.Line1.Valve"
Name Parameter Beschreibung
----------- ----------------------------- ------------------------
Close valve Duration:Int=10, Mode:String* Closes the valve safelyA parameter is shown as name:type, with =value for the default value and a * for a required parameter. A dash (–) stands for "no parameters".
loot command define#
Defines a command on a node. Needs the Manage permission on the node.
loot command define <path> <name> [--description <text>] [--param <definition>]… [--replace]| Argument or option | Meaning |
|---|---|
<path> | Path of the node |
<name> | Name of the command, for example "Close valve" |
--description <text> | Description |
--param <definition> | Parameter, repeatable. Format below. |
--replace | Replace an existing command of the same name together with its parameters |
Format of a parameter definition:
name:type[;required][;default=value][;min=number][;max=number][;allowed=a|b|c][;description=text]| Part | Meaning |
|---|---|
name:type | Name and value type of the parameter, for example Duration:Int. The type is a value type name such as Int, Long, Float, Double, Bool or String; case does not matter. |
required | The parameter must be given when triggering |
default=value | Default value for parameters that are not given |
min=number, max=number | Smallest and largest allowed value |
allowed=a|b|c | Allowed values, separated by | |
description=text | Description of the parameter |
Put the whole --param text in quotation marks so that your shell does not interpret ; and |.
$ loot command define "Brewery/Plant.Line1.Valve" "Close valve" --description "Closes the valve safely" --param "Duration:Int;default=10;min=1;max=60" --param "Mode:String;required;allowed=fast|slow"
Kommando 'Close valve' an 'Brewery/Plant.Line1.Valve' angelegt (2 Parameter).If a command of that name already exists, loot reports a conflict. Add --replace to overwrite it; the message then reads ersetzt instead of angelegt.
loot command delete#
Deletes a command. Needs Manage on the node. Triggers that are still waiting fail; the history stays.
loot command delete <path> <name>| Argument | Meaning |
|---|---|
<path> | Path of the node |
<name> | Name of the command |
$ loot command delete "Brewery/Plant.Line1.Valve" "Close valve"
Kommando 'Close valve' an 'Brewery/Plant.Line1.Valve' gelöscht.loot command send#
Triggers a command. Needs the Execute permission on the node.
loot command send <path> <name> [--param <name=value>]… [--expires <duration>] [--wait] [--timeout <seconds>]| Argument or option | Meaning |
|---|---|
<path> | Path of the node |
<name> | Name of the command |
--param <name=value> | Value of a parameter, repeatable. Parameters you leave out take their default value. |
--expires <duration> | How long the trigger waits for a device before it expires: 90s, 30m, 12h or 7d; a number without a unit means seconds. Default 24h, at most 30d. |
--wait | Wait for the result of the device. Exit code 0 only on success. |
--timeout <seconds> | Waiting time for --wait (default 30) |
$ loot command send "Brewery/Plant.Line1.Valve" "Close valve" --param Mode=fast --wait
Kommando 'Close valve' an 'Brewery/Plant.Line1.Valve' ausgelöst (Auslösung 57, ausstehend, läuft ab 2026-12-01T14:30:00.000000+01:00).
Status: zugestellt
Status: erfolgreich
Erfolgreich: Vom Gerätesimulator ausgeführt.A trigger goes through the states ausstehend (stored, no device has confirmed yet), zugestellt (a device received it), then erfolgreich or fehlgeschlagen; one that no device accepted in time becomes abgelaufen. With --wait, loot prints every change of state. If the command fails, it prints Fehler: Das Kommando ist fehlgeschlagen: … and exits with code 1; if the waiting time runs out first, it reports the current state, also with exit code 1. The trigger itself keeps running; follow it with loot command history.
loot command history#
Shows the history of the triggers on a node. The history covers 90 days.
loot command history <path> [--limit <count>] [--status <status>]| Argument or option | Meaning |
|---|---|
<path> | Path of the node |
--limit <count> | Maximum number of entries, the newest first |
--status <status> | Show only this status: delivered, expired, failed, pending or succeeded |
$ loot command history "Brewery/Plant.Line1.Valve" --limit 2
Id Ausgelöst Kommando Parameter Status Von Meldung
-- -------------------------------- ----------- ---------------------- ----------- ----- -------------------------------
57 2026-11-30T14:30:00.000000+01:00 Close valve Duration=10, Mode=fast erfolgreich alice Vom Gerätesimulator ausgeführt.
56 2026-11-30T09:12:41.000000+01:00 Close valve Duration=10, Mode=slow abgelaufen aliceloot device run#
Starts a device simulator: a small device for development and tests. It connects to LooT, accepts commands for the nodes you name, acknowledges each one and reports success or failure. It runs until you press Ctrl+C.
loot device run [--node <path>]… [--subtree <path>]… [--pattern <pattern>]… [--feed <path>]…
[--feed-interval <seconds>] [--name <name>] [--fail] [--delay <seconds>]
[--demo | --client-id <id> --client-secret <secret>]You need at least one of --node, --subtree, --pattern (commands) or --feed (values).
| Option | Meaning |
|---|---|
--node <path> | Node for which the device accepts commands, repeatable |
--subtree <path> | Root of a subtree: the device accepts commands for all nodes in it, repeatable |
--pattern <pattern> | Path pattern with * for exactly one node level, for example Brewery/Plant.*.Valve, repeatable |
--feed <path> | Node with a double time series to which the device writes rising values continuously, repeatable. Needs the Write permission. |
--feed-interval <seconds> | Seconds between two values for --feed (default 1, greater than 0) |
--name <name> | Name of the device (default loot-cli@<computer name>) |
--fail | Answer every command with a failure |
--delay <seconds> | Seconds between the acknowledgement and the result (default 0) |
--demo | Sign in as the client loot-device-demo of the development environment (client credentials). Excludes --client-id. |
--client-id <id> | Keycloak client of the device (client credentials). Without it the sign-in of loot login applies. |
--client-secret <secret> | Secret of the client. Required with --client-id. |
The device needs Read and Execute on its nodes (Write in addition for --feed). A device that signs in as a client is a service account: it appears on the first connection and must then be made a tenant member and given these permissions (see Permissions).
$ loot device run --node Brewery/Plant.Line1.Valve --feed Brewery/Plant.Line1.Temperature --delay 2
Gerät 'loot-cli@workstation' verbindet sich …
Verbunden (Sitzung 3f2a9c).
Brewery/Plant.Line1.Valve: zuständig (Node 111)
Warte auf Kommandos … (Strg+C beendet)
Kommando 'Close valve' (Auslösung 57, Node 111) mit Duration=10, Mode=fast
-> erfolgreich gemeldetIf a node is refused, the line names the reason; if no node is accepted at all, loot says so (Für keinen Node zuständig; es kommen keine Kommandos an.). If the connection drops, the simulator reconnects after one to 30 seconds and renews its sign-in token while running. Exit code 1 only means that there are no credentials or they were refused for good.
Example: try out a command#
Two terminals show the whole path of a command.
- Define the command (terminal 2):
loot command define "Brewery/Plant.Line1.Valve" "Close valve" --param "Duration:Int;default=10;min=1;max=60". - Start the simulator (terminal 1):
loot device run --node Brewery/Plant.Line1.Valve. - Trigger the command (terminal 2):
loot command send "Brewery/Plant.Line1.Valve" "Close valve" --param Duration=30 --wait. - Look at the history:
loot command history "Brewery/Plant.Line1.Valve". - To trigger the command automatically, connect a node to it:
loot connection create … --command "Close valve" --param Duration.
For data from devices that do not accept commands see Data sources.