Quickstart: Use prebuilt Home automation app

In this quickstart, create a LUIS app that uses the prebuilt domain HomeAutomation for turning lights and appliances on and off. This prebuilt domain provides intents, entities, and example utterances for you. When you're finished, you'll have a LUIS endpoint running in the cloud.

Prerequisites

For this article, you need a free LUIS account, created on the LUIS portal at https://www.luis.ai.

Create a new app

You can create and manage your applications on My Apps.

  1. Sign in to the LUIS portal.

  2. Select Create new app.

    Screenshot of app list

  3. In the dialog box, name your application "Home Automation".

    Screenshot of Create new app pop-up dialog

  4. Choose your application culture. For this Home Automation app, choose English. Then select Done. LUIS creates the Home Automation app.

    Note

    The culture cannot be changed once the application is created.

Add prebuilt domain

Select Prebuilt domains in the left-side navigation pane. Then search for "Home". Select Add domain.

Screenshot of Home Automation domain called out in prebuilt domain menu

When the domain is successfully added, the prebuilt domain box displays a Remove domain button.

Screenshot of Home Automation domain with remove button

Intents and entities

Select Intents in the left-side navigation pane to review the HomeAutomation domain intents. Each intent has sample utterances.

Note

None is an intent provided by all LUIS apps. You use it to handle utterances that don't correspond to functionality your app provides.

Select the HomeAutomation.TurnOff intent. You can see that the intent contains a list of utterances that are labeled with entities.

Screenshot of HomeAutomation.TurnOff intent

Train the LUIS app

  1. In the top right side of the LUIS website, select the Train button.

    Train button

  2. Training is complete when you see the green status bar at the top of the website confirming success.

    Trained status bar

Test your app

Once you've trained your app, you can test it. Select Test in the top navigation. Type a test utterance like "Turn off the lights" into the Interactive Testing pane, and press Enter.

Turn off the lights

Check that the top scoring intent corresponds to the intent you expected for each test utterance.

In this example, "Turn off the lights" is correctly identified as the top scoring intent of "HomeAutomation.TurnOff."

Screenshot of Test panel with utterance highlighted

Select Test again to collapse the test pane.

Publish the app to get the endpoint URL

In order to receive a LUIS prediction in a chat bot or other client application, you need to publish the app to the endpoint.

  1. Select Publish in the top right navigation.

    LUIS publish to endpoint button in top right menu

  2. Select the Production slot and the Publish button.

    LUIS publish to endpoint

  3. Publishing is complete when you see the green status bar at the top of the website confirming success.

    LUIS publish to endpoint

  4. Select the endpoints link in the green status bar to go to the Keys and endpoints page. The endpoint URLs are listed at the bottom.

Query the endpoint with a different utterance

  1. In the Manage section (top right menu), on the Keys and endpoints page (left menu), select the endpoint URL at the bottom of the page. This action opens another browser tab with the endpoint URL in the address bar.

    The endpoint URL looks like https://<region>.api.cognitive.microsoft.com/luis/v2.0/apps/<appID>?verbose=true&subscription-key=<YOUR_KEY>&<optional-name-value-pairs>&q=<user-utterance-text>.

  2. Go to the end of the URL in the address and enter turn off the living room light, and then press Enter. The browser displays the JSON response of your HTTP endpoint.

    Screenshot of browser with JSON result detects the intent TurnOff

Clean up resources

When no longer needed, delete the LUIS app. To do so, select My apps from the top left menu. Select the ellipsis (...) to the right of the app name in the app list, select Delete. On the pop-up dialog Delete app?, select Ok.

Next steps

You can call the endpoint from code: