5

So this type of error is being reported on a lot of community boards over the course of the last year with no acceptable answer we could find. We have just started our journey integrating with Google Home and created a Home Automation Action and we are getting a similar error …

{
 insertId:  "10wvnj2fyb1thy"  
 logName:  "projects/bitdog-home-f69bd/logs/actions.googleapis.com%2Factions"
Show matching entries
Hide matching entries
Add field to summary line

 receiveTimestamp:  "2018-12-06T13:28:13.939975519Z"  
 resource: {
  labels: {
   action_id:  "SMART_HOME_SYNC"    
   project_id:  "bitdog-home-f69bd"    
   version_id:  ""    
  }
  type:  "assistant_action"   
 }
 severity:  "ERROR"  
 textPayload:  "SYNC: Request ID 742344561631232315 failed with code: OPEN_AUTH_FAILURE"  
 timestamp:  "2018-12-06T13:28:13.931998358Z"  
}

This shows on Google Home app as "Couldn't update the setting, check your connection"

The OAuth service logs show a successful account linking and a successful refresh_token request. Google does not attempt a SYNC call to the Action handler from what we can tell.

We have other systems using the OAuth server and they are working well and we are little lost on how to proceed to debug this issue. We created a support ticket today but I don't feel confident that we will get meaningful help.

We have also tried using the Google Home app on Android and iOS. We have tried changing the default browser from Chrome to Firefox. Nothing has changed the outcome. We also made sure that our access_token was in JWT format to see if google was sensitive to token size or format and nothing worked. We even made sure that the Google Home app user matched the user logged into the browser.

Help!

Linda Lawton - DaImTo
  • 106,405
  • 32
  • 180
  • 449
  • It seems like there could be a problem with your OAuth implementation. Does your OAuth work normally? Can you try [hardcoding your OAuth for testing](https://github.com/googlecodelabs/smarthome-washer/blob/master/washer-done/functions/index.js#L27) to see if there may have been an issue with it? – Nick Felker Dec 07 '18 at 18:59

4 Answers4

1

I did get it working. It was already working with an Amazon Echo Skill but it seems that Google's implementation (OpenAuth) is a bit more strict. I changed my access_token from a proprietary encrypted token format to a legit signed JWT token. I also removed expires_in from the response and it started working, not sure if it was the access_token JWT token format or removal of expires_in. I'm happy I can move on. If I get a chance, I will test to see which change made it work and comment here again.

Thank you.

0

To anyone with this problem–

I had to take multiple steps to resolve this issue, which are not clearly outlined in any documentation.

  1. As per Google support:

    Please adjust your account linking implementation from implicit to auth code flow then perform test again.

On the documentation for OAuth account linking, it says there are two methods of authentication: implicit and auth code. Apparently, only the auth code flow works for smart home.

  1. I am using the Actions on Google Node.js library. While poking through the documentation, I found that:

    [The SYNC request fulfillment] should return a valid response or a Promise that resolves to valid response.

The problem is that I was doing a database operation (which took time), so I couldn't simply return a value when it was ready; I had to return a Promise insead, then fulfill that promise later.


Hopefully this is helpful to anyone stuck on this reoccurring issue! Basically, check your auth flow and make SYNC is returning a valid JS object on time.

yummypasta
  • 1,398
  • 2
  • 17
  • 36
  • "Apparently, only the auth code flow works for smart home." -> Did you find something in the docs that mention this? I can't find anywhere that specifies this – Matija Martic Nov 27 '19 at 01:31
  • 1
    @MatijaMartic Exactly. The docs for smarthome are missing a lot of stuff, but AFAIK you have to use auth code. – yummypasta Nov 27 '19 at 23:52
0

I was facing the same issue from last 2 weeks and was wonder when saw it is a 3 steps problem.

  1. Check your SYNC intent is properly parsed

  2. Incorrect Response Structure (Verify here-Smart Home SYNC Data Validator)

  3. Device Response time-out should be less than 5 sec.

You can check Link

0

My problem started when I connected by Sonoff Bridge.

So I got it working by removing my 'Sonoff Bridge' and connecting it to Google Home. (All mu light are now working). Added the Bridge again to Sonoff and using IFTTT to connect to my Bridge

Pieter Linde
  • 61
  • 1
  • 2