# Name device inputs after NMOS labels

> Use tally Consumers to send Buttons port labels to a device's input names over Ember+, from the input's own label or from the source routed to it.

Many devices that receive NMOS streams have their own name for each input, such as a vision mixer's input list or a multiviewer's tile names. Those names are often typed in by hand and drift from the labels operators see in Buttons. This example keeps them in step using only the Tally / UMD system: a tally **Consumer** for each input works out the label, and an **Action** reaction writes it to the device's input name over Ember+ every time the label changes.

A Consumer is normally used to drive a tally or UMD display. Here it drives nothing but the label: it watches the receiver bundle that feeds the device input, resolves the label you want, and sends it.

Choose which name each input should carry:

| The device input is named after | Changes when | Label 1 **Relation** |
| --- | --- | --- |
| The input's own label: the receiver bundle that feeds it, as you've labelled it in Buttons. | You edit that bundle's label. | **Selected Watch Item** |
| The routed source: the NMOS source currently routed to the input. | You route a different source, or edit the source's label. | **Active Source** |

Labels in Buttons are the master. Renaming an input on the device itself doesn't change the label in Buttons, and the next label change in Buttons overwrites it.

## Before you begin

You need:

- Buttons 1.10.
- The NMOS devices whose receivers feed the device's inputs, adopted in Buttons. See [Discover, adopt, and route NMOS resources](/docs/buttons/v1.10/nmos/discover-and-adopt).
- A device that exposes its input names as writable Ember+ string parameters, and the Ember+ path of each input's name. A provider browser such as Lawo's EmberViewer shows the paths.
- The labels you want to send, set in **Ports Config**. See [Configure ports and labels](/docs/buttons/v1.10/routing/configure-ports-and-labels).

## Add the Ember+ connection

1. Add a connection with the **Generic Ember+** module.
2. Set **Target Host** and **Target Port** to the device's Ember+ provider.
3. Under **Paths to parameters to monitor**, enter the Ember+ path of each input's name, separated by commas. The connection then offers these paths when you set up the action.
4. Save and enable the connection, and check that it shows **Connected**.

The module works only on the paths you give it. It doesn't read the device's whole Ember+ tree.

## Create a Consumer for each input

1. Open **Routing → Tally / UMD → Consumers**, and select **Add Consumer**. Give it a label that says which input it names, for example `Input 1 name`.
2. Under **Watch Item**, set **Type** to **Bundle**, **Bundle Type** to **Destination**, and pick the NMOS receiver bundle that feeds the device input.

![The Watch Item section of a Consumer with Type set to Bundle, Bundle Type set to Destination, and the receiver bundle Mixer IN 1 selected](https://bitfocus.io/api/docs-media/file/consumer-watch-item.png?prefix=docs-media)

3. Under **Label Lookups**, in **Label 1**:

- Set **Relation** to **Selected Watch Item** for the input's own label, or to **Active Source** for the label of the source routed to it.
- Set **Label Target** to **Bundle labels**, and **Label Type** to **User**. A bundle with no User label falls back through the **Fallback Strategy**, ending with the NMOS name.
- Fill in **Empty Label**, for example `NO SOURCE`. With **Active Source**, the device input gets this name when nothing is routed to it.
- **Resolved Label** shows the name the device input will get.

The input's own label, with **Selected Watch Item**:

![Label 1 with Relation set to Selected Watch Item, Label Target Bundle labels, Label Type User, Empty Label NO SOURCE, and Resolved Label Mixer IN 1](https://bitfocus.io/api/docs-media/file/label-lookup-own-label.png?prefix=docs-media)

The routed source, with **Active Source**:

![Label 1 with Relation set to Active Source, Label Target Bundle labels, Label Type User, Empty Label NO SOURCE, and Resolved Label Camera 2](https://bitfocus.io/api/docs-media/file/label-lookup-routed-source.png?prefix=docs-media)

## Send the label to the device

Still in the Consumer, add a reaction that runs the Ember+ action with the label:

1. Under **Reactions**, select **Add Action**.
2. Set **Connection** to your Generic Ember+ connection, and **Action** to **Set Value String**.
3. Under **Trigger Events**, clear **Tally 1 Change**, and select **Label 1 Change**. The action then runs whenever the resolved label changes, and not on tally changes.
4. Under **Action Options**:

- In **Select registered path**, pick the Ember+ path of this input's name.
- Next to **Value**, change **Static Value** to **Label 1**. The field then reads *Will receive Label 1 (string)*.

5. Select **Save**.

![An Action reaction with Connection set to Vision mixer, Action Set Value String, only Label 1 Change selected under Trigger Events, a registered Ember+ path selected, and Value set to receive Label 1](https://bitfocus.io/api/docs-media/file/action-reaction.png?prefix=docs-media)

When you save, the Consumer sends the current label straight away, so the device input is named at once. It does the same when Buttons starts.

Repeat for each device input. Each input has its own Consumer and its own Ember+ path.

## Check it

- **Input's own label:** edit the User label of the receiver bundle in **Ports Config**. The device input takes the new name.
- **Routed source:** route a different source to the receiver, or edit the routed source's User label. The device input takes the new source's name.

![Ports Config with the User label Mixer IN 1 on the receiver bundle and Camera 1 on a source bundle](https://bitfocus.io/api/docs-media/file/input-user-label.png?prefix=docs-media)

**Resolved Label** in the Consumer always shows the name the device input should have.

## Troubleshooting

| What you see | What to check |
| --- | --- |
| The device input name never changes. | That the Consumer is on, **Label 1 Change** is selected under **Trigger Events**, and the Ember+ connection shows **Connected**. |
| The device input gets the same text every time, or no text. | That **Value** is set to **Label 1**, not **Static Value**. |
| The path isn't offered in **Select registered path**. | Add it to **Paths to parameters to monitor** on the Ember+ connection, and save the connection. |
| The action runs, but the device keeps its old name. | The Ember+ path, and that the device allows the parameter to be written. |
| The action runs on every tally change. | Clear **Tally 1 Change** and the other **Tally 1** triggers. Only **Label 1 Change** should be selected. |
| The device input gets the NMOS name, not your label. | That the bundle, or with **Active Source** the routed source bundle, has a User label. Without one, Buttons falls back to the next label, ending with the NMOS name. |
| The device input gets the receiver's name instead of the routed source. | That **Relation** in **Label 1** is **Active Source**, not **Selected Watch Item**. |
| The device input reads `NO SOURCE` or is blank. | Nothing is routed to the receiver. That's the **Empty Label** at work. |

## Related pages

- [Understand the Tally system](/docs/buttons/v1.10/tally/concepts)
- [Configure ports and labels](/docs/buttons/v1.10/routing/configure-ports-and-labels)
- [Discover, adopt, and route NMOS resources](/docs/buttons/v1.10/nmos/discover-and-adopt)
- To do the same from a workflow instead, see the [Port Label](/docs/buttons/v1.10/reference/workflow-nodes/internal#port-label) and [Internal Feedback](/docs/buttons/v1.10/reference/workflow-nodes/internal#internal-feedback) nodes.
