> ## Documentation Index
> Fetch the complete documentation index at: https://docs.coreflux.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Introduction to LoT

> Learn what LoT (Language of Things) is and see it in action with simple examples

## What is LoT?

LoT (Language of Things) is a human-readable language for IoT automation. It uses near-English syntax to define logic, data structures, and integrations—all executed directly within the Coreflux MQTT broker.

<Tip>
  Think of LoT as SQL for real-time MQTT data. Just as SQL transforms database records, LoT transforms live MQTT streams.
</Tip>

<CardGroup cols={2}>
  <Card title="Actions" icon="bolt" href="./actions/syntax">
    Event-driven logic triggered by time or MQTT topics.
  </Card>

  <Card title="Models" icon="database" href="./models/overview">
    Data schemas that structure MQTT messages into JSON.
  </Card>

  <Card title="Rules" icon="shield" href="./rules/overview">
    Access control for topics and operations.
  </Card>

  <Card title="Routes" icon="route" href="./routes/overview">
    Connect to databases, brokers, and external services.
  </Card>
</CardGroup>

***

## What You'll Learn on This Page

Below you'll find practical examples showing LoT in action - from simple heartbeats to data transformation. Each example demonstrates a core capability you can implement immediately.

***

## Hello World

Three examples showing what LoT can do:

<CodeGroup>
  ```lot Time-Based Action theme={null}
  DEFINE ACTION Heartbeat
  ON EVERY 5 SECONDS DO
      PUBLISH TOPIC "system/alive" WITH "ok"
  ```

  ```lot Topic-Based Action theme={null}
  DEFINE ACTION Echo
  ON TOPIC "input/message" DO
      PUBLISH TOPIC "output/message" WITH PAYLOAD
  ```

  ```lot Data Model theme={null}
  DEFINE MODEL SensorData WITH TOPIC "sensors/formatted"
      ADD STRING "id" WITH "TEMP001"
      ADD DOUBLE "value" WITH TOPIC "sensors/raw" AS TRIGGER
  ```
</CodeGroup>

| Example        | Trigger                    | What it does                                   |
| -------------- | -------------------------- | ---------------------------------------------- |
| **Heartbeat**  | Every 5 seconds            | Publishes "ok" to indicate the system is alive |
| **Echo**       | Message on `input/message` | Forwards the payload to another topic          |
| **SensorData** | Value on `sensors/raw`     | Formats raw sensor data into structured JSON   |

***

## Next Steps

<CardGroup cols={2}>
  <Card title="LoT Concepts" icon="lightbulb" href="/lot-language/concepts">
    Understand the core concepts and building blocks of LoT.
  </Card>

  <Card title="Actions Overview" icon="bolt" href="/lot-language/actions/overview">
    Learn how Actions automate MQTT data processing.
  </Card>
</CardGroup>
