> ## Documentation Index
> Fetch the complete documentation index at: https://docs.coreflux.org/llms.txt
> Use this file to discover all available pages before exploring further.

# UNS Viewer

> Explore your broker's topic namespace as a live hierarchy graph in the Coreflux HUB

<Frame caption="UNS Viewer showing a building namespace of 34 topics: the hq branch expands into floors f1 and f2, each with hvac, energy, and lighting areas, and leaf topics carrying live values such as temp 22.55, humidity 39.20, and energy_kwh 160.12">
  <img src="https://mintcdn.com/coreflux/9DIExGzs82iBqQZS/images/hub-uns-viewer.png?fit=max&auto=format&n=9DIExGzs82iBqQZS&q=85&s=0a56874a07fce8cc9b95fa6a17282a7f" alt="Coreflux HUB UNS Viewer with the Namespace rail on the left showing Root filter, Include $ topics, Expand depth, and Collapse all / Expand all controls plus Canvas options for Legend, Minimap, Edge style and Spacing; the canvas graphs a namespace from Root through uns, porto, and hq into floors f1 and f2, with hvac, energy, and lighting branches carrying descendant counts and leaf topics showing live values including setpoint 21.50, occupied true, humidity 39.20, temp 22.55, power_kw 9.19, and energy_kwh 160.12; a 34 topics badge sits top right" width="1440" height="800" data-path="images/hub-uns-viewer.png" />
</Frame>

## Why Use the UNS Viewer?

You have hundreds or thousands of topics on your broker and you need to understand their *shape* — how the namespace is organised, which levels exist, and where a given device or metric sits in the hierarchy. Reading that structure from a flat list of topic strings is slow and error-prone. The UNS Viewer draws your broker's namespace as a hierarchy graph, so you can see the structure at a glance instead of reconstructing it in your head.

<Note>
  The UNS Viewer carries a **`BETA`** badge in its window header. It is available for everyday use, but its controls and layout may still change between releases.
</Note>

<Tip>
  **Like a map of your factory instead of a list of street names.** A topic list tells you what exists; the namespace graph shows you how it all fits together.
</Tip>

## When to Use It

* **Understanding an unfamiliar broker** — Open the namespace and read the hierarchy top-down instead of guessing at topic conventions
* **Reviewing your namespace design** — Check that a new site, line, or device was published under the level you intended
* **Finding where a metric lives** — Search for a name and see which branch of the hierarchy it belongs to
* **Tracing a topic back to your logic** — Each leaf reports which Actions and Routes produce or consume it
* **Comparing several topics at once** — Select multiple topics and watch their values and history side by side
* **Spotting activity** — Live pulses show which parts of the namespace are actually receiving traffic

***

## Accessing the UNS Viewer

Select **UNS Viewer** in the HUB dock. The window opens with the namespace already built from the topics the HUB has seen, and a `N topics` badge in the top-right corner reports how many leaf topics are currently in scope.

## Reading the Graph

The canvas draws two kinds of node:

| Node               | Shape   | Meaning                                                                                                              |
| ------------------ | ------- | -------------------------------------------------------------------------------------------------------------------- |
| **Namespace node** | Square  | A level in the hierarchy. Carries a count of everything beneath it, and a chevron to expand or collapse its children |
| **Leaf topic**     | Rounded | An actual MQTT topic. Shows its current value inline                                                                 |

Colour and motion carry meaning too, and the **Legend** toggle puts a key on the canvas while you are learning the vocabulary:

* **Live value** — a green pulse means a message just arrived on that topic
* **Activity pulse** — a green glow on a namespace node shows aggregated traffic somewhere below it
* **Search match** — an amber ring marks topics matching your current search

Only leaf topics carry payloads. Selecting a namespace node reports `No message at this time`, because the values live on its children.

## Navigating the Namespace

The **NAMESPACE** section of the left rail controls how much of the tree is drawn:

| Control                           | What it does                                                                                       |
| --------------------------------- | -------------------------------------------------------------------------------------------------- |
| **Root filter**                   | An MQTT filter that scopes the whole view, `#` by default. The `N topics` badge follows the filter |
| **Include \$ topics**             | Brings broker-internal `$SYS` and `$Visu` topics into the graph, which are hidden by default       |
| **Expand depth**                  | How many levels are expanded when the graph is built. Defaults to `3`                              |
| **Collapse all** / **Expand all** | Collapse the whole tree, or expand every level at once                                             |

<Note>
  The **Root filter** applies when you press **Enter** — typing a filter alone does not redraw the graph.
</Note>

On a large namespace, narrowing the root filter to a subtree such as `uns/porto/hq/f1/#` is the fastest way to keep the graph readable.

The **Search topics** box highlights matching topics in place with an amber ring rather than filtering the graph, so you keep the surrounding structure as context while you locate something.

