Skip to content

LOT Samples Repository

The LOT Samples Repository is a collection of demonstrations, tutorials, and sample code for the LOT language. It provides practical examples that show how to use different LOT features in real-world IoT scenarios.

Repository Structure

The repository is organized into four main sections:

  1. Actions - Examples of LOT actions for event-triggered operations
  2. Models - Example models for data transformation and processing
  3. Routes - Examples of routing data between systems
  4. Syntax - Examples demonstrating LOT syntax features

Getting Started with Samples

To use the LOT Samples:

  1. Clone or download the repository:

    git clone https://github.com/CorefluxCommunity/LOT-Samples.git
    

  2. Open the samples in Visual Studio Code with the LOT Language Support extension

  3. Follow the examples to learn how each LOT keyword works in practice

Using Samples with Coreflux MQTT Broker

The samples are designed to work with the Coreflux MQTT broker. To run the examples:

  1. Make sure your Coreflux MQTT broker is running
  2. Open a sample file in Visual Studio Code
  3. Right-click within the editor and select "Upload Model or Rule to MQTT Broker"
  4. Enter your broker URL when prompted (for a local broker, use mqtt://127.0.0.1:1883)
  5. The extension will deploy the LOT rule/model to the broker

Learning Path

If you're new to LOT, we recommend exploring the samples in this order:

  1. Start with the Syntax examples to learn the basic structure and features of LOT
  2. Progress to Models to understand how to process and transform data
  3. Explore Actions to see how to react to events and trigger operations
  4. Finally, look at Routes to learn how to connect different systems

Each sample includes comments explaining what the code does and how it works.

Contributing

The LOT Samples repository is open to contributions. If you've created a useful LOT example, consider submitting a pull request to help others learn.

Additional Resources