sibartlett / homebridge-wink3

Homebridge plugin for wink.com
https://sibartlett.github.io/homebridge-wink3
ISC License
53 stars 20 forks source link

Is this plugin working for anyone? #132

Closed LordZork closed 3 years ago

LordZork commented 4 years ago

Being that this plugin is no longer supported, I am wondering if it works. If anyone could let me know if it is working for them, that would be greatly appreciated.

I'm somewhat new to Homebridge, and – so far – this is the only plugin that I need that I have been unable to get working. So, if this plugin is still working anyone, maybe someone could offer some assistance with getting it setup?

I've done the "Register with Wink" step, and I am on the "Authenticate" step... and then might need help with the "configuration" step too, not sure.

If nothing else, it would be good to know if the plugin is working or if I am wasting my time.

Thanks!

sibartlett commented 4 years ago

How is it not working exactly? You getting an error?

I know I said I’m no longer maintaining it, but I will try to help if I can.

LordZork commented 4 years ago

I can't get through the "Authenticate" step. I installed the plugin, copied/pasted over the Client ID and Client Secret, restarted Homebridge, and then I get this in Homebridge...

Homebridge Not running - View Logs

This for the logs...

[Wink] To authenticate, go here using a web browser: http://XXX.XXX.X.XXX:8888 Error: listen EADDRINUSE: address already in use :::8888 at Server.setupListenHandle [as _listen2] (net.js:1313:16) at listenInCluster (net.js:1361:12) at Server.listen (net.js:1449:7) at /usr/local/lib/node_modules/homebridge-wink3/src/WinkClient.js:148:14 at new Promise () at WinkClient.getOauthGrant (/usr/local/lib/node_modules/homebridge-wink3/src/WinkClient.js:103:12) at WinkClient.authenticate (/usr/local/lib/node_modules/homebridge-wink3/src/WinkClient.js:158:29) at WinkPlatform.didFinishLaunching (/usr/local/lib/node_modules/homebridge-wink3/src/WinkPlatform.js:142:45) at HomebridgeAPI.emit (events.js:322:22) at HomebridgeAPI.signalFinished (/usr/local/lib/node_modules/homebridge/src/api.ts:251:10) at Server.start (/usr/local/lib/node_modules/homebridge/src/server.ts:159:14) at cli (/usr/local/lib/node_modules/homebridge/src/cli.ts:80:10) at Object. (/usr/local/lib/node_modules/homebridge/bin/homebridge:17:22) at Module._compile (internal/modules/cjs/loader.js:1133:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1153:10) at Module.load (internal/modules/cjs/loader.js:977:32)

Also, the authenticate url doesn't work.

LordZork commented 4 years ago

@sibartlett Btw, here's my Wink plugin config...

    {
        "name": "Wink",
        "client_id": "XXXX",
        "client_secret": "XXXX",
        "hide_groups": [
            "air_conditioner",
            "camera",
            "door_bell",
            "sensor_pod",
            "thermostat"
        ],
        "direct_access": true,
        "platform": "Wink"
    }
LordZork commented 4 years ago

@sibartlett Also, the plugin screws up Homebridge... I have to uninstall the plugin for Homebridge (and everything in the Home app, from Homebridge) to work again.

I also get "server restart is taking a long time. You may need to bring up the Homebridge service manually." The whole thing just gets wonky.

sibartlett commented 4 years ago

Right, I see that port 8888 is already in use on your system. Hence the authenticate step not working.

I’ll look into a fix for that. Then we can see if things remain wonky after that.

I’ll get back to you, but it might be a few days before I have something.

LordZork commented 4 years ago

@sibartlett thank you!

LordZork commented 4 years ago

@sibartlett Btw, this may be a dumb question, but – via developer.wink.com – can the port number simply be changed to something different, at the end of the url, under REDIRECT URIS? Could that potentially solve the problem, or is the plugin built to use only 8888?

Example:

http://localhost:8889 <– 8889 instead of 8888

or...

http://XXX.XXX.X.XXX:8889 <– 8889 instead of 8888

sibartlett commented 4 years ago

