Coreflux LoT Notebooks
Coreflux LoT Notebooks is the official Visual Studio Code extension for the Language of Things (LoT) DSL by Coreflux. It turns .lotnb files into rich interactive notebooks that talk directly to your Coreflux MQTT broker — edit, upload, monitor, and manage your entire IoT system without leaving your editor.
Core features
1. LoT Language notebook
Create or open .lotnb files to get a notebook UI with full LoT syntax support.
- Code cells for
DEFINE ACTION, DEFINE MODEL, DEFINE CONNECTOR, DEFINE RULE, DEFINE AGENT, DEFINE THING, DEFINE PANEL (rendered in Coreflux Hub) and Python scripts
- Markdown cells with a formatting toolbar (bold, italic, code, headings, tables, lists…) and
Ctrl+B / Ctrl+I / Ctrl+K keybindings
- Syntax highlighting, code completions (
Ctrl+Space), and clickable topic links
- Starter code for common route types (Modbus TCP/RTU, Siemens S7, OPC UA)
2. Broker sync
Run (▶) on a cell uploads it to the broker with -addModel / -addAction / -addRule / -addRoute / -addVisu / -addPython / -addThing and reports the broker's confirmation — or its error, with the offending line and column — in the cell output. Nothing is assumed to have worked until the broker says so.
Download ($(cloud-download)) in the cell toolbar pulls the broker's version of the entity back into the cell. If the cell already matches, nothing changes. The Coreflux Explorer offers the same action per entity with Update Cell from Coreflux.
Cell status bar shows where the cell stands against the broker — Synced, Unsynced, Not deployed or Invalid — with $(check) On broker when it matches and a $(cloud-upload) Upload to broker button when it differs.
3. Broker view
The Broker view in the Coreflux sidebar shows the connected broker, live:
- LoT: what is deployed on the broker: Models, Actions, Rules, Routes, Agents, Python scripts and Things. Routes and Things show running, degraded or error. Runtime opens the LoT runtime settings.
- Projects: projects stored on the broker, with inline Run / Stop
- System: sessions, clients and built-in rules
- Data Viewer, Logs, Vault (secrets and variables), License and MCP Server, each opening an editor tab
Right-click any entity to: copy code, go to cell, push cell to broker, pull from broker, create a definition, remove from broker, or remove all of a category.
The same list opens as an editor tab from the ⧉ icon on the LoT row.
4. Data Viewer
Live MQTT topic tree in an editor tab (Broker → Data Viewer) — subscribes and shows payloads as they arrive, with a highlight on updates.
| Button |
What it does |
| Subscribe |
Subscribe to the topic in the input |
| Subscribe to # |
Receive every topic the broker delivers to this client |
| Unsubscribe All |
Clear all manual subscriptions |
| Publish… |
Open the MQTT publish panel |
| Timeline |
Open the multi-topic payload timeline |
Click any topic value to open a rich payload viewer with a unified message timeline (canvas scrubber, play / follow-live / step controls), multi-topic cards you can drag to reorder, and rendering for:
- JSON trees, with an inline Edit button that publishes your change back to the broker
- Images and audio (detected from binary headers), plus charts for numeric streams
- Markdown and sandboxed HTML previews
- GeoJSON and
lat/lng payloads as an embedded Leaflet map
- Binary payloads decoded against
DEFINE MODEL … FORMAT PROTOBUF schemas (beta)
5. MQTT publish panel
Open from the Data Viewer Publish… button or Coreflux: Publish MQTT Message — topic, payload (plain text, JSON, hex, base64 or file upload), QoS 0/1/2 and retain, with a 50-item history and one-click re-publish.
6. Project management
Broker-side projects (collections of .lotnb files stored on the broker) are managed directly:
| Command / Button |
MQTT command sent |
| ▶ Run on a project |
-loadProject <name> — starts the project, replaces current entities |
| ■ Unload on active project |
-unloadProject |
| Switch Broker Project |
quick pick → -unloadProject then -loadProject <new> |
| Add Project |
-addProject <git-url \| path \| zip64:…> [branch \| name \| load] |
| Remove Project |
-removeProject <name> |
| Refresh Broker Projects |
-listProjects |
| Zip and Upload to Broker |
Zips the workspace (or any folder) and sends -addProject zip64:… with upload-only or upload+load |
| Deploy Project to Broker |
Sends the project's notebooks as one -addProject |
| Download Project from Broker |
Pulls a broker project back down with its original notebooks |
After a zip upload-only upload, the project row appears in the explorer — click ▶ Run to start it.
The Project sidebar panel also browses and manages the open folder's files directly — new folders/notebooks,
rename, delete, drag-and-drop, and importing resources (images, audio, .env files). See
project-view.md for the full picture, including how Deploy/Download Project
differ from the plain zip upload above.
7. ACTION debug trace
For ACTION cells, Start Debug Trace (cell toolbar) subscribes to the broker's trace topic and renders a timeline of each iteration — proportional bars (green for success, red for error) plus detail cards with duration, timestamps and published payloads. Auto-stops after 5 minutes. Requires broker ≥ 1.10.1; older brokers are detected and the session stops with a warning.
8. Topic links
Every MQTT topic string in a LoT cell is underlined and clickable (opens a subscribe/publish menu):
PUBLISH TOPIC "…"
ON TOPIC "…", WITH TOPIC "…", KEEP TOPIC "…", GET TOPIC "…"
WITH SOURCE_TOPIC "…" and WITH DESTINATION_TOPIC "…" (ROUTE keywords)
INTERACTION_TOPIC "…" (agent routes)
SOURCE_TOPIC and DESTINATION_TOPIC are also syntax-highlighted as route keywords.
A PUBLISH, KEEP, or GET topic that uses string interpolation ("devices/${device_id}/status") subscribes to the matching filter, with + for each interpolated level (devices/+/status). ON TOPIC strings are literal.
9. Python scripting
Python cells are fully managed entities on the broker:
# Script Name: MyScript
def greet(name="World"):
return f"Hello, {name}!"
The # Script Name: header is required — see python-script-format.md. Python cells behave like LoT cells: Run (▶) uploads with -addPython, the toolbar download button pulls the broker's copy, and the status bar reports Synced / Unsynced / Not deployed.
10. DEFINE THING
A Thing groups the routes, models, actions, rules, agents and panels of one device. Write the device once as a
TEMPLATE, then add one Thing per unit with DEFINE THING <name> OF <template>. The broker creates the parts.
- Run (▶) a THING cell to deploy it, together with the templates it uses. Errors show on the cell before
anything changes, and you are asked first if a template change affects other Things.
- Broker → LoT → Things shows each deployed Thing, its parts and its state.
- The parts are read-only. To change them, edit the THING cell and run it again.
11. DEFINE PANEL
Write Hub dashboards as DEFINE PANEL cells (DEFINE VISU is the legacy spelling). The extension checks
them against the broker's panel parser, highlights and completes panel keywords, and uploads the cell
(-addVisu). It does not draw panels: Coreflux Hub is the only place panels render. After uploading,
open Dashboards in the Hub to see and use the panel. A panel cell's status bar shows
Open in Coreflux Hub to view the rendered panel, which links to the
Hub dashboards docs.
Getting started
New here? Run Coreflux: Open Getting Started Walkthrough for the guided version.
Install the extension and open (or create) a .lotnb file.
Connect to your Coreflux broker — open Connections in the Coreflux sidebar (or click the status bar). Save a named profile, then connect. No broker yet? Coreflux: Create Docker Setup scaffolds a local one.
Write LoT code in a cell, e.g.:
DEFINE ACTION Heartbeat
ON EVERY 5 SECONDS DO
PUBLISH TOPIC "system/heartbeat" WITH "alive"
Press ▶ on the cell (or the status bar's Upload to broker button) to deploy it.
Once deployed, the status becomes Synced $(check) On broker.
MQTT credential configuration
Use Connections in the Coreflux sidebar (New Connection) to save a named profile:
- Host, port, username / password
- Optional TLS/mTLS certificate paths
- MQTT client ID so this session is identifiable on the broker
Passwords are stored in VS Code's secret storage, never in the profile list. Saving does not connect — use the Connect action on the profile. To share a default broker URL (and optional client ID) across a workspace, add a .broker file; it is adopted as a profile on first open.
The connected profile shows who you are logged in as (for example root · localhost:1893). Once connected, the Broker view lists the broker's LoT, projects and tools.
Commands reference
Notebook & cells
| Command |
Description |
| LoT Notebook: Create |
Create a new .lotnb notebook |
| LoT Notebook: Change Credentials |
Open Connections / New Connection |
| Coreflux: New Connection |
Save a named broker profile |
| Coreflux: Connect to MQTT Broker |
Status-bar connect menu (routes to Connections) |
| Upload LoT Cell to Broker |
Push the active LoT cell to the broker |
| Download Cell from Broker |
Pull the broker's version into the active cell |
| Start / Stop Debug Trace |
ACTION trace timeline for the active cell |
| Subscribe to Selected Topic |
Subscribe to the selected topic text |
| Subscribe with Wildcard |
Subscribe to selected topic /# |
| Quick Subscribe |
Type any topic to subscribe |
| Publish to Selected Topic |
Publish a payload to the selected topic |
Entity management
| Command |
Description |
| Coreflux: Refresh |
Refresh the entity tree |
| Coreflux: Copy Code |
Copy entity code to clipboard |
| Coreflux: Update Cell from Coreflux |
Pull broker code → cell |
| Coreflux: Update Coreflux from Cell |
Push cell code → broker |
| Coreflux: Create Definition in Notebook |
Insert a DEFINE statement at cursor |
| Coreflux: Remove Entity from Coreflux |
Remove entity from broker |
| Coreflux: Remove All Models / Actions / Rules / Routes / Python Scripts |
Bulk remove by category |
| Coreflux: Remove All Entities |
Remove every entity category at once (Entities row trash) |
Things
| Command |
Description |
| Deploy Thing (with its templates) |
Deploy a Thing and the templates it uses |
| Remove Thing from Broker |
Remove a Thing and its parts, or an unused template. Asks first |
| Trace Expanded Action |
Debug-trace an action that belongs to a Thing |
| Copy Expanded LoT |
Copy the code the broker generated for one of a Thing's parts |
| Open Thing Defining Cell |
Go to the cell that defines a Thing |
| Show in Things View |
Cell toolbar button: open the Things tree from a THING cell |
Data Viewer & panels
| Command |
Description |
| Subscribe to Topic |
Subscribe to a specific topic |
| Subscribe to # |
Subscribe to all topics (# wildcard) |
| Unsubscribe All |
Clear all subscriptions |
| Publish MQTT Message |
Publish with QoS / retain and history |
Project management
| Command |
Description |
| Run Project on Broker |
-loadProject on the selected project |
| Unload Active Broker Project |
-unloadProject |
| Switch Broker Project |
Quick pick to switch between broker projects |
| Add Project to Broker |
Add via Git URL or path |
| Zip and Upload to Broker |
Zip local folder and upload as zip64, verbatim |
| Deploy Project to Broker |
Upload the project's notebooks as one project |
| Download Project from Broker |
Pull a broker project into a local folder, restoring original notebooks when available |
| Remove Project |
Delete project from broker |
| Refresh Broker Projects |
Refresh project list |
| New LoT Notebook / New Folder / Add Resource / Rename… / Delete |
Manage files and folders in the Project panel |
Requirements
Known issues
- Cells without a valid
DEFINE … header show Invalid status — add the proper LoT definition to resolve.
- Python cells require the
# Script Name: … first line; missing it shows a clear error in the cell output.
- Very large project folders may produce large
zip64 MQTT payloads; broker payload size limits apply.
Privacy
The extension collects anonymous usage telemetry only when Coreflux: Telemetry Enabled is on. That setting is off by default. See what is sent and the privacy policy.
Further reading
Made by the Coreflux team with a LoT of love ❤️