Analysis on the command line
Compute spectra and spectrogram tiles, forecast time series, and put questions about a tenant to a language model with loot spectrum, loot forecast and loot ask.
Overview#
Three commands use the analysis service of LooT. They compute on the server, with your permissions, and print the result as a table, CSV or JSON:
| Command | Purpose |
|---|---|
loot spectrum | Spectrum or spectrogram tile of a time series or an audio recording |
loot forecast | Forecast of number series with a prediction model, optionally written into nodes |
loot forecast models | Prediction models allowed for a tenant |
loot ask | Question to a language model that reads the tenant's time series with tools |
loot ask models | Language models allowed for a tenant |
The workbench offers the same functions, see Analysis. Their requirements apply here as well: for forecast and questions, AI analysis must be switched on for the tenant, and you need the tenant permission Use forecasts or Ask AI (tenant admins and system admins always have them).
loot finds the analysis service by itself if the address of the query server starts with query.: it then replaces that prefix by analysis.. Otherwise you enter the address once with loot login --analysis-server <address> (see Signing in). Without a known address the commands end with the message Kein Analysedienst bekannt: … and exit code 2.
loot spectrum#
Computes the spectrum of a node for a time range: which frequencies occur how strongly. The node is either a time series of the type Int, Long, Float or Double (for example a vibration sensor) or a stream node with audio (wav, raw, mp4). A spectrum of other node types does not exist.
loot spectrum <path> --from <time> --to <time> [--session <id> | --latest-session]
[--fft-size <n>] [--window <function>] [--overlap <percent>]
[--averaging <list>] [--alpha <factor>] [--density] [--remove-mean]
[--channel <n|mix>] [--rate <hz>]
[--raw <u8|s16|f32>] [--raw-channels <n>] [--raw-rate <hz>]
[--csv | --json]
loot spectrum <path> --spectrogram --level <n> --tile <n> [--rate <hz>] [-o <file>] …| Argument or option | Meaning |
|---|---|
<path> | Path of the node: time series or stream node |
--from <time>, --to <time> | Range (start inclusive, end exclusive). Required for the spectrum, optional for tiles (there only used to pick the recording). --to must lie after --from. |
--session <id> | Stream nodes: id of the recording session (column Sitzung of loot stream list) |
--latest-session | Stream nodes: the most recent session (with --from and --to: the most recent one in the range). Mutually exclusive with --session. |
--fft-size <n>, --fft <n> | FFT size, a power of two from 256 to 65536. Default: 4096. |
--window <function> | Window function: hann (default), hamming, blackmanharris, rectangular or flattop |
--overlap <percent> | Overlap of the windows in percent: 0, 50 (default) or 75 |
--averaging <list> | Kind of averaging, one column per entry, separated by commas: mean (Welch), max (peak hold), exponential. Default: mean,max. |
--alpha <factor> | Factor of the exponential averaging, above 0 up to 1. Default: 0.25. |
--density | Power density (dB/Hz) instead of amplitude |
--remove-mean | Subtracts the mean from every frame (the DC component). Sensible for time series. |
--channel <n|mix> | Streams: channel counted from 0 (default 0) or mix (mean of all channels) |
--rate <hz> | Time series: sampling rate in Hz instead of the median of the time gaps. Required for --spectrogram. |
--raw <u8|s16|f32> | raw streams: interpretation of the bytes as u8, s16 or f32 (little endian). Without it: u8, one channel. |
--raw-channels <n> | raw streams: number of channels, 1 to 32. Default: 1. |
--raw-rate <hz> | raw streams: sampling rate in Hz (default: derived from the bytes per second of the node) |
--csv | Spectrum as CSV (comma, decimal point) instead of a table |
--json | Spectrum as JSON instead of a table. Not together with --csv. |
--spectrogram | Spectrogram tile instead of the spectrum (see below) |
--level <n> | Spectrogram: level 0 to 40; a column combines 2^level frames |
--tile <n> | Spectrogram: index of the tile (256 columns per tile, also negative) |
-o, --out <file> | Spectrogram: saves the tile as a binary file (format LSG1) instead of printing CSV |
Options for streams (--session, --latest-session, --channel, --raw…) are rejected on time series, and --rate on streams (use --raw-rate there). For a stream node you must name a session with --session or --latest-session. --raw and --raw-rate apply only to streams in the raw format.
Spectrum of a time series#
The vibration of line 1 over one hour; the sensor delivers 1024 values per second:
$ loot spectrum "Brewery/Plant.Line1.Vibration" --from 2026-11-30T08:00 --to 2026-11-30T09:00 --rate 1024 --fft-size 256 --remove-mean
Spektrum über 28797 Frames, Abtastrate 1024 Hz, FFT 256, Auflösung 4 Hz, 2026-11-30T08:00:00.000000+01:00 bis 2026-11-30T09:00:00.000000+01:00
Frequenz [Hz] Mittel [dB re 1 mm/s²] Maximum [dB re 1 mm/s²]
------------- ---------------------- -----------------------
0 -62.41 -48.07
4 -31.18 -22.64
8 -29.77 -20.19
12 -44.02 -35.51
…There is one row per frequency bin: FFT size / 2 + 1 rows, so 2049 with the default 4096. For long tables use --csv or a smaller --fft-size. The level is relative: for time series in dB relative to 1 <unit>² (here dB re 1 mm/s²), for audio in dBFS; with --density the unit gets /Hz.
Without --rate, the server takes the median of the time gaps as the sampling rate. That only makes sense for a regularly sampled series; for irregular data give the rate explicitly.
Spectrum of an audio recording#
For a stream node you choose a recording session. Analyze the most recent one, mixed over all channels:
$ loot spectrum "Brewery/Plant.Line1.Microphone" --latest-session --from 2026-11-30T00:00 --to 2026-12-01T00:00 --channel mix --window hann --averaging mean --csv
frequency_hz,mean_db (dBFS)
0,-98.12
11.719,-91.40
23.438,-88.05
…--from and --to are required here too and give the range that is analyzed; together with --latest-session they also restrict the search to that range. The sessions of a node are listed by loot stream list.
loot prints warnings on the error output when the result has limits: Hinweis: Unvollständig – … (the range reaches beyond the existing data, for example a recording still in progress), Hinweis: Stichprobe – … (the range exceeds the limit of the service; an evenly distributed selection of frames was computed), Hinweis: Abgeschnitten – … (the input data hit an upper limit; shorten the range) and Hinweis: Kein vollständiger Frame im Zeitraum … (too little data for the FFT size; choose a smaller --fft-size or a longer range).
A raw stream carries no format information of its own and needs a hint on how to read it:
$ loot spectrum "Brewery/Lab.Probe" --session 3f2a9c0e5b6d4e1f8a7b2c3d4e5f6a7b --from 2026-11-30T10:00 --to 2026-11-30T10:05 --raw s16 --raw-channels 2 --raw-rate 44100 --jsonJSON and CSV#
--csv prints the header frequency_hz followed by one column <averaging>_db (<unit>) per averaging, for example mean_db (dBFS). --json prints one object with the details of the result and the bins:
{
"nodeId": 108,
"sessionId": null,
"from": "2026-11-30T08:00:00.000000+01:00",
"to": "2026-11-30T09:00:00.000000+01:00",
"sampleRate": 1024,
"fftSize": 256,
"binWidth": 4,
"window": "hann",
"overlap": 50,
"scaling": "amplitude",
"unit": "dB re 1 mm/s²",
"frameCount": 28797,
"flags": [],
"bins": [
{ "frequency": 0, "mean": -62.41, "max": -48.07 },
{ "frequency": 4, "mean": -31.18, "max": -22.64 }
]
}Spectrogram tiles#
A spectrogram shows the spectrum over time. It is cut into tiles of 256 columns each. --level sets how coarse it is (a column combines 2^level frames, so level 0 is the finest), --tile which tile is meant (negative values are allowed). For time series, --rate is required, because it fixes the grid and the time of every tile. For streams, --from and --to only serve to pick the session with --latest-session.
$ loot spectrum "Brewery/Plant.Line1.Vibration" --spectrogram --level 3 --tile 0 --rate 1024 --fft-size 256 -o vibration-tile0.lsg
Kachel 0 auf Stufe 3: 256 Spalten zu je 8 Frames (1 s), ab 2026-11-30T06:12:40.000000+01:00, 1024 Hz, 129 Bins, -96.80 bis -18.42 dB re 1 mm/s²
Kachel gespeichert: vibration-tile0.lsg (LSG1, 132192 Bytes).The description of the tile goes to the error output, the file name or the data to the normal output. Without -o, a CSV matrix is printed: the first row has the start times of the columns, then one row per frequency; an empty cell means that there is no data. --csv and --json do not apply to tiles. The workbench shows the same tiles in the spectrogram chart (Analysis).
loot forecast#
Extends one or more number series into the future with a prediction model. The targets are nodes with a numeric time series of one tenant.
loot forecast <path>… --from <time> --to <time> (--horizon <duration> | --steps <n>)
[--step <duration>] [--with <path>]… [--suggest-covariates]
[--aggregation <function>] [--quantiles <list>] [--model <id>]
[--write [--target <series=path>]… [--create-targets]]
[--csv | --json]| Argument or option | Meaning |
|---|---|
<path>… | One or more target nodes (numeric time series of one tenant) |
--from <time> | Required. Start of the history the model learns from (inclusive) |
--to <time> | Required. End of the history (exclusive); the forecast begins here |
--horizon <duration> | How far to forecast, as a duration such as 12h, 7d or PT12H |
--steps <n> | Horizon as a number of grid steps, at least 1 (instead of --horizon). Give exactly one of --horizon and --steps. |
--step <duration> | Grid step such as 15m or 1h. Without it the server picks one from the history and the density of the values. |
--with <path> | Covariate: another node as an influencing factor. Repeatable. Values after --to count as known future. |
--suggest-covariates | Also takes the suggested covariates: connected and neighboring number nodes with values in the history (in addition to --with) |
--aggregation <function> | How the values within one grid step are combined: avg (default), min, max, sum, first or last |
--quantiles <list> | Quantiles in addition to the median, separated by commas, each between 0 and 1 with a decimal point. Default: 0.1,0.9. |
--model <id> | Id of the model. Default: the default model of the tenant (see loot forecast models). |
--write | Writes the forecast into target nodes. Values from the first forecast time on are deleted there first. |
--target <series=path> | Target node for one series: median=<path> or 0.9=<path>; with several targets <target>:median=<path>. Repeatable, only with --write. |
--create-targets | With --write without --target: creates the suggested target nodes that do not exist yet (type Double, setting last for equal timestamps) |
--csv | Prints CSV (comma, decimal point) instead of a table |
--json | Prints the response of the analysis service as JSON. Not together with --csv. |
A first forecast of the wort temperature for the next 12 hours, learned from the last week with an hourly grid:
$ loot forecast "Brewery/Plant.Line1.Temperature" --from 2026-11-23T00:00 --to 2026-11-30T00:00 --horizon 12h --step 1h
Modell forecast-small (1.0), Schritt 1h, Verlauf ab 2026-11-23T00:00:00.000000+01:00 mit 168 Punkten.
Zeit Temperature [°C] Temperature P10 Temperature P90
-------------------------------- ---------------- --------------- ---------------
2026-11-30T00:00:00.000000+01:00 78.1 77.2 79
2026-11-30T01:00:00.000000+01:00 78.3 77.1 79.4
…The summary line names the model, the grid and the number of history points (and how many of them had no value). The columns show the median, followed by one column per quantile (P10 and P90 for 0.1 and 0.9).
With covariates you give the model additional information. Values of a covariate after --to count as known future, for example a planned setpoint:
$ loot forecast "Brewery/Plant.Line1.Temperature" --from 2026-11-23T00:00 --to 2026-11-30T00:00 --steps 24 --step 30m --with "Brewery/Plant.Line1.Setpoint" --suggest-covariates
Kovariaten (Vorschlag): Pressure (verbunden), Ambient (benachbart, mit Zukunft).
Modell forecast-small (1.0), Schritt 30m, Verlauf ab 2026-11-23T00:00:00.000000+01:00 mit 336 Punkten, 2 Kovariate(n) mit bekannter Zukunft.
…With --csv or --json, the standard output stays machine readable: notes such as the covariate suggestion then go to the error output, and the CSV timestamps are in UTC.
Writing the forecast into nodes#
With --write, the forecast is stored permanently. You need the Write permission on the target nodes. Without --target, loot takes the targets the analysis service suggests: existing matching nodes are used, missing ones must be created with --create-targets. Otherwise loot shows what it suggests and ends with exit code 1:
$ loot forecast "Brewery/Plant.Line1.Temperature" --from 2026-11-23T00:00 --to 2026-11-30T00:00 --horizon 12h --write
Diese Ziel-Nodes gibt es noch nicht; mit --create-targets anlegen oder mit --target eigene wählen:
Reihe Name Unter Einheit
----- ---- ----- -------
…
Ziel-Nodes fehlen.The table lists series, suggested name, parent node and unit of every missing target. With --create-targets the nodes are created and filled:
$ loot forecast "Brewery/Plant.Line1.Temperature" --from 2026-11-23T00:00 --to 2026-11-30T00:00 --horizon 12h --write --create-targets
Ziel-Node 'Temperature_forecast' angelegt (210).
…
Geschrieben: 36 Werte in 3 Ziel-Node(s), vorher 0 Werte ab dem ersten Prognose-Zeitpunkt gelöscht.To choose the targets yourself, map each series to a node. With one target you can write the series directly, with several targets the target comes first (<target>:median=<path>):
$ loot forecast "Brewery/Plant.Line1.Temperature" --from 2026-11-23T00:00 --to 2026-11-30T00:00 --horizon 12h --write --target median="Brewery/Plant.Line1.TempForecast" --target 0.9="Brewery/Plant.Line1.TempForecastHigh"A target of the type Int or Long is rounded (the output says in how many nodes). If values are rejected, the line Geschrieben: … names the reasons and the command ends with exit code 1. The target needs a number value type; for a new forecast to replace the old one at equal timestamps, the node needs the setting last for equal timestamps (see Nodes). There is no forecast history.
loot forecast models#
Lists the prediction models that are allowed for a tenant.
loot forecast models --tenant <tenant>| Option | Meaning |
|---|---|
--tenant <tenant> | Required. Name or id of the tenant |
$ loot forecast models --tenant Brewery
Modell Erreichbar Name Version Lizenz Gerät Verlauf Horizont Kann
------------------------- ---------- -------------- ------- ---------- ----- ------- -------- ---------------------------
forecast-small (Standard) ja Forecast Small 1.0 Apache-2.0 cpu 2048 64 mehrere Ziele, Kovariaten
forecast-large nein – – – – – – –(Standard) marks the default model of the tenant, Erreichbar says whether the model is running right now. Verlauf and Horizont are the limits of the model: the longest history in points and the longest horizon in grid steps. Kann lists special abilities: several targets at once, covariates, covariates with a known future.
loot ask#
Puts a question to a language model that searches and reads the tenant's nodes with tools. It sees only what you may see.
loot ask [<question>] --tenant <tenant> [--model <id>] [--trace] [--json] [--allow-write]| Argument or option | Meaning |
|---|---|
<question> | The question, in quotation marks. Without a question, a session starts (see below). |
--tenant <tenant> | Required. Name or id of the tenant in which to search and read |
--model <id> | Language model. Default: the default model of the tenant (see loot ask models). |
--trace | Shows the tool calls of the model with parameters, shortened result and duration, and at the end the model, rounds, time and token counts |
--json | Prints the response of the analysis service as JSON (with the log of the tool calls) instead of the answer text |
--allow-write | The model may write values directly into nodes (needs the Write permission on the node; no further confirmation) |
$ loot ask "What was the average wort temperature on line 1 yesterday?" --tenant Brewery
Yesterday the average wort temperature on line 1 was 78.2 °C (minimum 74.9 °C at 03:10, maximum 79.6 °C at 14:45).An answer often takes one to several minutes. With --trace you see where the numbers come from:
$ loot ask "Which nodes on line 1 have values from the last hour?" --tenant Brewery --trace
→ search_nodes({"query":"Line1"}) 180 ms: [{"id":103,"path":"Brewery/Plant.Line1.Temperature"}, …
→ get_latest_values({"nodes":[103,104,105]}) 95 ms: …
Temperature, Pressure and Alarm have values from the last hour.
[chat-default, 2 Runde(n), 41.3 s, Token 5210/162]The tool names and parameters in the log are those of the analysis service and may change; they only serve to trace the answer.
Sessions#
Without a question, loot ask starts a session: you type one question per line, and an empty line or exit ends it. Earlier questions and answers serve as context, but only until the end of the run; nothing is stored.
$ loot ask --tenant Brewery
Sitzung: je Zeile eine Frage, leere Zeile oder 'exit' beendet. Der Verlauf bleibt nur bis zum Ende dieses Laufs.
> How many nodes does line 1 have?
Line 1 has 12 nodes, 9 of them with a time series.
> And which of them are currently in alarm?
No node of line 1 is in alarm at the moment.
>The prompt > and notes go to the error output, the answers to the normal output.
Actions the model proposes#
With --allow-write, the model may write values on its own. Irreversible actions (deleting, changing permissions, sending a command) it never executes itself: it only proposes them, and loot shows a summary and asks:
Aktion: <summary of the action>
<method> <path>
Ausführen? [j/N]Only j, ja, y or yes carries it out (the service checks the permissions once more, and loot then prints Ausgeführt (HTTP …). or Fehlgeschlagen: …); anything else, including the end of the input, discards it with Verworfen.. With --json, loot does not ask: the actions appear in the log.
loot ask models#
Lists the language models that are allowed for a tenant.
loot ask models --tenant <tenant>| Option | Meaning |
|---|---|
--tenant <tenant> | Required. Name or id of the tenant |
$ loot ask models --tenant Brewery
Modell Erreichbar
----------------------- ----------
chat-default (Standard) ja
chat-large neinThe built-in help of loot ask models also lists the argument <frage> of the parent command; the command itself needs only --tenant.