Skip to main content

Overview

Every Action needs a trigger—the event that starts its execution. Choosing the right trigger type determines how your automation responds to real-world conditions.
Think of triggers like different ways to start your car. A time-based trigger is like an auto-start that warms up your car every morning at 7 AM. A topic-based trigger is like pushing the start button when you get in. A callable action is like asking someone else to start it for you.

When to Use Each Type


Time-Based Triggers

LoT supports several time-based trigger forms. All of them use the ON keyword and run the action’s DO block automatically—no MQTT message is required to fire them. Together they cover recurring intervals, calendar rules (a specific weekday, Monday–Friday, or Saturday–Sunday), daily wall-clock times, and single one-shot executions.

Quick reference

Time zone: For HH:mm and HH:mm:ss in ON EVERY … AT and in daily ON TIMESTAMP, values are interpreted in the local time of the machine running the broker, then converted to UTC internally. The action is scheduled for the correct wall-clock time across daylight saving changes. The one-shot form dd-MM-yyyy HH:mm:ss is interpreted as UTC, as described below.
Structured payloads: PUBLISH TOPIC does not support inline JSON object literals. For multi-field records, define a COLLAPSED model and use PUBLISH MODEL … TO … WITH (see Publishing Models). The timed-action examples below use that pattern.

1. ON EVERY N UNIT — fixed interval

Fires repeatedly every N units of time. Common for monitoring, polling, and heartbeats.

Supported units

Singular and plural unit names are interchangeable (for example, 1 SECOND and 1 SECONDS). ON EVERY 1 DAY fires every 24 hours from the last run; for the same clock time every calendar day, use daily ON TIMESTAMP instead.

2. ON EVERY DAY AT — weekly, specific day

Fires once per week on the named weekday at the given local time. Use "HH:mm" or "HH:mm:ss"; seconds are optional.

3. ON EVERY WEEKDAY AT — Monday–Friday

Fires Monday through Friday at the same local time—one action instead of five separate daily schedules.

4. ON EVERY WEEKEND AT — Saturday and Sunday

Fires on both weekend days at the specified local time—useful for maintenance windows or weekend-only reporting.

5. ON TIMESTAMP — daily fixed time

Fires every day at the given local wall-clock time. Unlike ON EVERY 1 DAY, this tracks clock time, not elapsed time since the broker or last run started.
"HH:mm" without seconds is accepted.

6. ON TIMESTAMP — one-shot, exact date and time

Fires once at the exact instant given, then never again (the scheduler moves the next run far into the future). Format is strictly dd-MM-yyyy HH:mm:ss (day–month–year). The timestamp is treated as UTC.

Combination patterns

Real systems often split schedules across several actions—one trigger per concern.

Error handling

If a time string does not match an expected format, the broker logs an error similar to: Invalid DATE_TIME format: <value>. Expected formats:
  • dd-MM-yyyy HH:mm:ss (one-time)
  • HH:mm:ss / HH:mm (daily)
  • Weekly forms using a day name with AT and a time string
Errors are also published (retained) to: $SYS/Coreflux/Actions/<ActionName>/Error Subscribe to $SYS/Coreflux/Actions/+/Error to observe failures from any action.

At a glance — valid time triggers

More examples


Topic-Based Triggers

Use ON TOPIC to execute actions when MQTT messages arrive:

Wildcard Patterns

LoT supports MQTT wildcards for flexible topic matching:
The + wildcard matches exactly one topic level:
Matches: sensors/room1/temperature, sensors/room2/temperature
Does NOT match: sensors/building1/floor2/temperature (too many levels)

Initialization Triggers

Use ON START to execute logic exactly once when the broker starts or when the action is first deployed. This is the right place to bootstrap a Unified Namespace (UNS) structure, publish retained default configurations, and log startup events.
Key characteristics:
  • Runs exactly once per broker start — not on a schedule, not on a message
  • KEEP TOPIC publishes with the retain flag so the value is delivered to any future subscriber immediately on connection
  • Use it to set default configuration values and retained state that must survive restarts
  • There is no ON STOP equivalent — ON START is the correct place for setup logic

Callable Actions

Actions without an event trigger are callable—they execute only when explicitly invoked by other actions or via system commands.

Basic Callable Action

Callable Action with Parameters

Callable actions can accept input parameters and return values:

Invoking Callable Actions

Use CALL ACTION to invoke from within another action. This is the primary way to reuse logic across your automation:

Comparing Trigger Types


Next Steps

Operations

Learn about SET, GET, PUBLISH, and conditional logic.

Python Integration

Extend Actions with Python for complex calculations.
Last modified on May 22, 2026