chrisjshull / homebridge-nest

Nest plugin for HomeBridge
707 stars 111 forks source link

Obtain refresh token #549

Closed sels70 closed 2 years ago

sels70 commented 2 years ago

I have Homebridge and the Nest plugin installed on my Synology NAS. The instructions to obtain a refresh token only includes instructions using Terminal on the Mac. I was wondering if there is another way to obtain a refresh token. At the moment I'm using the cookies option but would prefer the refresh token option. Thanks.

mbierman commented 2 years ago

You could do what I do for other tokens that need to be updated in config.json. This script grabs a token and updates config.json. I run the script nightly before it expires.

You could fork mine and make this work. https://gist.github.com/mbierman/dd45821b53d5d22147cef217f0c0fe95

adriancable commented 2 years ago

@sels70 - why do you say the instructions are only for Mac?

Cutting and pasting from the README:

To run the tool, from your Mac **or Linux Terminal** or Windows Command Prompt

That's pretty much all the platforms covered. Not just Mac.

sels70 commented 2 years ago

Sorry, I should have clarified. I'm not sure where to find the directory where the plug-in is installed on my Synology NAS.

adriancable commented 2 years ago

Did you try looking in the two suggested directories in the README?

Otherwise, try:

npm root -g

This returns NPM's global package directory. Then, you should find the homebridge-nest directory immediately under that.

jackpenny101 commented 2 years ago

@sels70 For the Synology NAS, easiest way is to open Terminal In the actual homebridge container (3 dots, top right of the screen). Once there CD into the plugin directory by entering this command:

cd /var/lib/homebridge/node_modules/homebridge-nest

The enter the following command:

node login.js

Then complete the steps on screen.

sels70 commented 2 years ago

@sels70 For the Synology NAS, easiest way is to open Terminal In the actual homebridge container (3 dots, top right of the screen). Once there CD into the plugin directory by entering this command:

cd /var/lib/homebridge/node_modules/homebridge-nest

The enter the following command:

node login.js

Then complete the steps on screen.

Thanks. I appreciate your help.