Renaming API.AI to Dialogflow (#3699)

This commit is contained in:
Fabian Affolter 2017-10-21 22:12:33 +02:00 committed by Fabian Affolter
parent b43fe99178
commit 2b982ea5f8
No known key found for this signature in database
GPG Key ID: DDF3D6F44AAB1336
3 changed files with 25 additions and 21 deletions

View File

@ -1,7 +1,7 @@
---
layout: page
title: "Api.AI"
description: "Instructions how integrate api.ai with Home Assistant."
title: "Dialogflow"
description: "Instructions how integrate Dialogflow with Home Assistant."
date: 2017-01-27 11:28
sidebar: true
comments: false
@ -10,16 +10,21 @@ footer: true
logo: apiai.png
ha_category: Voice
featured: false
ha_release: 0.38
ha_release: 0.56
redirect_from: /components/apiai/
---
This component is designed to be used with the "webhook" integration in [api.ai][apiai-web]. When a conversation ends with a user, api.ai sends an action and parameters to the webhook.
<p class='note'>
Before 0.56 this component was named `apiai`.
</p>
api.ai requires a public endpoint (HTTPS recommended), so your Home Assistant should be exposed to the Internet. api.ai will return fallback answers if your server does not answer, or takes too long (more than 5 seconds).
The `dialogflow` component is designed to be used with the [webhook](https://dialogflow.com/docs/fulfillment#webhook) integration of [Dialogflow](https://dialogflow.com/). When a conversation ends with a user, Dialogflow sends an action and parameters to the webhook.
api.ai could be integrated with many popular messaging, virtual assistant and IoT platforms, eg.: Google Assistant (Google Actions), Skype, Messenger. [See here](https://docs.api.ai/docs/integrations) the complete list.
Dialogflow requires a public endpoint (HTTPS recommended), so your Home Assistant should be exposed to the Internet. Dialogflow will return fallback answers if your server does not answer or takes too long (more than 5 seconds).
Using Api.ai will be easy to create conversations like:
Dialogflow could be [integrated](https://dialogflow.com/docs/integrations/) with many popular messaging, virtual assistant and IoT platforms.
Using Dialogflow will be easy to create conversations like:
> User: What is the temperature at home?
>
@ -33,40 +38,41 @@ Using Api.ai will be easy to create conversations like:
>
> Bot: Turning on kitchen light
To use this integration, you should define a conversation (intent) in Api.ai, configure Home Assistant with the speech to return and, optionally, the action to execute.
To use this integration, you should define a conversation (intent) in Dialogflow, configure Home Assistant with the speech to return and, optionally, the action to execute.
### {% linkable_title Configuring your api.ai account %}
### {% linkable_title Configuring your Dialogflow account %}
- [Login][apiai-web] with your Google account.
- [Login](https://console.dialogflow.com/) with your Google account
- Click on "Create Agent"
- Select name, language (if you are planning to use it with Google Actions check [here](https://support.google.com/assistant/answer/7108196?hl=en) supported languages) and time zone
- Select name, language (if you are planning to use Google Actions check their [supported languages](https://support.google.com/assistant/answer/7108196?hl=en)) and time zone
- Click "Save"
- Go to "Fulfillment" (in the left menu)
- Enable Webhook and set your Home Assistant URL with the Api.ai endpoint. Eg.: ``https://myhome.duckdns.org/api/apiai?api_password=HA_PASSWORD``
- Enable Webhook and set your Home Assistant URL with the Dialogflow endpoint, e.g. `https://myhome.duckdns.org/api/dialogflow?api_password=HA_PASSWORD`
- Click "Save"
- Create a new intent
- Below "User says" write one phrase that you, the user, will tell Api.ai. Eg.: Which is the temperature at home?
- Below "User says" write one phrase that you, the user, will tell Dialogflow, e.g. `What is the temperature at home?`
- In "Action" set some key (this will be the bind with Home Assistant configuration), eg.: GetTemperature
- In "Response" set "Cannot connect to Home Assistant or it is taking to long" (fall back response)
- At the end of the page, click on "Fulfillment" and check "Use webhook"
- Click "Save"
- On the top right, where is written "Try it now...", write, or say, the phrase you have previously defined and hit enter
- Api.ai has send a request to your Home Assistant server
- Dialogflow has send a request to your Home Assistant server
Take a look to "Integrations", in the left menu, to configure third parties.
### {% linkable_title Configuring Home Assistant %}
When activated, the Alexa component will have Home Assistant's native intent support handle the incoming intents. If you want to run actions based on intents, use the [`intent_script`](/components/intent_script) component.
When activated, the [`alexa` component](/components/alexa/) will have Home Assistant's native intent support handle the incoming intents. If you want to run actions based on intents, use the [`intent_script`](/components/intent_script) component.
## {% linkable_title Examples %}
Download [this zip](https://github.com/home-assistant/home-assistant.github.io/blob/next/source/assets/HomeAssistant_APIAI.zip) and load it in your Api.ai agent (Settings -> Export and Import) for examples intents to use with this configuration:
Download [this zip](https://github.com/home-assistant/home-assistant.github.io/blob/next/source/assets/HomeAssistant_APIAI.zip) and load it in your Dialogflow agent (**Settings** -> **Export and Import**) for examples intents to use with this configuration:
{% raw %}
```yaml
{% raw %}# Example configuration.yaml entry
apiai:
# Example configuration.yaml entry
dialogflow:
intent_script:
Temperature:
@ -109,8 +115,6 @@ intent_script:
{%- endif -%}
data_template:
entity_id: "switch.light_{{ Room | replace(' ', '_') }}"
{% endraw %}
```
{% endraw %}
[apiai-web]: https://api.ai/
[templates]: /topics/templating/

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB