Creating Custom Device Labels

This guide assumes familiarity with:

In this guide, you'll learn how to use the Custom Label Feature to customize the device label names for user utterances. You'll also learn how to use the following:

Example Custom Label Name: "Set the media input source of TV to PC."

In this example, "input source" is the device label name.

Start creating the Action Flow for this example by dragging a Start Node and an Attribute Node from the Action Flow Nodes Sidebar to the editor area. Then, connect the Start Node's main port to the Attribute Node's trigger port and configure the Attribute Node to fetch the device's mediaInputSource.

Next, add a custom label to the Metadata.

Adding a Custom Label to the Metadata

In the Metadata Sidebar on the left, click the add icon Add Icon to the right of Labels in the Assets menu.

Add a Custom Label from Metadata Menu

The Labels pop-up appears.

Labels Pop-up Appears, showing the Labels Name input field.

Next, create a custom label.

Creating a Custom Label

  1. Type a custom label name for a device label and click SAVE. This example uses the device label name inputSource.Enter Custom Label Name A tab opens and a Custom Labels table appears. New Tab Opens and Custom Labels Table Appears
  2. Add a label attribute name to the attribute column and the relevant locale columns by double-clicking on a specific field. A label attribute is a device label attribute that can be recognized by the device. Label attributes are mapped to the custom label name, in this case inputSource. Enter Label Attribute Names
  3. Add more label attributes to the table as needed, by clicking the 3 vertical dots on the left and selecting Insert row - below. Enter Custom Label Name

Now, you can use the custom label in your action flow.

Using a Custom Label

To use a custom label in your action flow:

  1. Add one toModeLabel Node to the graph.
  2. Connect the success port of the Attribute Node to the trigger port of the toModeLabel Node.
  3. Add an Utterance Locale Node to the graph, which contains the locale of the user's utterance.
  4. Configure the Utterance Locale Node to en-US by clicking on the node and selecting en-US from the drop-down menu. Configure Utterance Locale Node
  5. Click the toModeLabel Node. This opens the Node Configuration Menu on the right. toModeLabel Node Configuration Menu Opens
  6. Select metadata in the namespace drop-down menu and inputSource in the table drop-down menu. Leave the findOption drop-down as the default value of findFirst. Configure Node
  7. Connect the Attribute Node's value port to the toModeLabel Node's label port and the Utterance Locale Node's value port to the toModeLabel Node's locale port.
  8. Add a Constant Node and configure it to the string value "media input source." Constant Node Configuration
  9. Add a Response Node and configure it. This example uses the dialog template "The #{Capability} is #{Value}." Based on this template, the actual user dialog for this action flow would be "The media input source is PC."
  10. Connect the toModeLabel Node's found port to theResponse Node's trigger port, and its value port to the Response Node's value port.
  11. Connect the Constant Node's value port to the Response Node's capability port.

This is the final action flow:

Final Action Flow

You can test your action flow in BHS with the TRY IT feature.

Testing Your Action Flow

To test the action flow, click the Try It button at the top right of the editor window. The flow editor should look like this:

Test the Action Flow

In this test run, Bixby first fetches the device's current inputSource, which is "dvi." Then, Bixby sets the device's inputSource to "PC" in the en-US locale. Finally, Bixby responds to the user by saying "The media input source is PC."