<Frame caption="The Namespace rail with the Root filter scoped to uns/porto/hq/f1/#, which narrows the badge from 34 to 8 topics; Legend and Minimap are enabled, placing a key at the bottom-left of the canvas and an overview map at the bottom-right">
  <img src="https://mintcdn.com/coreflux/9DIExGzs82iBqQZS/images/hub-uns-viewer-controls.png?fit=max&auto=format&n=9DIExGzs82iBqQZS&q=85&s=2da582bf3f926da1385ce194edc94a9a" alt="Coreflux HUB UNS Viewer with the Root filter set to uns/porto/hq/f1/#, an 8 topics badge, Expand depth 7, and the Legend and Minimap switches turned on; the canvas shows only the f1 floor with hvac, energy, and lighting branches and live values setpoint 21.50, humidity 48.60, temp 22.63, power_kw 6.59, energy_kwh 160.47, enabled true, and level 13, with a legend reading Live value, Activity / update pulse, and Search match at the bottom left and a minimap at the bottom right" width="1440" height="800" data-path="images/hub-uns-viewer-controls.png" />
</Frame>

### Canvas options

The **CANVAS** section changes how the graph is drawn without changing what it contains:

| Option         | Choices                                                           |
| -------------- | ----------------------------------------------------------------- |
| **Legend**     | Show or hide the node and edge key                                |
| **Minimap**    | Show or hide an overview map for staying oriented in large graphs |
| **Edge style** | Smooth step, Bezier, Step, or Straight                            |
| **Spacing**    | Compact, Comfortable, or Spacious                                 |

Zoom, pan, and a **fit-view** control sit at the bottom-left of the canvas. Fit the view after expanding or filtering — a freshly laid-out graph is often off-centre.

***

## Inspecting a Topic

Select a leaf topic to open the inspector on the right. It reports the topic's breadcrumb path, its live value, its history, and how it relates to the LoT running on your broker.

<Frame caption="The inspector for uns/porto/hq/f2/hvac/temp: a Live indicator, playback controls, a message histogram spanning 23:03:27 to 23:07:36, a position counter reading 250 / 250, a value card showing 20.61 with a sparkline of recent history, and cross-references reporting that the topic triggers and is referenced by action SummarizeF2Hvac and is produced by route BacnetPortoHq">
  <img src="https://mintcdn.com/coreflux/9DIExGzs82iBqQZS/images/hub-uns-viewer-inspector.png?fit=max&auto=format&n=9DIExGzs82iBqQZS&q=85&s=e0a4de0e9aed49e2a9c3bf4e2d23a388" alt="Coreflux HUB UNS Viewer with the topic inspector open for uns/porto/hq/f2/hvac/temp, showing a breadcrumb of uns, porto, hq, f2, hvac, temp, First/Previous/Play/Next/Last playback controls, a green Live toggle, a timestamp of 23:07:36.790 with position 250 / 250, an orange message histogram running from 23:03:27.788 to 23:07:36.790, a value card reading 20.61 with a sparkline, and three cross-reference rows reading Triggers action SummarizeF2Hvac, Referenced by action SummarizeF2Hvac, and Produced by route BacnetPortoHq" width="1440" height="800" data-path="images/hub-uns-viewer-inspector.png" />
</Frame>

The inspector gives you:

* **A value card** with the current value and a **sparkline** of recent history
* **A message histogram** with the start and end timestamps of the buffered history
* **Playback controls** — step to first, previous, next, or last message, or play the history back
* **A `Live` toggle** that snaps to the latest message and resumes real-time updates
* **LoT cross-references** — which Actions the topic triggers, which reference it, and which Route produces it

Those cross-references are the bridge between your namespace and your logic. A topic written by a Route and consumed by an Action shows all three relationships, and a topic that nothing uses reports `Not referenced by any action or route.`

<Tip>
  Cross-references answer "is anything actually using this topic?" — useful when cleaning up a namespace, or when confirming that a newly deployed Action really is wired to the topic you intended.
</Tip>

### Comparing several topics

Turn on **multi-select** in the top-right corner to keep more than one topic selected. Each selection becomes a removable chip carrying its own message count, the inspector header counts them, and the histogram merges every selected topic onto one timeline so you can line their behaviour up against each other. Press `Esc` to leave multi-select.

With multi-select off, a plain click replaces the current selection, while `Shift`, `Ctrl`, or `⌘` click adds to it.

***

## Namespace Best Practices

The UNS Viewer makes the consequences of namespace design visible, and the shape it draws is only as good as the topics you publish:

* **Keep the hierarchy consistent** — model your physical or organisational structure, so the graph reads like your plant
* **Use lowercase, stable, descriptive segment names** — and avoid renaming a level once it is in use
* **Publish state as retained messages** so late subscribers, including this viewer, get the current value
* **Prefer descriptive leaf metrics** over opaque blobs that have to be parsed downstream
* **Narrow the root filter** on large namespaces rather than fighting a graph with thousands of nodes

<Note>
  The viewer builds its tree from the topics the HUB has observed. A topic that has never published, and holds no retained value, cannot appear in the graph.
</Note>

***

## Next Steps

<CardGroup cols={2}>
  <Card title="LoT Flow" icon="diagram-project" href="/hub/lot-flow">
    See the Actions, Models, and Routes behind those topics as a dependency graph.
  </Card>

  <Card title="Data Viewer" icon="satellite-dish" href="/hub/mqtt/data-viewer">
    Read individual payloads, track topics as cards, and publish test messages.
  </Card>
</CardGroup>
