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:
- Actions - Examples of LOT actions for event-triggered operations
- Models - Example models for data transformation and processing
- Routes - Examples of routing data between systems
- Syntax - Examples demonstrating LOT syntax features
Getting Started with Samples
To use the LOT Samples:
-
Clone or download the repository:
-
Open the samples in Visual Studio Code with the LOT Language Support extension
-
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:
- Make sure your Coreflux MQTT broker is running
- Open a sample file in Visual Studio Code
- Right-click within the editor and select "Upload Model or Rule to MQTT Broker"
- Enter your broker URL when prompted (for a local broker, use
mqtt://127.0.0.1:1883
) - 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:
- Start with the Syntax examples to learn the basic structure and features of LOT
- Progress to Models to understand how to process and transform data
- Explore Actions to see how to react to events and trigger operations
- 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.