Skip to main content
Actions are executable logic blocks triggered by events such as timed intervals, topic updates, or explicit calls. They are the primary way to implement automation in LoT.
Actions run inside the MQTT broker itself, eliminating the need for external middleware or application servers.

Basic Syntax

Components

action_name
string
required
A unique identifier for the action. Use descriptive names that indicate the action’s purpose (e.g., SensorDataProcessor, HeartbeatMonitor).
EVENT_TRIGGER
trigger
required
Specifies when the action executes. Can be time-based (ON EVERY, ON TIMESTAMP), topic-based (ON TOPIC), initialization (ON START), or omitted for callable actions.
action_logic
statements
required
One or more LoT statements that execute when the action triggers. These can include publishing, variable assignment, conditionals, and Python calls.

Action Structure

Every action follows this general structure:

Trigger Types

Execute at regular intervals:
Supported units: SECOND(S), MINUTE(S), HOUR(S), DAY(S), WEEK(S)

Compatible Keywords

Keywords that can be used within action logic:

Variable Operations

Topic Operations

Control Flow

Entities

Python Integration

Extend LoT with Python: Use CALL PYTHON to execute complex calculations, data validation, or integrate external libraries. See the Python Integration guide for complete syntax and examples.

Type Casting

Use AS to cast values when performing comparisons or calculations:
Supported types: STRING, INT, DOUBLE, BOOL, TIMESTAMP

Complete Example

Putting It All Together: This example demonstrates topic extraction, JSON parsing, conditional logic, and publishing - the core patterns you’ll use in most actions.

Next Steps

Action Triggers

Learn about time-based and topic-based triggers in detail.

Operations

Master GET, SET, PUBLISH, and conditional logic.
Last modified on May 22, 2026