devices.json
devices.json in the workspace lists every device and background service. The Devices page writes it for you (New Python driver…, Add device…, Change…, Remove…), but it is plain JSON that you can also edit by hand or take from git. The server watches it: devices you add start, devices you remove stop, devices whose entry changed restart. A file that cannot be read is reported in the log, and the devices that run keep running.
{ "version": 1, "devices": { "vacuum_gauge": { "file": "devices/vacuum_gauge.py", "description": "Pfeiffer TPG 362 on the chamber", "config": { "port": "COM3", "simulate": false, "channel_names": ["Fore vacuum", "Chamber"] } }, "acq": { "driver": "picoscope_5000a", "config": { "auto_start": true } }, "stage": { "package": "laborchestra-elliptec==1.2", "entry": "elliptec", "config": { "port": "COM5" } }, "remote_gauge": { "remote": true } }}The key of each entry is the device’s id: snake_case, a valid Python name. Scripts use it (lab.vacuum_gauge), and recordings and the event history are kept by it, so change it only when you mean it.
What runs the device
Section titled “What runs the device”Exactly one of these:
| Field | The device is |
|---|---|
file |
a Python file, relative to the workspace (devices/vacuum_gauge.py), or shipped:<name> for a Python driver that comes with LabOrchestra (shipped:elliptec; used where it is, updated with LabOrchestra; Make my own copy to change it… on the Devices page replaces it by a file in devices/). If the file is removed or renamed, the Devices page says file missing and the device keeps running on what it had loaded. A file with a header of dependencies (PEP 723, # /// script) gets an environment with them. |
package |
a device of a Python package: a requirement (laborchestra-elliptec==1.2), a wheel, a folder (installed editable) or a git address. entry names the device when the package offers several (entry point group laborchestra.devices). |
driver |
a C# driver, built into LabOrchestra (simulated_oscilloscope, picoscope_4000a, picoscope_5000a) or from a plugin in plugins/. |
remote |
true: a Python device that runs on another computer and connects to the server with a token (Devices page, Remote workers). |
Other fields
Section titled “Other fields”| Field | Meaning |
|---|---|
config |
The options of the device: the class attributes of a Python device, the options class of a C# driver. Checked against their types when the device starts. |
description |
A line about the device, for people and for AI assistants. JSON has no comments: this is the place for one. |
python |
The Python for this device: a version ("3.12") or the path of an interpreter, for example a 32-bit one for a 32-bit vendor DLL. |
auto_restart |
true: restart the device by itself when its file changes. Off for devices (a restart may touch hardware), on for services. Never while a recording is going on. |
Options every device has
Section titled “Options every device has”| Option | Meaning |
|---|---|
channel_names |
What the channels are called in your lab, in their order: ["Fore vacuum", "Chamber"]. Offered for every device whose state has channels; the names appear on the dashboard, in scripts (channels.1.name) and in recordings. For a device with several channel lists, an object from the path of a list to its names: {"channels": [...], "generator.channels": [...]}. |
simulate |
Every driver that comes with LabOrchestra has it: run without the instrument, on simulated values, clearly marked as simulated. |
Secrets
Section titled “Secrets”Passwords and API keys never go into devices.json, which you may want to keep in git. Store them on the Devices page (Secrets) or with lab.set_secret("slack", "xoxb-..."), and refer to them by name:
"config": { "token": { "secret": "slack" } }The device gets the value; it never appears in the workspace, the logs or the state.
Something wrong or missing on this page? Open a GitHub issue or use the form (no account needed).