This guide assumes familiarity with the following information:
Attribute
node (Creating a Bixby Response Using Device Status)Response
node (Creating a Bixby Response Using Device Status)In this guide, you'll learn how to use the Custom Label Feature to customize the device label names for user utterances. The device used in this guide is a SmartThings-enabled TV. 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.
In the metadata sidebar on the left, click the add icon to the right of Labels in the Assets menu.
The Labels pop-up appears.
Next, create a custom label.
inputSource.
A tab opens and a Custom Labels table appears.
inputSource
.
Now, you can use the custom label in your action flow.
To use a custom label in your action flow, do the following:
toModeLabel
node to the graph.Attribute
node to the trigger port of the toModeLabel
node.Utterance Locale
node to the graph, which contains the locale of the user's utterance.Utterance Locale
node to en-US by clicking on the node and selecting en-US from the menu.
toModeLabel
node. This opens the Node Configuration menu on the right.
findOption
as the default value of findFirst
.
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.Constant
node and configure it to the string value "media input source."
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."toModeLabel
node's found port to theResponse
node's trigger port, and its value port to the Response
node's value port.Constant
node's value port to the Response
node's capability port.This is the final action flow:
You can test your action flow in BHS with the TRY IT feature.
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:
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."
The Node Recommendation feature enables you to get recommendations for next possible nodes, and can make it easier to create a graph.
The following video tutorial gives another example of how to use custom responses and confirmations in BHS.