Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues issuing new token for homebridge nest - HELP #191

Open
youtellatale52 opened this issue Jul 3, 2018 · 9 comments
Open

Issues issuing new token for homebridge nest - HELP #191

youtellatale52 opened this issue Jul 3, 2018 · 9 comments

Comments

@youtellatale52
Copy link

HELP!!! I have been at this for HOURS with no success...
Here is my config.json file however when I run homebridge it gives me this!

If I put a random "token" in from the internet it works except all of my nest products do not respond and they are "offline"

Even if i take out "token, clientID, ClientSecret, Code" it still gives me the same error.. PLEASE HELP ME

{
"bridge": {
"username": "CC:22:33:XX:XX:XX",
"name": "Homebridge2",
"port": "51826",
"pin": "521-XX-XXX"
},
"platforms": [{
"platform": "Nest",
"token": "",
"ClientID": "a5942013-3580-473e-b1d7-XXXXXXXXXXXX",
"ClientSecret": "1FAgafFh3XKXXXXXXXXXXXXXX",
"Code": "XXXXXXXX",
"username": "Username",
"password": "Password"
}]
}

Error from HomeBridge Run:

C:\Users\User>homebridge
[2018-7-3 01:17:51] Loaded config.json with 0 accessories and 1 platforms.
[2018-7-3 01:17:51] ---
[2018-7-3 01:17:51] Loaded plugin: homebridge-nest
[2018-7-3 01:17:51] Registering platform 'homebridge-nest.Nest'
[2018-7-3 01:17:51] ---
[2018-7-3 01:17:51] Loading 1 platforms...
[2018-7-3 01:17:51] [Nest] Initializing Nest platform...
[2018-7-3 01:17:51] [Nest] Fetching Nest devices.
[2018-7-3 01:17:51] [Nest] Error: You did not specify {'token'} or {'clientId','clientSecret','code'}, one set of which is required for the new API
at C:\Users\User\AppData\Roaming\npm\node_modules\homebridge-nest\index.js:188:14
at Promise._execute (C:\Users\User\AppData\Roaming\npm\node_modules\homebridge-nest\node_modules\bluebird\js\release\debuggability.js:303:9)
at Promise._resolveFromExecutor (C:\Users\User\AppData\Roaming\npm\node_modules\homebridge-nest\node_modules\bluebird\js\release\promise.js:483:18)
at new Promise (C:\Users\User\AppData\Roaming\npm\node_modules\homebridge-nest\node_modules\bluebird\js\release\promise.js:79:10)
at setupConnection (C:\Users\User\AppData\Roaming\npm\node_modules\homebridge-nest\index.js:172:10)
at NestPlatform.accessories (C:\Users\User\AppData\Roaming\npm\node_modules\homebridge-nest\index.js:256:5)
at Server._loadPlatformAccessories (C:\Users\User\AppData\Roaming\npm\node_modules\homebridge\lib\server.js:385:20)
at Server._loadPlatforms (C:\Users\User\AppData\Roaming\npm\node_modules\homebridge\lib\server.js:329:16)
at Server.run (C:\Users\User\AppData\Roaming\npm\node_modules\homebridge\lib\server.js:85:36)
at module.exports (C:\Users\User\AppData\Roaming\npm\node_modules\homebridge\lib\cli.js:43:10)
at Object. (C:\Users\User\AppData\Roaming\npm\node_modules\homebridge\bin\homebridge:17:22)
at Module._compile (module.js:643:30)
at Object.Module._extensions..js (module.js:654:10)
at Module.load (module.js:556:32)
at tryModuleLoad (module.js:499:12)
at Function.Module._load (module.js:491:3)
at Function.Module.runMain (module.js:684:10)
at startup (bootstrap_node.js:187:16)
at bootstrap_node.js:608:3

@toshibochan
Copy link

You can’t use random token!
First erase token line in your config. use clientid, clientsecrete, code, from you nest developer account and username and password and save config file.
On terminal type homebridge and press enter. This will give token. Copy and paste in your config and restart homebridge.

@toshibochan
Copy link

After you add token you don’t need clientid, clientsecrete, code, username and password.

@youtellatale52
Copy link
Author

I failed to mention I am running this on Windows 10 (I don’t wan to spin up a VM or pull out the Mac mini for this. AND when I try without the token part it says the same bit. I am using the login from nest.com the same one to login and see my cameras/thermostat. My overall goal
Would be to control my nest cameras AND thermostat. I just don’t know where else to go or try. I’ve ready so many different forms and everyone has a solution and nothing works, I’ve even reinstalled everything just to be sure.

@toshibochan
Copy link

Did you make the app in nest developed account?

@toshibochan
Copy link

Go to https://developer.nest.com
Choose Sign In
Use your normal account to sign in
Fill in you info in 'Step 1'
In 'Step 2' set:
Company Name: HomeBridge-Nest
Company URL: https://github.com/kraigm/homebridge-nest
Country: [Your Country]
Size of Company: Individual
Then just agree to the terms and submit
Go to Products and create a new product
Fill in:
Product Name: HomeBridge + your name (must be unique)
Description: Open source project to provide HomeKit integration
Categories: Home Automation
Users: Individual
Support URL: https://github.com/kraigm/homebridge-nest
Redirect URL: [LEAVE BLANK]
Permissions (minimum):
Enable Thermostat with read/write v4
Enable Away with read/write v2
Enable Smoke+CO alarm with read v4 (if you ever might want Nest Protect)
Enable Camera with read v2 (if you ever might want Nest Cam, motion detection only)
Permission description: fill in anything
Now you should have a product. Now locate the id/secret section on the right of your product's page
Copy the Product ID to your HomeBridge config as the clientId in the Nest config
Copy the Product Secret to your HomeBridge config as the clientSecret in the Nest config
Navigate to the Authorization URL
Accept the terms and copy the Pin Code to your HomeBridge config as the code in the Nest config
Run HomeBridge once (do not include the token in the config at this time) and you should find a log that says something like "CODE IS ONLY VALID ONCE! Update config to use {'token':'c.5ABsTpo88k5yfNIxZlh...'} instead." Copy the c.5ABsTpo88k5yfNIxZlh... portion to your HomeBridge config as the token in the Nest config
You should be able to restart HomeBridge and it should succeed with the new token.
After that you will be FINALLY done (Huzzah!). If the token is working correctly, you no longer NEED the other three configs (clientId, clientSecret, and code) nor the original username and password from the legacy system (but you can keep them around if you wish, they will be ignored).

@youtellatale52
Copy link
Author

Yes, I made a nest developer account and followed those directions. I will try this morning to re-create a new project and see what happens.

@youtellatale52
Copy link
Author

Even after I uninstalled homebridge and homebridge-nest AND re-created my developer Oauth Client it still gives me the same error even on first run.

@youtellatale52
Copy link
Author

I figured it out!!! Its all in the details...

"ClientID": "a5942013-3580-473e-b1d7-XXXXXXXXXXXX",
"ClientSecret": "1FAgafFh3XKXXXXXXXXXXXXXX",
"Code": "XXXXXXXX",

ClientID, ClientSecret, and Code need to be.

clientId, clientSecret and code apparently the uppercase kills it.. SOOOOO it now works!

@toshibochan
Copy link

cool! please close the issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants