Writing and importing values
Write single values with loot write, load CSV files with loot import, and upload files as values and download them again.
Overview#
You always write values to a node with a value type, and you need the Write permission on that node (Permissions). The server checks every value against the node's value type and rejects unsuitable ones with a reason.
| Command | Purpose |
|---|---|
loot write | Write a single value |
loot import | Write many values from a CSV file |
loot upload | Upload a file as the value of a custom node |
loot download | Download the content of a custom value into a file |
Receiving values from devices or measuring systems on a regular basis is a different task: use data sources and the device channel for that, not these commands.
loot write#
Writes a value into the time series of a node.
loot write <path> [<value>] [--ts <timestamp>]
[--lat <latitude> --lon <longitude> [--alt <altitude>] [--accuracy <meters>] [--speed <m/s>] [--heading <degrees>]]| Argument or option | Meaning |
|---|---|
<path> | Path of the node |
<value> | The value, matching the value type (see table). null means "no value" and applies to every value type. |
--ts <timestamp> | Timestamp of the value, ISO 8601 (default: now). Without an offset your local time applies, with --utc UTC. |
--lat <latitude> | Geo: latitude in degrees (−90 to 90), instead of the value argument |
--lon <longitude> | Geo: longitude in degrees (−180 to 180) |
--alt <altitude> | Geo: altitude in meters (optional) |
--accuracy <meters> | Geo: accuracy in meters (optional) |
--speed <m/s> | Geo: speed in meters per second (optional) |
--heading <degrees> | Geo: heading in degrees, from 0 to below 360 (optional) |
Either give <value> or, for geo nodes, --lat and --lon; both together do not work.
Values by value type
| Value type | Notation of <value> | Example |
|---|---|---|
int, long | Whole number | 42 |
float, double | Decimal number with a point, without thousands separator | 18.4 |
bool | true or false | true |
string | Any text | "Batch 4711" |
custom | Base64 text of the bytes. For files, loot upload is more convenient. | |
geo | latitude;longitude or latitude;longitude;altitude, or a JSON object with lat and lon, or the options --lat, --lon … | 48.137;11.575 |
compound | JSON object with the field names as keys; missing fields stay empty | '{"message":"Start","severity":2}' |
stream | not through loot write; you record streams (loot stream) |
Put values with spaces or JSON in quotation marks. On Linux and macOS wrap JSON in single quotes ('{"lat":48.137,"lon":11.575}'); the Windows PowerShell has its own rules for quotation marks in arguments.
$ loot write "Brewery/Plant.Line1.Temperature" 18.4
Wert geschrieben: Brewery/Plant.Line1.Temperature = 18.4 (2026-11-30T14:02:11.482913+01:00).With your own timestamp, in UTC:
$ loot write "Brewery/Plant.Line1.Temperature" 18.9 --ts 2026-11-30T13:05:00Z
Wert geschrieben: Brewery/Plant.Line1.Temperature = 18.9 (2026-11-30T14:05:00.000000+01:00).A truth value, a text and a record:
$ loot write "Brewery/Plant.Line1.Running" true
Wert geschrieben: Brewery/Plant.Line1.Running = true (2026-11-30T14:10:00.120331+01:00).
$ loot write "Brewery/Plant.Line1.Batch" "Batch 4711"
Wert geschrieben: Brewery/Plant.Line1.Batch = Batch 4711 (2026-11-30T14:10:05.804120+01:00).
$ loot write "Brewery/Plant.Line1.Alarm" '{"message":"Start","severity":2}'
Wert geschrieben: Brewery/Plant.Line1.Alarm = {"message":"Start","severity":2} (2026-11-30T14:10:09.311005+01:00).You write positions in three equivalent forms:
$ loot write "Brewery/Plant.Truck.Position" "48.137;11.575;520"
$ loot write "Brewery/Plant.Truck.Position" '{"lat":48.137,"lon":11.575}'
$ loot write "Brewery/Plant.Truck.Position" --lat 48.137 --lon 11.575 --alt 520 --speed 8.5 --heading 270
Wert geschrieben: Brewery/Plant.Truck.Position = 48.137, 11.575 (2026-11-30T14:12:30.771204+01:00).A "no value" value marks a gap, for example a sensor failure:
$ loot write "Brewery/Plant.Line1.Temperature" null --ts 2026-11-30T14:15:00
Wert geschrieben: Brewery/Plant.Line1.Temperature = (kein Wert) (2026-11-30T14:15:00.000000+01:00).Errors:
$ loot write "Brewery/Plant.Line1.Temperature" abc
Fehler: 'abc' ist kein gültiger Wert vom Typ Double (Dezimalpunkt, keine Tausendertrennung).If the server rejects the value (for example because of a missing write permission), loot reports Fehler: Der Wert wurde abgelehnt: … with the reason and exit code 1.
loot import#
Writes many values from a CSV file, also for several nodes at once.
loot import <csv> [--path <path>] [--separator <character>]| Argument or option | Meaning |
|---|---|
<csv> | Path of the CSV file |
--path <path> | Fixed node path for all rows. The file then has only the columns zeitstempel,wert. |
--separator <character> | Column separator, exactly one character (default: ,). For files from German-language spreadsheets usually ;. |
Structure of the CSV file#
Every row is one value. The columns are:
| Column | Content |
|---|---|
pfad | Path of the node (omitted with --path) |
zeitstempel | ISO 8601, for example 2026-11-30T14:00:00 or 2026-11-30T14:00:00+01:00 |
wert | The value in the notation of loot write |
The column names are the German words for path, timestamp and value, as loot expects them in the header line.
pfad,zeitstempel,wert
Brewery/Plant.Line1.Temperature,2026-11-30T13:00:00Z,18.4
Brewery/Plant.Line1.Temperature,2026-11-30T13:01:00Z,18.6
Brewery/Plant.Line1.Running,2026-11-30T13:00:00Z,true
Brewery/Plant.Line1.Batch,2026-11-30T13:00:00Z,"Batch 4711, Tank 2"The rules in detail:
- The header line is optional.
lootrecognizes it if the first cell of the first row ispfad,path,zeitstempel,timestamports(case does not matter). - Empty lines are skipped. A byte order mark at the start of the file does no harm.
- Timestamps without an offset are always UTC, not your local time and regardless of
--utc. CSV files usually come from systems that use UTC. With an offset (Z,+01:00) the offset applies. - Write decimal numbers with a point and without thousands separators. If your file uses
;as separator, the point stays the decimal character. - Quotation marks: A field may be enclosed in
", which is needed for fields containing the separator. Double a quotation mark inside the field (""). Fields do not span several lines. nullin the value column means "no value".- Records (compound): a JSON object in quotation marks whose quotation marks are doubled. Write geo values as
latitude;longitude[;altitude]or as JSON in the value column. If;is your separator, put the short form in quotation marks.
pfad,zeitstempel,wert
Brewery/Plant.Line1.Alarm,2026-11-30T13:05:00Z,"{""message"":""Start"",""severity"":2}"
Brewery/Plant.Truck.Position,2026-11-30T13:05:00Z,48.137;11.575;520With a fixed path and a semicolon as separator, a file looks like this:
zeitstempel;wert
2026-11-30T13:00:00;18.4
2026-11-30T13:01:00;18.6Procedure and result#
loot import works all or nothing for errors in the file: it first reads the whole file, resolves every path once and checks every value against the value type of its node. If it finds errors, it writes nothing and shows the first 20 errors with line numbers (exit code 1):
$ loot import messwerte.csv
Fehler: Zeile 3: Pfad 'Brewery/Plant.Line9.Temperature' existiert nicht.
Fehler: Zeile 7: 'warm' ist kein gültiger Wert vom Typ Double (Dezimalpunkt, keine Tausendertrennung).If the file is fine, loot sends the values in packages of 10,000 and reports the result:
$ loot import messwerte.csv
4 Werte angenommen, 0 abgelehnt.$ loot import temperatur.csv --path "Brewery/Plant.Line1.Temperature" --separator ";"
2 Werte angenommen, 0 abgelehnt.loot upload#
Uploads a file as the value of a custom node, for example a photo, a report or a configuration file. LooT stores files up to 64 KB in the database and larger ones in object storage.
loot upload <path> <file> [--ts <timestamp>] [--type <content-type>] [--name <file-name>]| Argument or option | Meaning |
|---|---|
<path> | Path of the custom node |
<file> | The file to upload |
--ts <timestamp> | Timestamp of the value, ISO 8601 (default: now) |
--type <content-type> | Content type, for example image/png (default: application/octet-stream) |
--name <file-name> | File name stored with the value (default: name of the file) |
$ loot upload "Brewery/Plant.Line1.Photos" tank.png --type image/png --ts 2026-11-30T14:30:00
Datei hochgeladen: Brewery/Plant.Line1.Photos (148223 Bytes, image/png, Object Storage) um 2026-11-30T14:30:00.000000+01:00.The output names size, content type and storage location (Datenbank for the database or Object Storage). The web interface shows images and videos as a gallery.
loot download#
Downloads the content of a custom value into a file.
loot download <path> --ts <timestamp> [-o <file>]| Argument or option | Meaning |
|---|---|
<path> | Path of the custom node |
--ts <timestamp> | Required. Timestamp of the value, exactly as loot query shows it |
-o <file>, --output <file> | Target file (default: the stored file name in the current directory) |
You take the timestamp from loot query, which shows size, content type and file name for custom nodes (Queries and live values):
$ loot query "Brewery/Plant.Line1.Photos"
Zeitstempel Größe [Bytes] Inhaltstyp Dateiname
-------------------------------- ------------- ---------- ---------
2026-11-30T14:30:00.000000+01:00 148223 image/png tank.png
$ loot download "Brewery/Plant.Line1.Photos" --ts 2026-11-30T14:30:00.000000+01:00 -o tank-yesterday.png
Inhalt gespeichert: tank-yesterday.png (148223 Bytes, image/png).