KraigM / homebridge-nest

Nest plugin for HomeBridge
210 stars 72 forks source link

Service unavailable error #179

Open Duggy252 opened 6 years ago

Duggy252 commented 6 years ago

HI I keep getting an error on setup, a wall of red text, "error service unavailable. any help would be great.

It seems I'm not getting a reply from the nest API?.

[2018-3-30 16:15:58] [Nest] { Error: UNAUTHORIZED: {"error":"unauthorized","type":"https://developer.nest.com/documentation/cloud/error-messages#auth-error","message":"unauthorized","instance":"7b458647-86fd-4cc7-b82c-45eb8cc84822"} at Yg (/usr/lib/node_modules/homebridge-nest/node_modules/firebase/lib/firebase-node.js:150:468) at Object.Cc (/usr/lib/node_modules/homebridge-nest/node_modules/firebase/lib/firebase-node.js:149:255) at /usr/lib/node_modules/homebridge-nest/node_modules/firebase/lib/firebase-node.js:182:177 at Rh.h.Jd (/usr/lib/node_modules/homebridge-nest/node_modules/firebase/lib/firebase-node.js:186:104) at Fh.Jd (/usr/lib/node_modules/homebridge-nest/node_modules/firebase/lib/firebase-node.js:176:364) at wh.Jg (/usr/lib/node_modules/homebridge-nest/node_modules/firebase/lib/firebase-node.js:174:280) at zh (/usr/lib/node_modules/homebridge-nest/node_modules/firebase/lib/firebase-node.js:168:464) at Client.Ka.onmessage (/usr/lib/node_modules/homebridge-nest/node_modules/firebase/lib/firebase-node.js:167:321) at Client.dispatchEvent (/usr/lib/node_modules/homebridge-nest/node_modules/firebase/node_modules/faye-websocket/lib/faye/websocket/api/event_target.js:22:30) at Client._receiveMessage (/usr/lib/node_modules/homebridge-nest/node_modules/firebase/node_modules/faye-websocket/lib/faye/websocket/api.js:134:10) at Client. (/usr/lib/node_modules/homebridge-nest/node_modules/firebase/node_modules/faye-websocket/lib/faye/websocket/api.js:34:49) at emitOne (events.js:121:20) at Client.emit (events.js:211:7) at Client. (/usr/lib/node_modules/homebridge-nest/node_modules/firebase/node_modules/faye-websocket/node_modules/websocket-driver/lib/websocket/driver/hybi.js:451:14) at pipe (/usr/lib/node_modules/homebridge-nest/node_modules/firebase/node_modules/faye-websocket/node_modules/websocket-driver/node_modules/websocket-extensions/lib/pipeline/index.js:37:40) at Pipeline._loop (/usr/lib/node_modules/homebridge-nest/node_modules/firebase/node_modules/faye-websocket/node_modules/websocket-driver/node_modules/websocket-extensions/lib/pipeline/index.js:44:3) at Pipeline.processIncomingMessage (/usr/lib/node_modules/homebridge-nest/node_modules/firebase/node_modules/faye-websocket/node_modules/websocket-driver/node_modules/websocket-extensions/lib/pipeline/index.js:13:8) at Extensions.processIncomingMessage (/usr/lib/node_modules/homebridge-nest/node_modules/firebase/node_modules/faye-websocket/node_modules/websocket-driver/node_modules/websocket-extensions/lib/websocket_extensions.js:133:20) at Client._emitMessage (/usr/lib/node_modules/homebridge-nest/node_modules/firebase/node_modules/faye-websocket/node_modules/websocket-driver/lib/websocket/driver/hybi.js:442:22) at Client._emitFrame (/usr/lib/node_modules/homebridge-nest/node_modules/firebase/node_modules/faye-websocket/node_modules/websocket-driver/lib/websocket/driver/hybi.js:405:19) at Client.parse (/usr/lib/node_modules/homebridge-nest/node_modules/firebase/node_modules/faye-websocket/node_modules/websocket-driver/lib/websocket/driver/hybi.js:144:18) at Client.parse (/usr/lib/node_modules/homebridge-nest/node_modules/firebase/node_modules/faye-websocket/node_modules/websocket-driver/lib/websocket/driver/client.js:56:58) cause: { Error: UNAUTHORIZED: {"error":"unauthorized","type":"https://developer.nest.com/documentation/cloud/error-messages#auth-error","message":"unauthorized","instance":"7b458647-86fd-4cc7-b82c-45eb8cc84822"} at Yg (/usr/lib/node_modules/homebridge-nest/node_modules/firebase/lib/firebase-node.js:150:468) at Object.Cc (/usr/lib/node_modules/homebridge-nest/node_modules/firebase/lib/firebase-node.js:149:255) at /usr/lib/node_modules/homebridge-nest/node_modules/firebase/lib/firebase-node.js:182:177 at Rh.h.Jd (/usr/lib/node_modules/homebridge-nest/node_modules/firebase/lib/firebase-node.js:186:104) at Fh.Jd (/usr/lib/node_modules/homebridge-nest/node_modules/firebase/lib/firebase-node.js:176:364) at wh.Jg (/usr/lib/node_modules/homebridge-nest/node_modules/firebase/lib/firebase-node.js:174:280) at zh (/usr/lib/node_modules/homebridge-nest/node_modules/firebase/lib/firebase-node.js:168:464) at Client.Ka.onmessage (/usr/lib/node_modules/homebridge-nest/node_modules/firebase/lib/firebase-node.js:167:321) at Client.dispatchEvent (/usr/lib/node_modules/homebridge-nest/node_modules/firebase/node_modules/faye-websocket/lib/faye/websocket/api/event_target.js:22:30) at Client._receiveMessage (/usr/lib/node_modules/homebridge-nest/node_modules/firebase/node_modules/faye-websocket/lib/faye/websocket/api.js:134:10) at Client. (/usr/lib/node_modules/homebridge-nest/node_modules/firebase/node_modules/faye-websocket/lib/faye/websocket/api.js:34:49) at emitOne (events.js:121:20) at Client.emit (events.js:211:7) at Client. (/usr/lib/node_modules/homebridge-nest/node_modules/firebase/node_modules/faye-websocket/node_modules/websocket-driver/lib/websocket/driver/hybi.js:451:14) at pipe (/usr/lib/node_modules/homebridge-nest/node_modules/firebase/node_modules/faye-websocket/node_modules/websocket-driver/node_modules/websocket-extensions/lib/pipeline/index.js:37:40) at Pipeline._loop (/usr/lib/node_modules/homebridge-nest/node_modules/firebase/node_modules/faye-websocket/node_modules/websocket-driver/node_modules/websocket-extensions/lib/pipeline/index.js:44:3) at Pipeline.processIncomingMessage (/usr/lib/node_modules/homebridge-nest/node_modules/firebase/node_modules/faye-websocket/node_modules/websocket-driver/node_modules/websocket-extensions/lib/pipeline/index.js:13:8) at Extensions.processIncomingMessage (/usr/lib/node_modules/homebridge-nest/node_modules/firebase/node_modules/faye-websocket/node_modules/websocket-driver/node_modules/websocket-extensions/lib/websocket_extensions.js:133:20) at Client._emitMessage (/usr/lib/node_modules/homebridge-nest/node_modules/firebase/node_modules/faye-websocket/node_modules/websocket-driver/lib/websocket/driver/hybi.js:442:22) at Client._emitFrame (/usr/lib/node_modules/homebridge-nest/node_modules/firebase/node_modules/faye-websocket/node_modules/websocket-driver/lib/websocket/driver/hybi.js:405:19) at Client.parse (/usr/lib/node_modules/homebridge-nest/node_modules/firebase/node_modules/faye-websocket/node_modules/websocket-driver/lib/websocket/driver/hybi.js:144:18) at Client.parse (/usr/lib/node_modules/homebridge-nest/node_modules/firebase/node_modules/faye-websocket/node_modules/websocket-driver/lib/websocket/driver/client.js:56:58) code: 'UNAUTHORIZED' }, isOperational: true, code: 'UNAUTHORIZED' }