Sorry that I haven’t addressed this yet, I have some time available on the 24th - so will take a look at this issue then.

sibartlett commented 4 years ago

Sorry that I haven’t addressed this yet, I have some time available on the 24th - so will take a look at this issue then.

LordZork commented 4 years ago

No worries, thanks for keeping it a consideration though and letting me know!

RickySett commented 4 years ago

Hey I'm having the same issue. Is there a fix? I know you said you'd have time on the 24th but was curious if OP had any success.

[6/22/2020, 17:58:55] [Wink] To authenticate, go here using a web browser: http://192.168.0.251:8888 [6/22/2020, 17:58:55] Error: listen EADDRINUSE: address already in use :::8888 at Server.setupListenHandle [as _listen2] (net.js:1313:16) at listenInCluster (net.js:1361:12) at Server.listen (net.js:1447:7) at /usr/local/lib/node_modules/homebridge-wink3/src/WinkClient.js:148:14 at new Promise () at WinkClient.getOauthGrant (/usr/local/lib/node_modules/homebridge-wink3/src/WinkClient.js:103:12) at WinkClient.authenticate (/usr/local/lib/node_modules/homebridge-wink3/src/WinkClient.js:158:29) at WinkPlatform.didFinishLaunching (/usr/local/lib/node_modules/homebridge-wink3/src/WinkPlatform.js:142:45) at HomebridgeAPI.emit (events.js:315:20) at HomebridgeAPI.signalFinished (/usr/local/lib/node_modules/homebridge/src/api.ts:251:10)

LordZork commented 4 years ago

Hey @RickySett, no... haven’t had any success. It’s beyond my knowledge to resolve. Waiting on a fix, which is why I’m very grateful the original developer is willing to look into the issue, despite no longer using Wink. Thanks again, @sibartlett 👍🏻

kylewill commented 4 years ago

I just ran into this issue with the default Homebridge raspi image. If you change the port in WinkClient.js to 8889 the issue is resolved.

I've submitted a pull request here: https://github.com/sibartlett/homebridge-wink3/pull/133

@sibartlett if you can review this should resolve the "address in use" issue.

Thanks!

LordZork commented 4 years ago

@kylewill how do you change the port in WinkClient.js to 8889?

As of this comment, I am running the latest Homebridge on the latest Raspberry Pi 4. Everything is up to date.

I just need to know how to locate and access that file, to make that change, I guess? Any help would be greatly appreciated, thanks!

kylewill commented 4 years ago

If you want to edit the file you need to access:

/usr/local/lib/node_modules/homebridge-wink3/src/WinkClient.js

And change all references of 8888 to 8889.

That’s kind of hacky so hopefully @sibartlett can make the change and you would just update the plug-in from the homebridge ui.

LordZork commented 4 years ago

@kylewill thanks for the quick reply... do I just copy that location (below) and paste it in terminal?

/usr/local/lib/node_modules/homebridge-wink3/src/WinkClient.js

Sorry, I’m a bit of a noob and still learning my way around Homebridge.

Thanks!

kylewill commented 4 years ago

@LordZork you should be able to type:

sudo nano /usr/local/lib/node_modules/homebridge-wink3/src/WinkClient.js

And be able to edit the file. If the wink plugin is ever updated this will be overwritten so just a heads up it’s a semi temporary workaround.

Best of luck!

RickySett commented 4 years ago

@LordZork you should be able to type:

sudo nano /usr/local/lib/node_modules/homebridge-wink3/src/WinkClient.js

And be able to edit the file. If the wink plugin is ever updated this will be overwritten so just a heads up it’s a semi temporary workaround.

Best of luck!

Thank you so much Kyle. This fixed it. Maybe the next version will incorporate your fix and it won't be so temporary.

LordZork commented 4 years ago

@kylewill and @RickySett... ok, I've accessed and edited the file (found 3 spots where I changed 8888 to 8889)... but how do I save the changes/file? I tried ^X to Exit, and chose Y to Save modified buffer, but then it lists new options and I'm not sure what to do. Should I have chosen something else, like ^O to Write out?

