Core: Dialogflow API v2 not working with webhooks - Needs updating

Created on 12 Nov 2018  路  6Comments  路  Source: home-assistant/core

Home Assistant release with the issue:

0.82.0

Operating environment (Hass.io/Docker/Windows/etc.):

Hass.io

Component/platform:

https://www.home-assistant.io/components/dialogflow/

Description of problem:

image

Dialogflow is not working with webhooks. I have used the integrations panel to get a webhook, added it to the Fulfillment section of Dialogflow, saved etc. but the error below is always produced.

Problem-relevant configuration.yaml entries and (fill out even if it seems unimportant):

dialogflow:

intent_script:
  DownstairsTemperature:
    speech:
      text: The temperature downstairs is {{ states('sensor.dht22_01_temperature') }} degrees

Traceback (if applicable):

2018-11-12 20:01:04 ERROR (MainThread) [homeassistant.components.webhook] Error processing webhook OBFUSCATED
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/homeassistant/components/webhook.py", line 79, in post
    response = await handler(hass, webhook_id, request)
  File "/usr/local/lib/python3.6/site-packages/homeassistant/components/dialogflow/__init__.py", line 43, in handle_webhook
    response = await async_handle_message(hass, message)
  File "/usr/local/lib/python3.6/site-packages/homeassistant/components/dialogflow/__init__.py", line 108, in async_handle_message
    action_incomplete = req['actionIncomplete']
TypeError: 'NoneType' object is not subscriptable

image
image

Additional Information

The line it is pointing to is here:

https://github.com/home-assistant/home-assistant/blob/dev/homeassistant/components/dialogflow/__init__.py#L108

and looking at the response in dialogflow, actionIncomplete does not exist:

{
  "responseId": "OBFUSCATED",
  "queryResult": {
    "queryText": "whats the temperature",
    "action": "DownstairsTemperature",
    "parameters": {},
    "allRequiredParamsPresent": true,
    "fulfillmentText": "Sorry but I cannot connect to your Home Assistant",
    "fulfillmentMessages": [
      {
        "text": {
          "text": [
            "Sorry but I cannot connect to your Home Assistant"
          ]
        }
      }
    ],
    "intent": {
      "name": "projects/timmoland-84d69/agent/intents/OBFUSCATED",
      "displayName": "DownstairsTemperature"
    },
    "intentDetectionConfidence": 1,
    "languageCode": "en"
  },
  "originalDetectIntentRequest": {
    "payload": {}
  },
  "session": "projects/timmoland-84d69/agent/sessions/OBFUSCATED"
}
dialogflow

Most helpful comment

v1 is no longer available for new setups:

image

Google are also shutting down v1 on October 23rd 2019 according to their banner on the console:

image

https://dialogflow.com/docs/reference/v1-v2-migration-guide

All 6 comments

Try to use V1 API, it should works

Thanks @boggiano. That worked. Perhaps we should upgrade the library or at least update the docs since they are pretty out of date with Dialogflow's new UI

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.

Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment :+1:

Looks like a PR is awaiting merge first

v1 is no longer available for new setups:

image

Google are also shutting down v1 on October 23rd 2019 according to their banner on the console:

image

https://dialogflow.com/docs/reference/v1-v2-migration-guide

v1 is no longer available for new setups:

image

Google are also shutting down v1 on October 23rd 2019 according to their banner on the console:

image

https://dialogflow.com/docs/reference/v1-v2-migration-guide

Was this page helpful?
0 / 5 - 0 ratings