Config file:

{ "bridge": { "name": "Homebridge", "username": "CC:22:3D:E3:CE:30", "port": 51826, "pin": "077-45-154"

},

"platforms": [{
    "platform": "Nest",

"token" : "token will be generated upon first run of homebridge without a token",

    "clientId": "nest generated",
    "clientSecret": "nest generared",
    "code": "nest generated"
}]

}

chrisjshull commented 6 years ago

Try removing "token" from your config for the first run. On first run you'll get a token in the log that you should then enter into your config.

chrisjshull commented 6 years ago

Also, I have taken up maintenance of the homebridge-nest plugin in npm. The source code now lives at https://github.com/chrisjshull/homebridge-nest/.

Please file this issue against that repo if the above does not help. Thanks!

Duggy252 commented 6 years ago

Thanks Chris

I think this has worked..

I just installed home bridge onto a raspberry pi with a pi camera, which I got working.. I thought I could add the nest onto the same device?. when I now add it, it says device already exists (as a home bridge camera). Is another home bridge device added as another standalone home bridge hub?. So I'll need to set it up on another pi?.

chrisjshull commented 6 years ago

You mean the part where you scan or enter the code from home bridge into the Home app? You only have to do that once, and then you should be able to add things to homebridge and they just show up in Home.

~Chris

On Mar 30, 2018, at 12:11 PM, Duggy252 notifications@github.com wrote:

Thanks Chris

I think this has worked..

I just installed home bridge onto a raspberry pi with a pi camera, which I got working.. I thought I could add the nest onto the same device?. when I now add it, it says device already exists (as a home bridge camera). Is another home bridge device added as another standalone home bridge hub?. So I'll need to set it up on another pi?.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

Duggy252 commented 6 years ago

Hmm something not working then I have the homebridge icon all added in HomeKit and with it I have my raspberry pi camera. But now I’ve added the nest json file and it seems to be running ok I can’t see my nest thermostat in HomeKit. Scanning the code only says the home bridge device is already added.. am I missing something?.