/Edit: never mind... after typing ^X to Exit, and choosing Y to Save modified buffer, you simply to hit enter on the keyboard. :)

LordZork commented 4 years ago

Ok, by changing the port in WinkClient.js from 8888 to 8889, the issue is resolved and the plugin works.

However, I have two follow-up questions...

1.) How do I change a light to a fan?

I tried using this setting:

Fan Devices Allows you to expose devices (binary_switch/light_bulb) as fans, instead of light bulbs. Enter device id...

For the device id, I tried using the Serial Number as well as the aid number, with no luck.

2.) Does this plugin support the Pivot Power Genius power/outlet strip?

kylewill commented 4 years ago

@LordZork great, glad it's working now!

This is a bit off-topic but try this issue: https://github.com/sibartlett/homebridge-wink3/issues/44

looks like you need to find the ID in the home app. Then you may need to rerun the authentication to have it show up.

I don't actually have Wink (just helping someone get homebridge going) so I'm not sure. Worth commenting on the other issue above instead of this one though.

LordZork commented 4 years ago

@kylewill Thanks for this! The device id is the device Serial Number (found in Home app). All you have to do from there is re-authenticate (via the link in the logs).

LordZork commented 4 years ago

The plugin seems to be working fine (except my Pivot Power Genius isn't detected, but maybe it isn't supported?). However, changing the port – in all three locations, in WinkClient.js – from 8888 to 8889, results in the following logs...

[Wink] Checking if hub is reachable (Wink Relay, XXX.XXX.X.XXX)...
[Wink] Hub is not reachable locally (Wink Relay, XXX.XXX.X.XXX). Error: connect ECONNREFUSED XXX.XXX.X.XXX:8889
[Wink] Will continue without local control for hub (Wink Relay, XXX.XXX.X.XXX)

Not sure if the logs (above) are bad, but I'm guessing my Wink Relay is set to use 8888, and the issue is a result of changing the following hub-related port (in WinkClient.js)...

    return request({
      baseUrl: hub
        ? `https://${hub.device.last_reading.ip_address}:8888`
        : "https://api.wink.com",
      strictSSL: !hub,
      json: true,
      ...options,
      headers: {
        ...headers,
        ...options.headers
      }
    }).catch(err => {
      if (err.statusCode === 401 && this.config.refresh_token) {
        return this.refreshToken().then(() => this.request(options, hub));
      }

Any thoughts? Is this a problem? Is it possible to change the port on the Wink Relay itself?

sibartlett commented 4 years ago

Sorry for being so slow to respond to this issue.

I merged the fix from @kylewill - and published a new version (3.0.1)

The new version also fixes the local hub issue you're having @LordZork

LordZork commented 4 years ago

@sibartlett

No worries, thanks for doing this (for the update)!

Is there anything I should know about updating the plugin? Should I change the REDIRECT URIS from http://XXX.XXX.X.XXX:8889 back to http://XXX.XXX.X.XXX:8888, on developer.wink.com?

sibartlett commented 4 years ago

No need to revert anything back to developer.wink.com

We’ve updated the plugin to use 8889 by default now. This is also only really needed for the authentication flow, which you’ve already done.

LordZork commented 4 years ago

@sibartlett Thanks!!

Btw, does your plugin support the Pivot Power Genius... in general, or perhaps specifically through the Wink Relay hub (if that makes any sense?)?

If not, are you familiar with the homebridge-pivot-power-genius plugin, and how to found the uuid? I'm at a loss here, trying to figure out how to discover the uuid, and it seems like that project might be dead, but the plugin itself might still work.

Sorry if this is too much of an ask (or the wrong place to ask)... just a bit of a noob currently, and trying to get my Pivot Power Genius connected... it's the last device I have to get into Homebridge and HomeKit.

Thanks again!

sibartlett commented 4 years ago

I’m pretty sure I’ve answered that question before, but can’t find it.

The pivot power genius is not currently supported by this plugin.

And the other GitHub project you linked does not work with the wink API anymore.

LordZork commented 4 years ago

@sibartlett I appreciate you letting me know, thanks! And thanks again for updating your plugin and fixing the port issue!!