cancel
Showing results for 
Search instead for 
Did you mean: 

SDM Error 400 "Precondition check failed."

Cringely
Community Member

Hi there,

I've been running through the steps described here: https://developers.google.com/nest/device-access/authorize

After creating a new Project, generating an Oauth2 cred, linking with a new Device Access Console I'm unable to get past step 4 of the quick reference linked above. I've attempted to limit the scope of devices allowed to be accessed with no change.

 

The response I receive from SDM is always:

{
  "error": {
    "code": 400,
    "message": "Precondition check failed.",
    "status": "FAILED_PRECONDITION"
  }
}

 

I've been unable to locate this particular error message in the Device Access documentation/reference site.

Has anyone run into this before or have any thoughts on how to resolve?

1 Recommended Answer

sipriyadarshi
Solutions Expert
Solutions Expert
  • The precondition step is a step that the account you use and the credentials you pass during account linking are compared with what you signed up from the developer console. Make sure you have only one Google account signed in on the browser which is the same as the google account you have used to create the project from the console.
  • https://nestservices.google.com/partnerconnections/project-id/auth?redirect_uri=https://www.google.c...
  • Make sure the value you use for the three highlighted parameters are correct.

View Recommended Answer in original post

10 REPLIES 10

sipriyadarshi
Solutions Expert
Solutions Expert
  • The precondition step is a step that the account you use and the credentials you pass during account linking are compared with what you signed up from the developer console. Make sure you have only one Google account signed in on the browser which is the same as the google account you have used to create the project from the console.
  • https://nestservices.google.com/partnerconnections/project-id/auth?redirect_uri=https://www.google.c...
  • Make sure the value you use for the three highlighted parameters are correct.

sorry, for my ignorance but that link goes no where.  I am having the same issue with one of my thermostats.  The other thermostat works great.  And the one thermostat errors are not consistent, only during one attempt to lower the temp in the evening.  The early morning attempt to raise the temp again works fine.  I am pulling my hair out trying to figure out why.

[homeassistant.components.automation.lower_heat_at_10_pm_main] Lower Heat at 10 pm Main: Error executing script. Error for call_service at pos 3: Error setting climate.thermostat_2 temperature to {'temperature': 16.666666666666668, 'entity_id': ['climate.thermostat_2']}: Error from API: 400: FAILED_PRECONDITION: sdm.devices.commands.ThermostatTemperatureSetpoint.SetHeat command not allowed in current thermostat mode.: Bad Request

Any assistance would be greatly appreciated  

Cary1111
Community Member

May I ask are you in Europe, United States or elsewhere? I can research some steps but need to know this information first.

Cary Cervantes

pdobrien3
Community Member

Thank you. I am in the United States  

Cary1111
Community Member

Are you using the Nest App or Google Home App or both? Also, are you using Android or iOS?

Cary Cervantes

Cary1111
Community Member

Also, which model of Thermostat do you have so I can research the proper steps.

Cary Cervantes

Cary1111
Community Member

I apologize I thought this was a thermostat issue. I see your attempting to create a new Project, generating an Oauth2 cred linking device the above steps provided by "sipriyadarshi" seem correct. However the link is not good on my end as well. 

Cary Cervantes

pdobrien3
Community Member

its an api call that works for everything but that one thermostat for the one home assistant automation.  it is a nest gen 1 i believe.  Everything was working and then apparently there were some changes to the api that have been fixed.  leaving me with just this one thermostat that errors every night at 10 pm  

Cary1111
Community Member

Are they both 1st Gen ? The 1st Gen is api compatible. If they are both the same maybe trying to switch them. While creating the new project and see if it gives the same error/issue? Isolate that the device itself is not the issue. Or maybe trying a script editor for that one thermostat? Here is a link I found on doing that. Create advanced home automations with the script editor - Google Nest Help

Cary Cervantes

pdobrien3
Community Member

the second one runs identical automations and has no issues.  Also, I am not creating a new project, I have had a working project for a while till this issue with the api.  I will look at the script tonight