Skip to content

Language of Things (LOT)

  • New to LOT?


    If you're coming from the Getting Started guide, welcome to the Language of Things! This section will introduce you to the powerful scripting language that drives Coreflux automation.

What is LOT?

LOT (Language of Things) is a human-readable domain-specific language designed to make building and managing IoT (Internet of Things) systems simpler and more intuitive. While traditional IoT setups often require complex code and specialized programming knowledge, LOT is written in plain, near-English syntax, allowing both technical and non-technical users to design, understand, and maintain IoT solutions.

Key Principles

  1. Simplicity
    • LOT avoids arcane syntax and uses plain, descriptive statements.
    • This simplicity lowers the barrier to entry for individuals who are not professional programmers.
    • For instance, rather than writing specialized Python , C++ , JavaScript MQTT code or complex scripts, a LOT rule might look like:
 DEFINE ACTION ChangeOfTopic
 ON TOPIC "simple/topic" DO
     PUBLISH TOPIC "simple/topic" WITH (PAYLOAD + 1)
  This resembles English while still conveying the precise logic required.
  1. Abstraction of IoT Complexity

    • A major headache in typical IoT solutions is setting up and configuring various messaging protocols, brokers (MQTT), and cloud services.
    • LOT abstracts away much of this complexity by offering a built-in framework for connecting to other systems, defining objects, transform, aggregate and provide actionable data.
    • Users can describe what should happen rather than how to do it. The LOT engine handles the underlying plumbing.
  2. Fostering Collaboration Between Humans and LLMs

    • LOT introduces a unified language that enables direct interaction between humans, LLMs, and IoT systems, while also providing seamless integration with Python for advanced processing needs.
    • LLMs can create rules, actions, and models in this shared language, which are easily understood by humans, allowing stakeholders to validate and adapt them effortlessly.
    • For example, a user can define high-level objectives, and LLMs can translate them into actionable system commands while maintaining transparency and readability.
    • This shared language empowers humans and AI to collaborate seamlessly, making IoT systems more intuitive, accessible, and efficient for stakeholders across various disciplines.
    • Python Integration (Version 1.7.2+): LOT now supports direct Python function calls, allowing complex data processing, machine learning, and external API integrations while maintaining the simplicity of the LOT language for orchestration.
  3. Encouraging Collaboration

    • Because LOT is so close to English, it becomes easier for different team members—engineers, domain experts, managers—to collaborate on the same IoT project.
    • A subject matter expert can define high-level rules without waiting for specialized developers, leading to faster iterations and clearer communication.
  4. Standardized Approach

    • By providing consistent rules, models, and actions, LOT encourages a standardized approach to IoT system design.
    • Rather than each developer having a unique way of scripting or coding device interactions, LOT promotes a shared language that follows best practices from the start.

Core Components

  1. Models

    • LOT "Models" describe the structure and capabilities of devices , components or digital twin representations.
    • This includes specifying attributes (e.g., temperature, humidity) and data types (e.g., Number, Boolean).
  2. Rules

    • Rules in LOT define who and what can be accessed and when certain conditions are met . what actions get triggered.
    • This natural-language style ensures that system behavior is clear at a glance.
  3. Actions

    • Actions describe events that can be triggered and perform tasks.
    • They can be chained or sequenced for more complex workflows.
    • Python Integration: Actions can call Python functions directly using the CALL PYTHON syntax, enabling complex data processing, machine learning, and external API integrations.
  4. *Routes

    • LOT has built-in bridges to handle MQTT and other protocols, so you can connect systems from different networks.
    • Instead of manually dealing with topics, QoS levels, or broker configurations, you declare in LOT how devices and data flows should be managed.
  5. VSCode Integration

    • LOT provides a Visual Studio Code extension, allowing users to write, test, and debug rules right from the editor.
    • Features like syntax highlighting and auto-completion help quickly define system logic.
    • Python Support: The VS Code extension supports Python development with LOT notebooks, allowing seamless integration between LOT actions and Python functions.
  6. Python Integration (Version 1.7.2+)

    • Native Python support within the MQTT broker enables direct execution of Python functions from LOT actions.
    • Script Management: Add, remove, and manage Python scripts via MQTT commands.
    • Package Management: Install Python packages directly through the broker.
    • Real-time Execution: Python functions execute in real-time within the broker context.
    • VS Code LOT Notebooks: Full support for Python development in VS Code LOT notebooks with play button upload functionality.

