Skip to main content

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
WhereAn MQTT or AWS IoT uplink to your brokerThe broker inside the Console or runtime
RootYour choice (Topic root (optional)), or noneAlways mii/uns
GranularityOne message per group, or one per tag (One topic per tag)One message per tag
PayloadThe uplink's upload format{value, quality, ts, tagId}
DirectionOut to your brokerYour client reads from the plant
AccountYour broker'smii-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. Line1 and line1 are 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​

LimitValue
Topic length1024 bytes (AWS IoT: 256)
Levels32 (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​

CodeMeaning
missing-levelA required level is missing.
too-longOver the byte limit.
too-deepOver the level limit.
reservedStarts with a reserved root.
no-pathThe tag is not bound to equipment, so it has no path.
bad-pathThe path does not parse.
mixed-equipmentThe tags of a group belong to different equipment. The group keeps its default topic.
collisionTwo groups or tags give the same topic.
shared-topicAnother 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.

ItemValue
Topicmii/uns/<enterprise>/<site>/<area>/<workCenter>[/<workUnit>]/<equipment>/<tag>
User namemii-reader
RightsRead only, and only the topic tree mii/uns/#. Everything else is denied. The internal topics mii/v1/… are closed.
QoS0
RetainedNo
MessagesOne 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"
}
FieldMeaning
valueThe value. Left out when the read failed.
qualitygood, uncertain, bad or unknown. See Data types and quality.
tsISO 8601 UTC with milliseconds.
tagIdThe tag identity. Left out when empty.
errorA 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:

  1. Open config/mii.env of the Lite installation and set the listen address:

    MI_LITE_MQTT_PUBLIC_LISTEN=0.0.0.0:1883

    Use off (or leave it empty) to close it. The Docker image reads the variable from its environment.

  2. Restart the MakeIntelligent service.

  3. Lite writes the read-only login to the file DATA-ACCESS.txt in its data directory. It has the broker address, the user mii-reader, the password and the topic tree.

  4. 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.

Plain MQTT

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, not Line 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​

SymptomCauseFix
Connection refused on 1883The 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 messagesThe tag is not bound to equipment, or the topic filter is wrong.Bind tags. Check the codes, which are case sensitive.
Publishing is refusedThe account is read only.Use an Uplink or the write paths.
No value for a tag right after subscribingNot retained.Wait for the next value.
"reserved" in the uplink previewThe root starts with mii/v1, mii/write or spBv1.0.Change the topic root.