Namespace and MQTT topics
The namespace is the set of names under which every value of the plant is published. It is built from the ISA-95 model: the codes of the enterprise, site, area, work center, equipment and tag, joined by /. A value of the Filler speed has the path
DEMOFOODS/IZMIR/BOTTLING/LINE1/FILLER/Speed
The same path is the key of the value in the historian, in reports and on MQTT. Nobody maintains a topic list by hand: change the model and the topics follow.
How it works
There are two ways to get topics from the namespace. They are not the same:
| Uplink option ISA-95 topics (UNS) | Public read-only feed | |
|---|---|---|
| Where | An MQTT or AWS IoT uplink to your broker | The broker inside the Console or runtime |
| Root | Your choice (Topic root (optional)), or none | Always mii/uns |
| Granularity | One message per group, or one per tag (One topic per tag) | One message per tag |
| Payload | The uplink's upload format | {value, quality, ts, tagId} |
| Direction | Out to your broker | Your client reads from the plant |
| Account | Your broker's | mii-reader, read only |
Path rules
A path has these levels:
enterprise / site / area / workCenter [/ workUnit] / equipment [/ group] [/ tag]
- Required: enterprise, site, area, work center, equipment.
- Optional: work unit, group, tag.
- A tag path has exactly 6 levels (no work unit) or 7 (with a work unit):
enterprise/site/area/workCenter[/workUnit]/equipment/tag. - Every level is the code, not the display name. A code has letters, digits,
_and-, 1 to 64 characters, and does not start or end with-or_. Reserved:_alarm,null,true,false,.,... - Codes keep their case.
Line1andline1are different.
Encoding
Topics in an uplink are built from the segments after trimming and Unicode NFC normalisation. Characters that are unsafe in MQTT topics are percent-encoded per UTF-8 byte: +, #, /, $, %, white space, control characters and a few others. A space becomes %20. Because codes only have letters, digits, _ and -, this matters only for old names.
Limits
| Limit | Value |
|---|---|
| Topic length | 1024 bytes (AWS IoT: 256) |
| Levels | 32 (AWS IoT: 8) |
Nothing is cut off. A topic over a limit is an error.
Reserved roots
An ISA-95 topic cannot start with spBv1.0 (Sparkplug), mii/v1/… (internal), or mii/write/…, nor use the uplink's own write request, write response and status topics.
Error codes
| Code | Meaning |
|---|---|
missing-level | A required level is missing. |
too-long | Over the byte limit. |
too-deep | Over the level limit. |
reserved | Starts with a reserved root. |
no-path | The tag is not bound to equipment, so it has no path. |
bad-path | The path does not parse. |
mixed-equipment | The tags of a group belong to different equipment. The group keeps its default topic. |
collision | Two groups or tags give the same topic. |
shared-topic | Another uplink on the same broker uses this topic. |
The uplink form shows these as texts, for example "same topic as another group" and "no complete ISA-95 path". See Uplinks.
The public read-only feed
The embedded MQTT broker has an optional public listener with one read-only account. It lets an outside client read live values without any other access.
| Item | Value |
|---|---|
| Topic | mii/uns/<enterprise>/<site>/<area>/<workCenter>[/<workUnit>]/<equipment>/<tag> |
| User name | mii-reader |
| Rights | Read only, and only the topic tree mii/uns/#. Everything else is denied. The internal topics mii/v1/… are closed. |
| QoS | 0 |
| Retained | No |
| Messages | One per tag sample |
Tags that are not bound to equipment have no path and are not published.
Payload
{
"value": 118,
"quality": "good",
"ts": "2026-12-02T10:15:30.123Z",
"tagId": "tag_3f9a1c2b7d10"
}
| Field | Meaning |
|---|---|
value | The value. Left out when the read failed. |
quality | good, uncertain, bad or unknown. See Data types and quality. |
ts | ISO 8601 UTC with milliseconds. |
tagId | The tag identity. Left out when empty. |
error | A text, only on a bad read. |
A bad read has quality: "bad", an error and no value.
Switch it on in mii Lite
The listener is off by default. To open it:
-
Open
config/mii.envof the Lite installation and set the listen address:MI_LITE_MQTT_PUBLIC_LISTEN=0.0.0.0:1883Use
off(or leave it empty) to close it. The Docker image reads the variable from its environment. -
Restart the MakeIntelligent service.
-
Lite writes the read-only login to the file
DATA-ACCESS.txtin its data directory. It has the broker address, the usermii-reader, the password and the topic tree. -
Open port 1883 in the firewall of the Lite host for the clients that need it.
The same file also holds the PostgreSQL login if you open read-only SQL access. Treat it as a secret. The internal broker of Lite listens on the loopback address only and is not this listener.
In the plant stack the same listener is enabled with the variables MI_EMBEDDED_MQTT_PUBLIC_LISTEN and MI_EMBEDDED_MQTT_PUBLIC_PASSWORD_FILE of the collector.
The public listener speaks plain MQTT. Put it in a trusted network, or in front of a TLS proxy. Anyone with the password can read all values of the plant. The password is one shared secret.
Example: read the Filler with mosquitto_sub
Everything in the Filler:
mosquitto_sub -h lite-host -p 1883 -u mii-reader -P '<password from DATA-ACCESS.txt>' \
-t 'mii/uns/DEMOFOODS/IZMIR/BOTTLING/LINE1/FILLER/#' -v
mii/uns/DEMOFOODS/IZMIR/BOTTLING/LINE1/FILLER/State {"value":1,"quality":"good","ts":"2026-12-02T10:15:30.123Z","tagId":"tag_1a2b3c4d5e6f"}
mii/uns/DEMOFOODS/IZMIR/BOTTLING/LINE1/FILLER/Speed {"value":118,"quality":"good","ts":"2026-12-02T10:15:30.123Z","tagId":"tag_2b3c4d5e6f70"}
mii/uns/DEMOFOODS/IZMIR/BOTTLING/LINE1/FILLER/Pressure {"value":3.21,"quality":"good","ts":"2026-12-02T10:15:30.123Z","tagId":"tag_3c4d5e6f7081"}
The speed of every machine of Line 1 (+ matches one level):
mosquitto_sub -h lite-host -u mii-reader -P '<password>' \
-t 'mii/uns/DEMOFOODS/IZMIR/BOTTLING/LINE1/+/Speed' -v
The whole plant:
mosquitto_sub -h lite-host -u mii-reader -P '<password>' -t 'mii/uns/#' -v
Because messages are not retained, a new subscriber sees a tag only when it next changes or is polled. For the current state read from the SQL views, see Read with SQL.
Limits and good practice
- Choose the codes as the topic names you want to live with. Short, stable, no spaces.
Line1, notLine 1. - Use the public feed for reading. To write to the plant use approved writes; the read-only account cannot publish.
- Subscribe narrowly.
mii/uns/#on a large plant is a lot of traffic. - Use an Uplink with ISA-95 topics when you need to push into a broker that you operate, with TLS and your own accounts.
- A rename of a code moves the topic. Tell the consumers first.
Troubleshooting
| Symptom | Cause | Fix |
|---|---|---|
| Connection refused on 1883 | The public listener is off, or the firewall blocks it. | Set MI_LITE_MQTT_PUBLIC_LISTEN, restart, open the port. |
| "Not authorised" | Wrong user or password. | Use mii-reader and the password from DATA-ACCESS.txt. |
| Connected but no messages | The tag is not bound to equipment, or the topic filter is wrong. | Bind tags. Check the codes, which are case sensitive. |
| Publishing is refused | The account is read only. | Use an Uplink or the write paths. |
| No value for a tag right after subscribing | Not retained. | Wait for the next value. |
| "reserved" in the uplink preview | The root starts with mii/v1, mii/write or spBv1.0. | Change the topic root. |