Overview
The Coreflux MQTT broker provides a rich set of commands that you can use to manage users, rules, models, actions, routes, and more. These commands are published to the$SYS/Coreflux/Command topic to control and configure the broker.
Why Use Broker Commands?
Instead of editing configuration files and restarting the broker, you can manage everything at runtime through MQTT messages. Add users, deploy LoT Actions, configure Routes—all without downtime.In This Page
| Section | Description |
|---|---|
| Command Format | How to structure commands |
| User Management | Add, remove, and configure users |
| LoT Commands | Manage Rules, Models, Actions, and Routes |
| Python Integration | Add and manage Python scripts |
| System Commands | Trace logging and diagnostics |
Command Format
Commands are sent to the broker via MQTT messages published to the$SYS/Coreflux/Command topic. The general format is:
Command responses are published to
$SYS/Coreflux/Command/Output. Subscribe to this topic to receive feedback from your commands.User Management Commands
Manage broker users and their credentials.Adding a User
Create a new user with a username and password:Response:
User operator added successfully!Removing a User
Remove an existing user from the broker:Response:
User operator removed successfully!Changing User Password
Update a user’s password:Response:
Password for user operator changed successfully!Changing User Settings
Modify specific settings for a user:Response:
Settings for user updated successfully!LoT Commands
Commands for managing LoT (Language of Things) entities.Rules
Rules define access control and permissions for the broker. See the Rules documentation for complete syntax reference.Rules are LoT code and can also be deployed directly from a LoT Notebook by running the cell containing your rule definition.
Adding a Rule
Response:
Rule 'AllowActionCreation' added successfullyResponse:
Rule 'RestrictSensorPublish' added successfullyRemoving a Rule
Response:
Rule 'AllowActionCreation' removed successfullyModels
Models define data structures for topic payloads.Adding a Model
Response:
Model 'TemperatureSensor' added successfullyRemoving a Model
Response:
Model 'TemperatureSensor' removed successfullyRemoving All Models
Response:
All models removed successfullyActions
Actions define automated behaviors triggered by events or schedules.Adding an Action
Response:
Action 'Heartbeat' added successfullyRemoving an Action
Response:
Action 'Heartbeat' removed successfullyRunning an Action Manually
Trigger an action to run immediately:Response:
Action 'Heartbeat' executed successfullyRemoving All Actions
Response:
All actions removed successfullyRoutes
Routes configure connections to external systems and data pipelines.Adding a Route
Response:
Route 'CloudBridge' added successfullyRemoving a Route
Response:
Route 'CloudBridge' removed successfullyListing All Routes
Get a list of all registered routes:Response: List of all registered routes with their status
Getting Route Template Code
Retrieve a template for a specific route type:Response: Template code with all available parameters for the route type
Removing All Routes
Response:
All routes removed successfullyDiagnostics
Commands for troubleshooting and debugging LoT entities.Running LoT Diagnostic
Run diagnostics on a specific entity:Response: Diagnostic information for the specified entity
Getting Pending Status
Check the status of pending models and actions:Response: Status of all pending models and actions
Python Integration Commands
Manage Python scripts within the broker for custom data processing.Adding a Python Script
Response:
Python script 'Calculator' added successfullyPython scripts must start with
# Script Name: YourScriptName to be recognized by the system. The script name is used when calling Python functions from LoT actions using the CALL PYTHON syntax.Removing a Python Script
Response:
Python script 'Calculator' removed successfullyInstalling Python Packages
Install additional Python packages via pip:Response:
Package 'numpy' installed successfullyListing Installed Packages
View all installed Python packages:Response: List of all installed Python packages
Removing All Python Scripts
Response:
All Python scripts removed successfullySystem Commands
Trace Logging Commands
Trace logging allows you to capture and monitor specific log events in the Coreflux system.Adding a Trace Log Point
| Parameter | Description |
|---|---|
level | Log level: Debug, Information, Warning, Error, Fatal |
lifetime | Duration in seconds before the trace point expires |
messageContains | Filter logs containing this substring |
topic | MQTT topic where matching logs will be published |
- Captures logs at Information level or higher
- Automatically expires after 3600 seconds (1 hour)
- Only captures logs containing “sensor”
- Publishes matching logs to
logs/sensors
Response:
Trace log point added successfullyListing Trace Log Points
View all active trace points:Response: List of all active trace log points
Removing a Trace Log Point
Remove a specific trace point by topic:Response:
Trace log point removed successfullyRemoving All Trace Log Points
Response:
All trace log points removed successfullyConnection Status
View the status of all database connections and their recovery patterns:Response: Status of all database connections
Update Data
Trigger a refresh of broker data:Response:
Data refresh triggered successfully
