Overview
MQTT Explorer provides a powerful publishing interface that makes it easy to send messages to any topic. Whether you’re testing IoT devices, triggering automations, or sending configuration updates, the Publish tab gives you complete control over your MQTT messages.Publish Tab Interface
Access the Publish tab from the sidebar to send messages: Key Components- Topic input: Specify the destination topic path
- Payload editor: Enter your message payload
- Editor mode selector: Choose payload format
- Retain switch: Control message retention
- QoS selector: Set Quality of Service level
- Publish button: Send the message
- Publish history: Access recently sent messages
You must be connected to an MQTT broker before you can publish messages.
Topic Input
Specify where your message should be published: Topic Entry- Type or paste the full topic path (e.g.,
home/livingroom/light/command) - Auto-complete based on existing topics (when available)
- Copy topic path from selected topics in the tree
- Topic validation ensures valid MQTT topic syntax
- Click any topic in the tree view
- The topic path is automatically copied to the publish topic field
- Edit the path as needed before publishing
Payload Editor
The integrated code editor provides a comfortable writing experience:Editor Features
Syntax Highlighting
Color-coded syntax for JSON, XML, and other formats
Line Numbers
Easy reference for long payloads
Auto-Indentation
Automatic indentation for structured data
Multi-line Support
Full editor for complex payloads
Keyboard Shortcuts
| Shortcut | Action |
|---|---|
| Ctrl/Cmd + Enter | Publish the message |
| Tab | Insert indentation |
| Shift + Tab | Remove indentation |
The editor automatically adjusts to light or dark mode based on your system theme.
Editor Modes
Choose the appropriate format for your message payload:JSON Mode
JSON Mode
Best for: Structured data, configuration objects, device statesFeatures:
- JSON syntax highlighting
- Format validation
- Format JSON button to pretty-print
- Auto-complete for braces and quotes
Plain Text Mode
Plain Text Mode
Best for: Simple values, commands, plain text messagesFeatures:
- No formatting constraints
- Line breaks preserved
- Fastest input method
Base64 Mode
Base64 Mode
Best for: Binary data, encoded files, encrypted contentFeatures:
- Base64 encoding/decoding
- Binary data support
- Large payload handling
Hex Mode
Hex Mode
Best for: Low-level protocols, raw bytes, hardware communicationFeatures:
- Hexadecimal encoding
- Byte-level control
- Raw binary representation
Format JSON Feature
When working in JSON mode, use the Format JSON button to:
Error Handling
- Invalid JSON shows an error message
- Syntax errors are highlighted
- Error message indicates what went wrong
Load from File
Publish file contents as MQTT messages:
Supported File Types
- Text files (
.txt,.log,.csv) - JSON files (
.json) - XML files (
.xml) - Configuration files (
.yaml,.conf,.ini) - Any text-based format
Retain Flag
Control message retention on the broker: Retain Off (Default)- Message is delivered to current subscribers
- Message is not stored by the broker
- New subscribers won’t receive this message
- Message is stored by the broker
- New subscribers immediately receive the retained message
- Overwrites any previous retained message on the topic
- Useful for state values and configuration
When to Use Retain?
When to Use Retain?
Use retained messages for:
- Device state values (“light is ON”)
- Configuration settings
- Status updates (“device online”)
- Last known values
- Temporary commands
- Event notifications
- Time-sensitive data
- Rapidly changing values
Quality of Service (QoS)
Control message delivery guarantees:QoS Levels
QoS 0
At most onceFire and forget. No confirmation. Fastest but least reliable.Use for: High-frequency sensor data, non-critical updates
QoS 1
At least onceConfirmed delivery. May receive duplicates.Use for: Important messages, commands, state changes
QoS 2
Exactly onceGuaranteed delivery without duplicates. Slowest but most reliable.Use for: Critical commands, billing data, irreversible actions
The actual QoS level is the minimum of the publisher’s and subscriber’s requested QoS.
Publishing the Message
Send your message to the broker: Publish Methods- Click the Publish button
- Press Ctrl/Cmd + Enter while in the editor
- Message is added to publish history
- No error dialog means successful publish
- Check topic in tree to verify message received (if subscribed)
- Connection errors show an alert
- Invalid topic format shows validation error
- Broker rejection displays error message
Publish History
Quickly resend or reference previous messages: History Features- Stores last 8 published messages per session
- Shows topic, payload preview, and timestamp
- Click any entry to load it into the editor
- Automatic duplicate removal
- Most recent messages first
Common Use Cases
Control IoT Devices
Send commands to smart home devices, lights, thermostats, and sensors
Test Integrations
Verify that your applications correctly handle MQTT messages
Trigger Automations
Send messages to activate automation rules in Home Assistant, Node-RED, etc.
Update Configuration
Push configuration updates to devices via retained messages
Send Commands
Execute device commands like “restart”, “update”, or “reset”
Simulate Sensors
Generate test data for development and debugging
Best Practices
Publishing Tips- Use descriptive, hierarchical topic names
- Include a
/cmdor/setsuffix for command topics - Test with QoS 0 first, then increase if needed
- Use retained messages sparingly (only for state/config)
- Validate JSON payloads before publishing
- Keep payload sizes reasonable (under 1KB when possible)
- Only publish to topics you have write permission for
- Don’t publish sensitive data without encryption
- Use authentication and TLS for production brokers
- Be aware that published messages may be logged
Related Features
- Message Inspection - View published messages in the tree
- Topic Visualization - Navigate to topics before publishing
- AI Assistant - Get AI-generated publish proposals