Google Smart Home Action: Account linking successful, SYNC response sent by fulfillment with status code 200 but Google Home app reporting error


Question: 

I am building a Google Smart Home action with fulfillment hosted on AWS as a lambda function in node.js with the node implementation for Google Smart Home actions, exposed via AWS API gateway and an external OAuth 2 provider serving as authorizer for API gateway. My fulfilment includes SYNC, QUERY and EXECUTE methods and returns valid JSON responses including all required attributes from what I can see in the docs. I set up everything in the Actions on Google console including fulfillment URL pointing to my method on AWS API gateway and account linking details. Afterwards I clicked on "Test" in order to make the Smart Home action testable in the Google Home companion app.

I can see my Smart Home action "[test] ACTIONNAME" in the Google Home companion app when trying to add new devices. When I click on the action, I get redirected correctly to my OAuth 2 provider, log in and get redirected to the Google Home app. It then shows a notification on the bottom "[test] ist verknüpft" (German saying "[test] ACTIONNAME got linked"). Shortly after that, it shows a second notification "Ein Fehler ist aufgetreten. Bitte versuche es noch einmal" (German saying "An error occured. Please try again". When I click the action again, it says again "[test] ACTIONNAME got linked" followed by the second notification "An error occured. Please try again", so no need to login again as Google Home obviously already got a token successfully.

I already checked my AWS Cloud Watch logs and I can see that whenever I click on the action in the "Add new device" dialog of the Google Home companion app, Google successfully calls my fulfillment, receiving a SYNC response with 200 status code which looks like the following (anonymized):

{
    "statusCode": 200,
    "body": "{\"requestId\":\"6541496806317265099\",\"payload\":{\"agentUserId\":\"1234\",\"devices\":[{\"id\":\device_id",\"type\":\"action.devices.types.SHUTTER\",\"traits\":[\"action.devices.traits.OpenClose\"],\"name\":{\"name\":\"Device Name\"},\"willReportState\":false,\"attributes\":{\"openDirection\":[\"UP\",\"DOWN\"]}}]}}",
    "headers": {
        "content-type": "application/json;charset=utf-8"
    }
}

So it seems to me that Google Home got successfully authorized and receives a SYNC response but somehow can not process it. But it should be correct, isn't it?

What I also tried is using the Google Smart Home test suite but when doing that, after typing in my AgentUserId and attaching my token receiver service account certificate, It shows a notification that the requestSync method receives a 404 status code with the message "Requested entity was not found.". That also happens, when I try to call the Homegraph API myself via a POST request as in the following:

curl -i -s -X POST -H "Content-Type: application/json" -d "{agentUserId: \"1234\", async: true}" "https://homegraph.googleapis.com/v1/devices:requestSync?key=MYAPIKEY"

I guess thats because Homegraph does not yet know which devices the user with AgentUserId 1234 has as the SYNC message was never processed correctly by Google home.

I am pretty lost and do not know how to gather further information on where the problem sits. Does anyone have an idea on how to get this solved?

Edit: Further pieces of information - I have tried the following additional things: 1. I created a new Actions on Google project with the same configuration - same problem here, did not help. 2. I had a look into the Stackdriver logs for the smart home project on GCP and what is really strange is that there are no logs at all for resource Google Assistant but also no logs in general for the timeslot when I try to link the smart home action in the Google Home app. Shouldn’t it at least log the oauth flow (which seems to work as expected) as well as the SYNC request sent to my fulfillment?




1 Answer: 

I got it - the simple solution was that the node.js implementation for Google actions expects the AWS API integration to be a lambda PROXY integration which I had not configured like that as one can also see in the SYNC response stated in the question. So just switching to AWS lambda proxy integration solved the problem.

 

More Articles


botframework - Ms Teams Bot Icon is not displayed

I've used app studio from MS Teams to creat a manifest for a Bot App. I've uploaded the full color picture as well as trasparent outlone. However the icon is not displaying at the chat window. Only the default icon is visivle. Any ideas, how can I solve the issue? Thanks a lot!

payflowpro - How to use paypal payflow api to charge sale in canadian dollars

I have a custom application that is integrated with the paypal payflow API. We are expanding to Canada and would like to charge in the Canadian dollar for our Canadian customers but it keeps defaulting to the US Dollar.I'm trying to pass 'CURRENCY'=> 'CAD' in the REST call via curl. I can't find a

android - Google Actions does not work from OK Google. my app is not recognised

I have downloaded this basic example from google: https://github.com/actions-on-google/appactions-fitness-kotlinNow if I do: adb shell am start -a android.intent.action.VIEW -d "https://fit-actions.firebaseapp.com/start"It will start my app. And the deeplink is being recognized.The example shows tha


java - How to integrate KNET payment gateway with php

How can I integrate the KNET payment gateway with PHP? The gateway id only works with Java and .NET.

c# - Microsoft Bot Framework works locally, but fails remotely

I have this bot that is fairly complicated, but it works locally. But as soon as I publish it, it fails with the error: Sorry, my bot code is having an issue.I have tried using Application Insights, but it isn't showing the error details.The error always happens at the same point:/// <summary>

Xcode: App installation failed No code signature found

I want run app on real device ( iphone 6 or 8 )But i get this error : App installation failed No code signature found.I try all below solutions but not work for me:iOS app testing. App installation failed. No code signature foundMy xcode version is 9.2I'm tired :(


How do I force my Google home to download latest version of the local app

I'm developing the smart device handler using Google Home Local SDK. How do I force device to reload and restart the app? (now I have to unplug the power cord, it does not looks good as it sparks)also I have a couple of Google Home devices, how do I tell which of them should execute requests, is it

plugins - Magento community store have any EMI extensions?

I have searched a Magento extension for EMI options, but i didn't see any available extensions, if anyone knows any payment extensions including EMI please reply, or how to develop an EMI extension for magento? i am new in Magento family

Notification of which channel (not team) a bot is added to in Microsoft Teams

In Teams, it's possible to create a bot with a team scope. When this happens, at install time the user is prompted to choose a team, and then specify a channel "where you want to use the app".When the users chooses a Team, I see the conversationUpdate message with the MembersAdded list containing th

firebase - How to get billing details per user or customer in Firestore?

In Firebase Realtime Database you may create multiple databases(database sharding) which allows you to map a specific customer to a database. This enables you to get information per customer, such as billing details, one would assume.I was wondering how can you get this in Firestore or what would be