MQTT
Subscribe to Miravo topics from any MQTT client. Live JSON payloads arrive on a topic tree that follows the plant hierarchy.
Connect
| Item | Default |
|---|---|
| Broker | mqtt://127.0.0.1:1883 (--mqtt-port, --mqtt-host) |
| Login | None. No username, password, or TLS. |
| Topic | enterprise/site/area/line/asset/member |
| Payload | JSON. timestamp is epoch milliseconds. |
| Retained | Yes. A new subscriber gets the last value right away. |
Example from smart-factory. Subscribe to MiravoWorks/smart-factory/production/machining/cnc-001/# and you receive one message per member, such as:
MiravoWorks/smart-factory/production/machining/cnc-001/spindle_speed_feedback
{"value":7999.6368005619,"timestamp":1791170002313,"quality":"good","unit":"rpm","assetId":"cnc-001","model":"cnc-spindle","dataType":"Double"}quality is good, uncertain, or bad. unit appears only on members that define one. List every topic of a running factory with miravo adapter inspect mqtt.
Miravo runs its own MQTT broker on port 1883. MQTT is on by default.
Each value goes to a topic path of the form enterprise/site/area/line/asset/member, so your client sees the plant hierarchy instead of a flat topic list.
Values are retained by default. A client that subscribes later still gets the last value of every tag, including members that never change, such as serial numbers and setpoints. Removing an asset clears its retained topics. Set protocols.mqtt.retain: false in your template to publish without retain. With an external broker (--mqtt-mode external), retained values stay on that broker after Miravo stops until you clear them.
Use a GUI client
Install an MQTT client. MQTT Explorer runs on macOS, Windows and Linux, and any client that takes a host and port works.
Connect to localhost:1883. The embedded broker needs no username or password.
Subscribe to # to see every topic. The plant tree appears under enterprise/site/area/line/asset/member.
Verify data is flowing
Verified
- Payloads keep changing while the factory runs.
- A subscriber that connects later gets the last value of every tag at once, static ones included.
- Topic paths match the plant hierarchy in the Console.
- The Console Tags view lists the same topics.
Disable MQTT
Pass --no-mqtt to miravo start. Flags: miravo start.
Export for external tooling
The Console Tags view can filter to MQTT topics. Export for Integration downloads the filtered list as CSV.
Check that a client is connected
With the embedded broker, connected in adapters[].metrics (/api/metrics, miravo status --json) only says the broker is up. adapters[].metrics.clients shows who is on it: active is the number of connected MQTT clients and subscriptions the topic filters they hold. miravo status prints MQTT: connected | 2 clients | .... With an external broker, connected means Miravo itself is connected to that broker and there is no clients field.
Next
Choose a template
Point the same client at another template.
Litmus Edge
Map the running factory into Litmus Edge.
Was this page useful?
Last updated on
Miravo