Example of LOT in Action

Suppose you have a simple scenario where you want to count the number of years. ANd every year turn a light on. In LOT, you might write something like:

DEFINE ACTION IncrementActionYear
ON EVERY 1 YEAR DO
    IF GET TOPIC "year/topic" = "" THEN
        PUBLISH TOPIC "year/topic" WITH 0
    ELSE
        PUBLISH TOPIC "year/topic" WITH (GET TOPIC "year/topic" + 1)
DEFINE ACTION TurnLampOn
ON TOPIC "year/topic" DO
    PUBLISH TOPIC "year/lamp" WITH "on"

Python Integration Example

Here's how LOT integrates with Python for more complex processing:

# Script Name: TemperatureProcessor
def celsius_to_fahrenheit(celsius):
    return (celsius * 9/5) + 32

def analyze_temperature(temp):
    if temp < 0:
        return "freezing"
    elif temp < 20:
        return "cold"
    elif temp < 25:
        return "comfortable"
    else:
        return "warm"
DEFINE ACTION TemperatureMonitor
ON TOPIC "sensors/temperature" DO
    SET temp GET TOPIC "sensors/temperature" AS DOUBLE
    CALL PYTHON "TemperatureProcessor.celsius_to_fahrenheit"
        WITH ({temp})
        RETURN AS {fahrenheit}
    CALL PYTHON "TemperatureProcessor.analyze_temperature"
        WITH ({temp})
        RETURN AS {comfort_level}
    PUBLISH TOPIC "sensors/fahrenheit" WITH {fahrenheit}
    PUBLISH TOPIC "sensors/comfort" WITH {comfort_level}

Why Use LOT?

  1. Accessible: Non-programmers and subject matter experts can read and write LOT rules with minimal training.
  2. Modular & Scalable: Easy to add new rules, models, and integrations without rewriting entire codebases.
  3. Maintainable: Human-readable rules are less prone to errors and are simpler to update.
  4. Seamless Integration: Built-in connectors (like the MQTT Bridge) reduce the need for complex network configurations, letting you focus on the logic.
  5. Fosters Innovation: Because LOT is straightforward, more stakeholders can collaborate and innovate on IoT solutions, accelerating time-to-market.

Closing Thoughts

LOT represents a shift in how we think about IoT systems—focusing on what we want rather than how to code it. In a rapidly evolving tech landscape where AI is becoming the backbone of decision-making, LOT's near-English syntax empowers diverse teams to shape solutions. By abstracting the complexities of configurations, message routing, mapping , data definiton and data modelling, LOT paves the way for more inclusive, agile, and AI-driven IoT development.

Whether you're a seasoned engineer or a domain expert just exploring IoT, LOT helps you quickly grasp and shape system behavior. Ultimately, LOT democratizes IoT solution creation, enabling everyone to collaborate on building smarter, interconnected environments.


Want to Learn More?
- Look into the VSCode extension to see how easy it is to start coding (in near-English!) and deploying your own system. - Explore the LOT Samples Repository for hands-on examples of LOT in action. - Check out our Syntax Examples to understand the basics of the LOT language.


Learning Path

Follow this learning path to master the Language of Things:

  • 1. LOT Fundamentals


    Start with the core concepts and syntax of LOT.

    Explore LOT Syntax

  • 2. Rules


    Learn how to create access control rules to secure your IoT ecosystem.

    Learn about Rules

  • 3. Models


    Understand how to transform and route data with LOT Models.

    Dive into Models

  • 4. Actions


    Create event-driven automation with LOT Actions.

    Master Actions

  • 5. Routes


    Connect to external systems with LOT Routes.

    Implement Routes

  • 6. Development Tools


    Set up your development environment for LOT.

    VS Code Extensions

  • 7. Python Integration


    Learn how to integrate Python functions with LOT actions for advanced processing.

    Python Examples