Open cheychey opened 7 years ago
1) Wink can't help you on this. The API keys they sent you are for V2 API and this version of the plugin uses V1 API. 2) You can use hombridge-wink2 or homebridge-wink3 (different developers, different focus) to use those V2 credentials if you dont want to be stuck on V1 Android credentials.
Is there a good comparison anywhere, or would someone be so kind as to maybe put it here, of homebridge-wink2 VS homebridge-wink3?
Are there philosophical differences? Purely technical differences? Plans to join them?
Thanks a ton in advance!
I forgot to mention I tried with homebridge-wink2 and am getting this error.
/usr/local/lib/node_modules/homebridge-wink2/index.js:94 platform.log("There was a problem authenticating with Wink: " + data.error_message); ^
ReferenceError: data is not defined
at /usr/local/lib/node_modules/homebridge-wink2/index.js:94:85
at winkapiv2.
To clear this up, the keys from their dev portal is technically something like API V2.5 they changed the grant types so currently neither wink2 or Wink3 work with the new API V2.5 However both Wink2 and Wink3 support the API V2 keys. Currently the developer of Wink3 is working on support for this new API "V2.5" Hope that clears this up.
@cheychey Have you tried using https://github.com/sibartlett/homebridge-wink3 ? 4 days ago it was updates to include a fix, that was thought to work with the new "API V2.5" keys from their new dev portal. Could you update to the latest version of it and let us know what happens. Thanks
Sure I will try it out as soon as I get home. Just a question about the plugins since i have homebridge-wink and homebridge-wink2 installed do I need to remove any of them before I install homebridge-wink3. By changing the plateform from"wink" to "wink2" in the confug.json, thats how I would be able to switch which plugin I would want to use. Is the wink3 plugin the same put platform "wink3" in order to use it?
Hi, author of the wink3 plugin here.
@cheychey the wink3 plugin uses "Wink" as the platform name.
@sinabahram in regards to the differences between wink2 and wink3:
I wrote Wink3 with some different philosophical differences; the big one being that how a Wink device should be mapped to a HomeKit accessory is described declaratively, instead of imperatively. For example: locks are implemented in this file - all it does is return a JavaScript object that describes how a lock should behave.
I could go into other technical details, but I don't think this ticket is the forum for that. You can read the README, and if you want to know more feel free to open a ticket there.
hey sibartlett just tried using your plugin with the keys i got from wink developer. I got this error. Could not authenticate with wink.com { StatusCodeError: 400 - {"data":{"error":"invalid_grant","error_description":"This client is not permitted to use the password grant type"},"errors":["invalid_grant: This client is not permitted to use the password grant type"],"pagination":{},"error":"invalid_grant","error_description":"This client is not permitted to use the password grant type"} Bunch of other bits which i did paste cause it had my password.
@cheychey you need to remove the username and password from the config file.
Thanks sibartlett. I did what you said. the plugin asks me "To authenticate, go here using a web browser: http://192.168.2.14:8888" when I do I get "redirect url not authorized". I checked I put the redirect url as http://192.168.2.14:8888.
@cheychey sorry, not sure what else to suggest right now - other than double check how the app is configured on developer.wink.com
I can recheck the code to see if I missed something, but earliest I can do something is Monday.
Not to rehash an old thread, but I too am having this exact issue. I just re-installed home bridge and wink3 to my machine because I had to flash it. My config file was working perfectly on my old machine, but now, I seem to be getting communication errors with my Hub 2 and 2 Relays. below is the message I get for all 3
[2017-11-15 08:41:42] [Wink] Checking if hub is reachable (Wink Relay (Bedroom), 192.168.1.130)... [2017-11-15 08:41:42] [Wink] Hub is reachable locally (Wink Relay (Bedroom), 192.168.1.130) [2017-11-15 08:41:44] [Wink] Could not authenticate with local hub (Wink Relay (Bedroom), 192.168.1.130) { StatusCodeError: 400 - {"data":{"error":"invalid_grant","error_description":""},"errors":["invalid_grant: "],"pagination":{},"error":"invalid_grant","error_description":""} etc.
I'm using the generic Android credentials as I can't figure out how to get my own personal ones setup correctly. Not sure what to use for the IP.
Thanks.
I think something over the past few days changed with the app client_id
Mine stopped working so I re-installed as well. Also created a wink applicaiton to get a client ID and secret. This is the error i'm getting. Any help appreciated:
/usr/lib/node_modules/homebridge/lib/api.js:138
throw new Error("Attempting to register a platform '" + fullName + "' which has already been registered!");
^
Error: Attempting to register a platform 'homebridge-wink.Wink' which has already been registered!
at API.registerPlatform (/usr/lib/node_modules/homebridge/lib/api.js:138:11)
at Plugin.exports.default.homebridge [as initializer] (/usr/lib/node_modules/homebridge-wink3/src/index.js:7:14)
at Server.
The built-in Android client ID and secret has now been deprecated by the Wink API.
So I intend to drop support for the Android client ID in an upcoming update to homebridge-wink3.
So does that mean we will lose garage door open and close support?
@rbflurry correct, we unfortunately lose the ability to control Chamberlain garage doors. TBH I’m surprised it took Wink this long to disable the Android client ID.
Still having issues, hope someone can help. Here is my error: [2017-11-28 09:42:44] Loaded plugin: homebridge-wink3 [2017-11-28 09:42:44] Registering platform 'homebridge-wink.Wink' [2017-11-28 09:42:44] --- [2017-11-28 09:42:44] There was a problem reading your config.json file. [2017-11-28 09:42:44] Please try pasting your config.json file here to validate it: http://jsonlint.com [2017-11-28 09:42:44]
/usr/lib/node_modules/homebridge/lib/server.js:201
config = JSON.parse(fs.readFileSync(configPath));
^
SyntaxError: Unexpected token # in JSON at position 385
at JSON.parse (
my confg.json is { "bridge": { "name": "Homebridge", "username": "CC:22:3D:E3:CE:30", "pin": "031-45-154" },
"platforms": [{
"platform": "Wink",
"name": "Wink",
"client_id": "H1g--Ct8MlPEtZtrCmxPlIDdGnS1PTdf",
"client_secret": "seFIpe7A_ECFHA6SSGMa4V9ZQ91X3VWH",
}]
}
I added XXXX to conceal the PW
@spartanrob you should change your Wink password - everyone on this thread got an email notification with your actual password.
Thanks. I screwed up
Thanks,
Rob
From: Simon Bartlett notifications@github.com Reply-To: KraigM/homebridge-wink reply@reply.github.com Date: Tuesday, November 28, 2017 at 9:56 AM To: KraigM/homebridge-wink homebridge-wink@noreply.github.com Cc: Rob Pesick spartanrob@gmail.com, Mention mention@noreply.github.com Subject: Re: [KraigM/homebridge-wink] Issue with personal api keys versus the generic (#85)
@spartanrob you should change your Wink password - everyone on this thread got an email notification with your actual password.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.
Still having issues with Wink3. I have a valid .json file. Homebridge launches, but I get the following error. FWIW, i just updated and verified my credentials with wink. Any help is appreciated:
Could not authenticate with wink.com { StatusCodeError: 400 - {"data":{"error":"invalid_grant","error_description":"This client is not permitted to use the password grant type"},"errors":["invalid_grant: This client is not permitted to use the password grant type"],"pagination":{},"error":"invalid_grant","error_description":"This client is not permitted to use the password grant type"}
at new StatusCodeError (/usr/lib/node_modules/homebridge-wink3/node_modules/request-promise-core/lib/errors.js:32:15)
at Request.plumbing.callback (/usr/lib/node_modules/homebridge-wink3/node_modules/request-promise-core/lib/plumbing.js:104:33)
at Request.RP$callback [as _callback] (/usr/lib/node_modules/homebridge-wink3/node_modules/request-promise-core/lib/plumbing.js:46:31)
at Request.self.callback (/usr/lib/node_modules/homebridge-wink3/node_modules/request/request.js:186:22)
at emitTwo (events.js:126:13)
at Request.emit (events.js:214:7)
at Request.
[Symbol(bytesRead)]: 851 },
connection:
TLSSocket {
_tlsOptions: [Object],
_secureEstablished: true,
_securePending: false,
_newSessionPending: false,
_controlReleased: true,
_SNICallback: null,
servername: null,
npnProtocol: false,
alpnProtocol: false,
authorized: true,
authorizationError: null,
encrypted: true,
_events: [Object],
_eventsCount: 9,
connecting: false,
_hadError: false,
_handle: null,
_parent: null,
_host: 'api.wink.com',
_readableState: [Object],
readable: false,
domain: null,
_maxListeners: undefined,
_writableState: [Object],
writable: false,
allowHalfOpen: false,
_bytesDispatched: 328,
_sockname: null,
_pendingData: null,
_pendingEncoding: '',
server: undefined,
_server: null,
ssl: null,
_requestCert: true,
_rejectUnauthorized: true,
parser: null,
_httpMessage: [Object],
read: [Function],
_consuming: true,
_idleNext: null,
_idlePrev: null,
_idleTimeout: -1,
[Symbol(asyncId)]: 44,
[Symbol(bytesRead)]: 851 },
httpVersionMajor: 1,
httpVersionMinor: 1,
httpVersion: '1.1',
complete: true,
headers:
{ 'cache-control': 'no-cache, no-store, max-age=0, must-revalidate',
'content-type': 'application/json; charset=utf-8',
expires: 'Fri, 01 Jan 1990 00:00:00 GMT',
pragma: 'no-cache',
'strict-transport-security': 'max-age=31536000',
via: '1.1 spaces-router (834f204b1cd5)',
'x-content-type-options': 'nosniff',
'x-frame-options': 'SAMEORIGIN',
'x-request-id': '51da84e0-50b5-b182-7bae-0e43b01cc6de',
'x-runtime': '0.023328',
'x-xss-protection': '1; mode=block',
date: 'Fri, 01 Dec 2017 18:04:58 GMT',
'content-length': '326',
connection: 'close' },
rawHeaders:
[ 'Cache-Control',
'no-cache, no-store, max-age=0, must-revalidate',
'Content-Type',
'application/json; charset=utf-8',
'Expires',
'Fri, 01 Jan 1990 00:00:00 GMT',
'Pragma',
'no-cache',
'Strict-Transport-Security',
'max-age=31536000',
'Via',
'1.1 spaces-router (834f204b1cd5)',
'X-Content-Type-Options',
'nosniff',
'X-Frame-Options',
'SAMEORIGIN',
'X-Request-Id',
'51da84e0-50b5-b182-7bae-0e43b01cc6de',
'X-Runtime',
'0.023328',
'X-Xss-Protection',
'1; mode=block',
'Date',
'Fri, 01 Dec 2017 18:04:58 GMT',
'Content-Length',
'326',
'Connection',
'close' ],
trailers: {},
rawTrailers: [],
upgrade: false,
url: '',
method: null,
statusCode: 400,
statusMessage: 'Bad Request',
client:
TLSSocket {
_tlsOptions: [Object],
_secureEstablished: true,
_securePending: false,
_newSessionPending: false,
_controlReleased: true,
_SNICallback: null,
servername: null,
npnProtocol: false,
alpnProtocol: false,
authorized: true,
authorizationError: null,
encrypted: true,
_events: [Object],
_eventsCount: 9,
connecting: false,
_hadError: false,
_handle: null,
_parent: null,
_host: 'api.wink.com',
_readableState: [Object],
readable: false,
domain: null,
_maxListeners: undefined,
_writableState: [Object],
writable: false,
allowHalfOpen: false,
_bytesDispatched: 328,
_sockname: null,
_pendingData: null,
_pendingEncoding: '',
server: undefined,
_server: null,
ssl: null,
_requestCert: true,
_rejectUnauthorized: true,
parser: null,
_httpMessage: [Object],
read: [Function],
_consuming: true,
_idleNext: null,
_idlePrev: null,
_idleTimeout: -1,
[Symbol(asyncId)]: 44,
[Symbol(bytesRead)]: 851 },
_consuming: true,
_dumped: false,
req:
ClientRequest {
domain: null,
_events: [Object],
_eventsCount: 5,
_maxListeners: undefined,
output: [],
outputEncodings: [],
outputCallbacks: [],
outputSize: 0,
writable: true,
_last: true,
upgrading: false,
chunkedEncoding: false,
shouldKeepAlive: false,
useChunkedEncodingByDefault: true,
sendDate: false,
_removedConnection: false,
_removedContLen: false,
_removedTE: false,
_contentLength: null,
_hasBody: true,
_trailer: '',
finished: true,
_headerSent: true,
socket: [Object],
connection: [Object],
_header: 'POST /oauth2/token HTTP/1.1\r\nhost: api.wink.com\r\naccept: application/json\r\ncontent-type: application/json\r\ncontent-length: 179\r\nConnection: close\r\n\r\n',
_onPendingData: [Function: noopPendingOutput],
agent: [Object],
socketPath: undefined,
timeout: undefined,
method: 'POST',
path: '/oauth2/token',
_ended: true,
res: [Circular],
aborted: undefined,
timeoutCb: null,
upgradeOrConnect: false,
parser: null,
maxHeadersCount: null,
[Symbol(outHeadersKey)]: [Object] },
request:
Request {
domain: null,
_events: [Object],
_eventsCount: 5,
_maxListeners: undefined,
method: 'POST',
uri: [Object],
body: '{"grant_type":"password","client_id":"q6GvN-HR6JEg959-2mv2bxXZR5lHq4m2","client_secret":"t5CviJUs8WfXBOG0QWifhvBUOtajZC5I","username":"spartanrob@gmail.com","password":"R@chel99"}',
readable: true,
writable: true,
explicitMethod: true,
_qs: [Object],
_auth: [Object],
_oauth: [Object],
_multipart: [Object],
_redirect: [Object],
_tunnel: [Object],
_rp_resolve: [Function],
_rp_reject: [Function],
_rp_promise: [Object],
_rp_callbackOrig: undefined,
callback: [Function],
_rp_options: [Object],
headers: [Object],
setHeader: [Function],
hasHeader: [Function],
getHeader: [Function],
removeHeader: [Function],
localAddress: undefined,
pool: {},
dests: [],
__isRequestRequest: true,
_callback: [Function: RP$callback],
proxy: null,
tunnel: true,
setHost: true,
originalCookieHeader: undefined,
_disableCookies: true,
_jar: undefined,
port: 443,
host: 'api.wink.com',
path: '/oauth2/token',
_json: true,
httpModule: [Object],
agentClass: [Object],
agent: [Object],
_started: true,
href: 'https://api.wink.com/oauth2/token',
req: [Object],
ntick: true,
response: [Circular],
originalHost: 'api.wink.com',
originalHostHeaderName: 'host',
responseContent: [Circular],
_destdata: true,
_ended: true,
_callbackCalled: true },
toJSON: [Function: responseToJSON],
caseless: Caseless { dict: [Object] },
read: [Function],
body:
{ data: [Object],
errors: [Array],
pagination: {},
error: 'invalid_grant',
error_description: 'This client is not permitted to use the password grant type' } } }
@spartanrob you need to use oauth code grant - remove the username and password from your config, then the plugin should give you a URL to visit when it’s starts up.
Thanks. sorry, i'm still a noob. When i remove username and pw, i get the following error. I have tried uninstalling wink and wink 2 but that did not work. I do have my OAUTH URLS in my wink profile, if that helps:
[2017-12-1 13:34:13] Loaded plugin: homebridge-wink [2017-12-1 13:34:13] Registering platform 'homebridge-wink.Wink' [2017-12-1 13:34:13] --- [2017-12-1 13:34:14] Loaded plugin: homebridge-wink2 [2017-12-1 13:34:14] Registering platform 'homebridge-wink2.Wink2' [2017-12-1 13:34:14] --- [2017-12-1 13:34:17] Loaded plugin: homebridge-wink3
/usr/lib/node_modules/homebridge/lib/api.js:138
throw new Error("Attempting to register a platform '" + fullName + "' which has already been registered!");
^
Error: Attempting to register a platform 'homebridge-wink.Wink' which has already been registered!
at API.registerPlatform (/usr/lib/node_modules/homebridge/lib/api.js:138:11)
at Plugin.exports.default.homebridge [as initializer] (/usr/lib/node_modules/homebridge-wink3/src/index.js:7:14)
at Server.
You’ve got all 3 plugins installed? I think they’re conflicting with each other.
Thanks. Yes, when I remove wink and wink2, then run homebridge, it tells me my .json file is bad.
Reloaded things, but still the same error (with only Wink3 this time: [2017-12-1 14:44:25] Loaded plugin: homebridge-wink [2017-12-1 14:44:25] Registering platform 'homebridge-wink.Wink' [2017-12-1 14:44:25] --- [2017-12-1 14:44:27] Loaded plugin: homebridge-wink3
/usr/lib/node_modules/homebridge/lib/api.js:138
throw new Error("Attempting to register a platform '" + fullName + "' which has already been registered!");
^
Error: Attempting to register a platform 'homebridge-wink.Wink' which has already been registered!
at API.registerPlatform (/usr/lib/node_modules/homebridge/lib/api.js:138:11)
at Plugin.exports.default.homebridge [as initializer] (/usr/lib/node_modules/homebridge-wink3/src/index.js:7:14)
at Server.
i was getting the same error Apr 15 19:02:21 pi homebridge[6261]: [2018-4-15 19:02:21] Loaded plugin: homebridge-wink3 Apr 15 19:02:21 pi homebridge[6261]: /usr/local/lib/node_modules/homebridge/lib/api.js:138 Apr 15 19:02:21 pi homebridge[6261]: throw new Error("Attempting to register a platform '" + fullName + "' which has already been registered!"); Apr 15 19:02:21 pi homebridge[6261]: ^ Apr 15 19:02:21 pi homebridge[6261]: Error: Attempting to register a platform 'homebridge-wink.Wink' which has already been registered!
In my case homebridge-wink was installed with homebridge-wink3 that was the issue after i removed homebridge-wink it worked.
pi@pi:~ $ sudo npm uninstall -g homebridge-wink removed 82 packages in 4.304s pi@pi:~ $ sudo npm uninstall -g homebridge-wink2 up to date in 0.253s
Sorry I'm a noob here so do bare with me. I had sent an email to wink requesting client_id and client_secrets. They informed me that I would need to request them on their wink developers website. Yesterday I was informed that my application was accepted and was sent the personal api keys. I tried using them in the config.json, but when running homebridge I ran into problems. While searching on the internet I stumbled on some generic keys client_id: "quirky_wink_android_app" and client_secret: "e749124ad386a5a35c0ab554a4f2c045" surprisingly these worked. I switched back to the ones provided by wink and was still getting an error. I switched back to the generic ones again and they worked. This leads me to think there is something wrong with the keys created. I sent out an email to wink to let them know, am waiting for a response. Is there any wait time for new created api? Would be ok to use the generic ones? Any safety issues using the generic api keys? If anyone is wondering what error am getting its this one https://github.com/KraigM/homebridge-wink/issues/78