In This Page
| Section | Description |
|---|---|
| Basic Syntax | DEFINE ACTION structure and components |
| Trigger Types | Time-based, topic-based, and callable actions |
| Variable Operations | SET, GET TOPIC, GET JSON |
| Topic Operations | PUBLISH and KEEP |
| Control Flow | IF/THEN/ELSE conditionals |
| Type Casting | Converting between data types |
| Complete Example | Full working action |
Basic Syntax
Components
A unique identifier for the action. Use descriptive names that indicate the action’s purpose (e.g.,
SensorDataProcessor, HeartbeatMonitor).Specifies when the action executes. Can be time-based (
ON EVERY), topic-based (ON TOPIC), or omitted for callable actions.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
- Time-Based
- Topic-Based
- Callable
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
| Keyword | Description |
|---|---|
SET | Create or assign a variable |
GET TOPIC | Retrieve data from a topic |
GET JSON | Extract fields from JSON payloads |
Topic Operations
| Keyword | Description |
|---|---|
PUBLISH TOPIC | Broadcast data to all subscribers |
KEEP TOPIC | Store data internally (not broadcast) |
Control Flow
| Keyword | Description |
|---|---|
IF ... THEN ... ELSE | Conditional execution |
Entities
| Entity | Description |
|---|---|
PAYLOAD | The data that triggered the action |
TOPIC POSITION n | Extract segment from topic path |
TIMESTAMP | Generate timestamps (UTC, UNIX) |
EMPTY | Check if a topic has no data |
Python Integration
| Keyword | Description |
|---|---|
CALL PYTHON | Execute Python functions |
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
UseAS to cast values when performing comparisons or calculations:
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.

