MQTT Connection
Control and interact with IoT devices through natural conversation.
Overview
MQTT Connection lets you link Chat Everywhere v2 to physical devices — lights, sensors, motors, or anything that speaks MQTT. You set up named connections to an MQTT broker in your settings, and then the AI can send commands or read data from those devices as part of a normal conversation. Say “turn on the lights” or “what is the temperature?” and the AI handles the MQTT communication automatically.
Each connection points to a specific topic on an MQTT broker. You define what payload to send (a fixed string like “ON”, or a description that lets the AI generate the right payload), and whether the connection can also receive messages back.
How to Set Up
- Open Settings and go to the MQTT tab.
- Click Add MQTT Connection.
- Fill in the connection details:
- Name — A label for this connection (e.g., “Living Room Light”).
- Host — The address of your MQTT broker. The default is
broker.emqx.io, a free public broker. You can use any MQTT broker. - Port — The broker port. Default is
1883. - Topic — The MQTT topic this connection publishes or subscribes to (e.g.,
home/lights/living-room). Only letters, numbers, and forward slashes are allowed. - Receiver — Enable this if the connection should also be able to read messages from the topic. The device publishing to this topic must send messages with the retain flag for the AI to read them.
- Dynamic Payload — When off, the AI sends the exact payload you enter (good for fixed commands like
ONorOFF). When on, the payload field becomes a description, and the AI generates an appropriate payload based on the conversation (good for variable data like JSON commands with parameters). - Payload (or Payload Description when Dynamic Payload is on) — The message content to send, or a description of what the AI should generate.
- Description — An optional note explaining what this connection does. This helps the AI understand when to use it.
- Click Save.
You can also test a connection directly from the connection list using the test button — this sends the saved payload immediately without going through the AI.
How to Use in Chat
Once you have saved one or more connections, just talk to the AI naturally. The AI knows about all your configured connections and will pick the right one based on your request.
For example:
- “Turn on the living room lights” — the AI finds the matching connection and sends the command.
- “What is the current temperature?” — if you have a receiver-enabled connection for a temperature sensor, the AI subscribes to the topic and reads the latest value.
- “Set the fan speed to 3” — with a dynamic payload connection, the AI generates the appropriate payload (e.g.,
{"speed": 3}) based on your description.
You do not need to mention MQTT, topics, or connection names. The AI matches your intent to the right connection automatically. If you have multiple connections, you can be specific (“turn on the bedroom light”) to guide the AI.
Static vs. Dynamic Payload
This is the most important choice when configuring a connection.
Static Payload is for fixed commands. You type exactly what should be sent — ON, OFF, {"action":"toggle"} — and the AI sends that string without modification. Use this when the device expects a specific, unchanging message.
Dynamic Payload is for flexible commands. Instead of a literal payload, you write a description like “JSON object with a ‘speed’ field between 1 and 5.” The AI reads this description and generates the actual payload at the time of the conversation, based on what you asked for. Use this when the command needs to vary based on context.
Who Can Use This
MQTT Connection is available on the Pro and Ultra plans. Free accounts can use it up to 3 times per day.
Common Questions
Do I need my own MQTT broker?
Not necessarily. The default broker (broker.emqx.io) is a free public broker that works for testing and simple projects. For anything production-grade or private, use your own broker.
What devices work with this? Any device that can connect to an MQTT broker — ESP32, Raspberry Pi, Arduino with a WiFi module, smart home hubs, industrial PLCs, or any software that publishes or subscribes to MQTT topics.
Can the AI receive live data from a sensor? Yes, if the connection has Receiver enabled and the device publishes messages with the MQTT retain flag. The AI reads the most recent retained message on the topic. It does not maintain a persistent subscription or stream data in real time.
What happens if the broker is unreachable? The AI will report that the command failed. Check that your broker is online and that the host and port are correct.
Can I use MQTT over WebSocket or TLS? The current implementation connects over standard TCP (not WebSocket). Use a broker that accepts TCP connections on the configured port.
Related Features
- AI Chat — The conversation interface where MQTT commands are triggered