Skip to main content
You discovered Coreflux! What now? The possibilities are endless (that is, assuming you were looking for a versatile IIoT platform and MQTT Broker to move and transform your data, of course). This guide will take you from zero to a working LoT (Language of Things) Action in under 15 minutes. By the end, you’ll have a live heartbeat signal confirming your Coreflux setup is working.
New to Coreflux? Check out the Overview for an introduction to what Coreflux is and how it works.

Prerequisites

Before you begin, ensure you have:
  • A running Coreflux Broker — See the Installation Guide if you haven’t set one up yet
  • VS Code with the LoT Notebooks extension — See the VS Code Setup Guide for installation
  • MQTT Explorer (Recommended) or any other MQTT client for verification
  • Basic MQTT knowledge — Understanding of topics, publish/subscribe patterns
Default Broker Credentials
SettingValue
Hostlocalhost or your server IP
Port1883 (unencrypted) / 8883 (TLS)
Usernameroot
Passwordcoreflux (change immediately!)

Your First LoT Action in 5 Minutes

Concept Refresher: You are about to write a script that lives and runs inside the broker, not on your laptop.
Let’s create a simple heartbeat action that publishes a UTC timestamp every 10 seconds. This is a quick way to verify your system is alive and working.

Understanding the Action

LoT Actions have three parts:
  1. DefinitionDEFINE ACTION <name>
  2. Trigger — When to run (ON EVERY <time> or ON TOPIC "<topic>")
  3. Logic — What to do (publish data, conditional logic, etc.)
Here’s what we’re building:
Heartbeat Action
DEFINE ACTION Heartbeat
ON EVERY 10 SECONDS DO
    PUBLISH TOPIC "system/heartbeat" WITH TIMESTAMP "UTC"
LineWhat it does
DEFINE ACTION HeartbeatCreates an action named “Heartbeat”
ON EVERY 10 SECONDS DOSets a time-based trigger
PUBLISH TOPIC ... WITH TIMESTAMP "UTC"Publishes the current UTC time

Deploy the Action

1

Ensure you have the LoT Notebooks extension installed

Open the extension panel, search for ‘LoT Notebooks’, and install.
2

Create a new .LOTNB file

Click on File > New File…, and create a new text file. Rename it to .lotnb.
3

Connect to Your Broker

Enter your broker credentials (host, port, username, password) and click Connect.
4

Create a New Action

Create a new code block, and change it to the LoT type.
5

Paste the Action Code

DEFINE ACTION Heartbeat
ON EVERY 10 SECONDS DO
    PUBLISH TOPIC "system/heartbeat" WITH TIMESTAMP "UTC"
6

Deploy

Click the Run Button on that specific cell to publish the action to your broker.
7

Verify

You should see a success notification. The action now appears in your Actions list under the Coreflux Entities tab.
The VS Code extension provides syntax highlighting, auto-completion, and real-time validation for LoT scripts.

Verify It’s Running

1

Verify

If the action appears in your Actions list under the Coreflux Entities tab, it should be running.
Congratulations! Your first LoT Action is live.

Interactive Example: The Echo Bot

Now let’s create a reactive action that responds to you. This demonstrates how Coreflux handles events instantly.
DEFINE ACTION EchoBot
ON TOPIC "hello/coreflux" DO
    PUBLISH TOPIC "reply" WITH "Hello Human! I received: " + PAYLOAD

Deploy and Test

  1. Deploy this action using the same method as above.
  2. Publish a message (string) to the topic hello/coreflux (e.g., “Are you there?”).
  3. Watch the reply topic. You will see an immediate response generated by the broker.
"Hello Human! I received: Are you there?"
This confirms your broker is not just storing data, but processing it.

Clean Up (Optional)

To remove the test action:
On the Coreflux Entities tab, right-click the desired action in your Actions list and select “Remove”.

Next Steps

Now that you have a working setup, explore the core LoT components:
Ready for more? Check out the Introduction to LoT or learn about Python Integration for advanced logic.

Quick Examples

Looking for inspiration? Check out the LoT Samples Repository for common patterns like:
  • Topic-Based Triggers: Echo messages between topics
  • State Machines: Toggle switches and conditional logic
  • Event Counters: Track and aggregate system events

LoT Samples Repository

Explore a collection of ready-to-use LoT Action examples and templates.

Troubleshooting

  • Verify the broker is running and you’re connected
  • Check $SYS/Coreflux/Command/Output for error messages
  • Ensure proper indentation in your LoT script (use consistent tabs or spaces)
  • Confirm the action appears in $SYS/Coreflux/Actions
  • Verify the broker hostname/IP and port are correct
  • Check that port 1883 (or 8883 for TLS) is open
  • Confirm your username and password are correct
  • If using TLS, ensure certificates are properly configured
  • Verify you’re subscribed to the exact topic (including case sensitivity)
  • Check if any Rules are blocking access to the topic
  • Use wildcards (+ or #) to debug topic hierarchies

Further Resources

ResourceDescription
LoT Notebooks for VS CodeInteractive notebook experience for LoT development
LoT Actions ReferenceFull syntax, triggers, and advanced patterns
LoT Models GuideData transformation and virtual sensors
LoT Rules GuideAccess control and permissions
LoT Routes GuideDatabase storage, bridging, and notifications
Python IntegrationNative Python execution within LoT
LoT Samples RepositoryCommunity examples and templates