Code Monkey home page Code Monkey logo

homebridge-wink3's People

Contributors

appletechy avatar farhad-a avatar kylewill avatar mriksman avatar pelaxa avatar schmittx avatar sibartlett avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

homebridge-wink3's Issues

Failed to refresh devices

I have installed homebridge-wink3. When launching home bridge, I get an error about 'refresh devices'; although I'm successfully able to pair home bridge to iOS

Also, other than Jiya's Fan and Garage Entry Door, none of the devices identified below should come up. They are not in my wink app (at one point they used to be)

Finally, I have 11 shades that are connected to wink but they are not showing up. I have also included my config file below

pi@raspberrypi:~ $ homebridge
*** WARNING *** The program 'node' uses the Apple Bonjour compatibility layer of Avahi.
*** WARNING *** Please fix your application to use the native API of Avahi!
*** WARNING *** For more information see http://0pointer.de/avahi-compat?s=libdns_sd&e=node
*** WARNING *** The program 'node' called 'DNSServiceRegister()' which is not supported (or only supported partially) in the Apple Bonjour compatibility layer of Avahi.
*** WARNING *** Please fix your application to use the native API of Avahi!
*** WARNING *** For more information see http://0pointer.de/avahi-compat?s=libdns_sd&e=node&f=DNSServiceRegister
[6/14/2017, 9:21:26 PM] Loaded plugin: homebridge-wink3
[6/14/2017, 9:21:26 PM] Registering platform 'homebridge-wink.Wink'
[6/14/2017, 9:21:26 PM] ---
[6/14/2017, 9:21:26 PM] Loaded config.json with 0 accessories and 1 platforms.
[6/14/2017, 9:21:26 PM] ---
[6/14/2017, 9:21:26 PM] Loading 1 platforms...
[6/14/2017, 9:21:26 PM] [Wink] Initializing Wink platform...
Scan this code with your HomeKit App on your iOS device to pair with Homebridge:

┌────────────┐     
│ 031-45-154 │     
└────────────┘     

[6/14/2017, 9:21:26 PM] Homebridge is running on port 51826.
[6/14/2017, 9:21:26 PM] [Wink] Refreshing devices...
[6/14/2017, 9:21:28 PM] [Wink] Added: Sunroom Right (camera/94076)
[6/14/2017, 9:21:28 PM] [Wink] Added: Sunroom Left (camera/94077)
[6/14/2017, 9:21:28 PM] [Wink] Added: Walkout Basement (camera/95307)
[6/14/2017, 9:21:28 PM] [Wink] Added: Driveway (camera/109695)
[6/14/2017, 9:21:28 PM] [Wink] Added: Family Room Lightstrip (light_bulb/2255272)
[6/14/2017, 9:21:28 PM] [Wink] Added: Dining Lightstrip (light_bulb/2255412)
[6/14/2017, 9:21:28 PM] [Wink] Added: Kitchen (light_bulb/2275830)
[6/14/2017, 9:21:28 PM] [Wink] Added: Jiya's Fan (light_bulb/2364908)
[6/14/2017, 9:21:28 PM] [Wink] Added: Mandir (light_bulb/2695793)
[6/14/2017, 9:21:28 PM] [Wink] Added: Shadow Box (light_bulb/2695794)
[6/14/2017, 9:21:28 PM] [Wink] Added: Garage Entry Door (lock/153554)
[6/14/2017, 9:21:28 PM] [Wink] Failed to refresh devices. TypeError: Cannot read property 'setValue' of undefined
at Service.setCharacteristic (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Service.js:148:31)
at definition.characteristics.forEach.c (/usr/local/lib/node_modules/homebridge-wink3/src/AccessoryHelper.js:67:19)
at Array.forEach (native)
at services.forEach.definition (/usr/local/lib/node_modules/homebridge-wink3/src/AccessoryHelper.js:65:34)
at Array.forEach (native)
at AccessoryHelper.configureAccessoryCharacteristics (/usr/local/lib/node_modules/homebridge-wink3/src/AccessoryHelper.js:62:14)
at AccessoryHelper.configureAccessory (/usr/local/lib/node_modules/homebridge-wink3/src/AccessoryHelper.js:43:10)
at WinkPlatform.addDevice (/usr/local/lib/node_modules/homebridge-wink3/src/WinkPlatform.js:144:26)
at Array.forEach (native)
at /usr/local/lib/node_modules/homebridge-wink3/src/WinkPlatform.js:181:13
[6/14/2017, 9:21:29 PM] [Wink] Authenticated with local Wink hub (192.168.1.207)

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

"platforms": [
{
"platform": "Wink",
"name": "Wink",
"username": "[email protected]",
"password": "XXXXX",
"client_id": "XXXXXX",
"client_secret": "XXXXXXXXX",
"hide_groups": [
"garage_door",
"thermostat",
"sensor_pods"
],
"hide_ids": [],
"fan_ids": [],
"direct_access": true,
"access_token": "XXXXXXXXX",
"refresh_token": "XXXXXXXXX"
}
]
}

Changes outside of Home app (Wink/Manual Switch/Sensor) Don't Seem Update

I'm noticing that updates aren't being pushed out very quickly. If at all.

I have my Home app open on an iPad. And Wink on my iPhone. I make a change on the iPhone in Wink, and it doesn't update on the iPad (Home app) at all. Every so often I see a [Wink] Received update notification: log, but it isn't related to the devices I am turning on/off.

I thought with Pubnub, updates are immediate to the Homebridge/Home app? I even force close the Home app and reopen, and it is still not refreshing the devices...?

6 Devices Ignored

My Homebridge is ignoring 6 devices. What is odd, is 1 is a leviton switch, which i have another one that is working fine. The other is the devices running through my Wink Relay, and then one of two Nest thermostats.

StatusCodeError: 429 "You have been throttled. Please try again later"

When launching Homebridge with Wink 3 I get a throttling error after checking if a hub is reachable locally. It seems to eventually work fine with HomeKit.

[9/24/2017, 12:17:27 PM] [Wink] Could not authenticate with local hub (Bedroom Hub, 192.168.1.240) { StatusCodeError: 429 - {"data":null,"errors":["You have been throttled. Please try again later."],"pagination":{}}
at new StatusCodeError (/usr/local/lib/node_modules/homebridge-wink3/node_modules/request-promise-core/lib/errors.js:32:15)
at Request.plumbing.callback (/usr/local/lib/node_modules/homebridge-wink3/node_modules/request-promise-core/lib/plumbing.js:104:33)
at Request.RP$callback [as _callback] (/usr/local/lib/node_modules/homebridge-wink3/node_modules/request-promise-core/lib/plumbing.js:46:31)
at Request.self.callback (/usr/local/lib/node_modules/homebridge-wink3/node_modules/request/request.js:186:22)
at emitTwo (events.js:106:13)
at Request.emit (events.js:191:7)
at Request. (/usr/local/lib/node_modules/homebridge-wink3/node_modules/request/request.js:1163:10)
at emitOne (events.js:96:13)
at Request.emit (events.js:188:7)
at IncomingMessage. (/usr/local/lib/node_modules/homebridge-wink3/node_modules/request/request.js:1085:12)
at IncomingMessage.g (events.js:292:16)
at emitNone (events.js:91:20)
at IncomingMessage.emit (events.js:185:7)
at endReadableNT (_stream_readable.js:974:12)
at _combinedTickCallback (internal/process/next_tick.js:80:11)
at process._tickCallback (internal/process/next_tick.js:104:9)
name: 'StatusCodeError',
statusCode: 429,
message: '429 - {"data":null,"errors":["You have been throttled. Please try again later."],"pagination":{}}',
error:
{ data: null,
errors: [ 'You have been throttled. Please try again later.' ],
pagination: {} },
options:
{ baseUrl: 'https://api.wink.com',
strictSSL: true,
json: true,
method: 'POST',
uri: '/oauth2/token',
body:
{ local_control_id: 'XXXX',
scope: 'local_control',
grant_type: 'refresh_token',
refresh_token: 'XXXX',
client_id: 'XXXX',
client_secret: 'XXXX' },
headers: { 'User-Agent': 'Manufacturer/Apple-iPhone8_1 iOS/10.3.1 WinkiOS/5.8.0.27-production-release (Scale/2.00)' },
callback: [Function: RP$callback],
transform: undefined,
simple: true,
resolveWithFullResponse: false,
transform2xxOnly: false },
response:
IncomingMessage {
_readableState:
ReadableState {
objectMode: false,
highWaterMark: 16384,
buffer: [Object],
length: 0,
pipes: null,
pipesCount: 0,
flowing: true,
ended: true,
endEmitted: true,
reading: false,
sync: true,
needReadable: false,
emittedReadable: false,
readableListening: false,
resumeScheduled: false,
defaultEncoding: 'utf8',
ranOut: false,
awaitDrain: 0,
readingMore: false,
decoder: null,
encoding: null },
readable: false,
domain: null,
_events:
{ end: [Object],
close: [Object],
data: [Function],
error: [Function] },
_eventsCount: 4,
_maxListeners: undefined,
socket:
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,
destroyed: true,
_bytesDispatched: 512,
_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 },
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,
destroyed: true,
_bytesDispatched: 512,
_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 },
httpVersionMajor: 1,
httpVersionMinor: 1,
httpVersion: '1.1',
complete: true,
headers:
{ 'cache-control': 'no-cache',
'content-type': 'application/json',
'retry-after': '13',
'strict-transport-security': 'max-age=31536000',
via: '1.1 spaces-router (3979283aa3db)',
'x-ratelimit-limit': '5',
'x-ratelimit-remaining': '0',
'x-ratelimit-reset': '2017-09-24T18:17:40Z',
'x-request-id': 'XXXX',
'x-runtime': '0.040081',
date: 'Sun, 24 Sep 2017 18:17:27 GMT',
'content-length': '91',
connection: 'close' },
rawHeaders:
[ 'Cache-Control',
'no-cache',
'Content-Type',
'application/json',
'Retry-After',
'13',
'Strict-Transport-Security',
'max-age=31536000',
'Via',
'1.1 spaces-router (3979283aa3db)',
'X-Ratelimit-Limit',
'5',
'X-Ratelimit-Remaining',
'0',
'X-Ratelimit-Reset',
'2017-09-24T18:17:40Z',
'X-Request-Id',
'XXXX',
'X-Runtime',
'0.040081',
'Date',
'Sun, 24 Sep 2017 18:17:27 GMT',
'Content-Length',
'91',
'Connection',
'close' ],
trailers: {},
rawTrailers: [],
upgrade: false,
url: '',
method: null,
statusCode: 429,
statusMessage: 'Too Many Requests',
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,
destroyed: true,
_bytesDispatched: 512,
_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 },
_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,
_removedHeader: [Object],
_contentLength: null,
_hasBody: true,
_trailer: '',
finished: true,
_headerSent: true,
socket: [Object],
connection: [Object],
_header: 'POST /oauth2/token HTTP/1.1\r\nUser-Agent: Manufacturer/Apple-iPhone8_1 iOS/10.3.1 WinkiOS/5.8.0.27-production-release (Scale/2.00)\r\nhost: api.wink.com\r\naccept: application/json\r\ncontent-type: application/json\r\ncontent-length: 261\r\nConnection: close\r\n\r\n',
_headers: [Object],
_headerNames: [Object],
_onPendingData: null,
agent: [Object],
socketPath: undefined,
timeout: undefined,
method: 'POST',
path: '/oauth2/token',
_ended: true,
parser: null,
res: [Circular] },
request:
Request {
domain: null,
_events: [Object],
_eventsCount: 5,
_maxListeners: undefined,
strictSSL: true,
method: 'POST',
uri: [Object],
body: '{"local_control_id":"XXXX","scope":"local_control","grant_type":"refresh_token","refresh_token":"XXXX","client_id":"XXXX","client_secret":"XXXX"}',
headers: [Object],
readable: true,
writable: true,
explicitMethod: true,
_qs: [Object],
_auth: [Object],
_oauth: [Object],
_multipart: [Object],
_redirect: [Object],
_tunnel: [Object],
_rp_resolve: [Function: s],
_rp_reject: [Function: t],
_rp_promise: [Object],
_rp_callbackOrig: undefined,
callback: [Function],
_rp_options: [Object],
setHeader: [Function],
hasHeader: [Function],
getHeader: [Function],
removeHeader: [Function],
localAddress: undefined,
pool: [Object],
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: null, errors: [Object], pagination: {} } } }

Outlink shows up as Not Supported in Home.app

Under the devices.md, it looks like Quirky Outlinks are supported, and I'm pretty sure I remember it working when I first setup Hombebridge with the original Wink plugin. But I just finished setting it up again with the Wink3 plugin, and my Outlink shows up as Not Supported. Any idea why that may be happening? Thanks!

Hub not reachable locally

I get the following messages at the end of the Homebridge launch. It looks like it was able to talk to the hub, but then timed out. Is there a way I solve that?

[2017-8-7 03:04:03] [Wink] Authenticated with local Wink hub (XXX.XXX.X.X) [2017-8-7 03:04:07] [Wink] Wink hub (XXX.XXX.X.X) is not reachable locally. Error: ESOCKETTIMEDOUT

Shades with no Feedback (Somfy ZRTSI)

I made a heap of modifications to wink2 in order to fix;

  • leakSMART valve
  • leakSMART leak sensors
  • Turning binary switches and/or light bulbs to switches/outlets
  • Changed Service.Door and Service.Window (meant for moving devices) to Service.ContactSensor

But the most important fix was for my blinds. In wink2, adding custom code and local variables was easy for me to understand;

            var lastState;

            thisCharacteristic = platform.getaddCharacteristic(newAccessory, Service.WindowCovering, Characteristic.TargetPosition)
                .on('get', function (callback) {

// if the desired_state has changed, it was caused by the Wink App. update our local variable
                    if (newAccessory.context.desired_state.position != null) {
                         lastState = newAccessory.context.desired_state.position * 100;
                    }
// if desired_state 'times out' and goes back to undefined, set it back to what the lastState was.
                    else if (lastState != undefined) {
                         newAccessory.context.desired_state.position = lastState / 100;
                    }
                    callback(null, lastState);
                }.bind(newAccessory))
                .on('set', function (value, callback) {
                    lastState = value;
                    platform.winkAPI.deviceSetDesired(newAccessory.context.uuid, { "position": value / 100 }, callback);
                }.bind(newAccessory));
            platform.addAttributeUsage('position', newAccessory.context.uuid, thisCharacteristic);

            thisCharacteristic = platform.getaddCharacteristic(newAccessory, Service.WindowCovering, Characteristic.CurrentPosition)
                .on('get', function (callback) {
                    callback(null, lastState);
                }.bind(newAccessory));
            platform.addAttributeUsage('position', newAccessory.context.uuid, thisCharacteristic);

I had to create a variable 'lastState' that I updated when I used the blinds. The GET function would return that value.

How can I make a similar modification to your code? It's structured quite differently...

Thanks.

Failed to refresh devices

Wink3 fails to show any devices - I can add the Wink Hub but no devices appear:

[5/17/2017, 7:38:28 PM] [Wink] Failed to refresh devices. TypeError: Cannot read property 'powered' of undefined
at Object.get (/usr/lib/node_modules/homebridge-wink3/src/devices/light_bulb.js:11:27)
at s.characteristics.filter.forEach.c (/usr/lib/node_modules/homebridge-wink3/src/AccessoryHelper.js:139:28)
at Array.forEach (native)
at accessory.definition.services.forEach.s (/usr/lib/node_modules/homebridge-wink3/src/AccessoryHelper.js:138:44)
at Array.forEach (native)
at AccessoryHelper.updateAccessoryState (/usr/lib/node_modules/homebridge-wink3/src/AccessoryHelper.js:135:35)
at AccessoryHelper.configureAccessory (/usr/lib/node_modules/homebridge-wink3/src/AccessoryHelper.js:44:10)
at WinkPlatform.addDevice (/usr/lib/node_modules/homebridge-wink3/src/WinkPlatform.js:104:26)
at Array.forEach (native)
at /usr/lib/node_modules/homebridge-wink3/src/WinkPlatform.js:136:13
at Generator.next ()
at step (/usr/lib/node_modules/homebridge-wink3/dist/WinkPlatform.js:32:191)
at /usr/lib/node_modules/homebridge-wink3/dist/WinkPlatform.js:32:361
at process._tickCallback (internal/process/next_tick.js:109:7)
[5/17/2017, 7:38:30 PM] [Wink] Authenticated with local Wink hub (172.16.0.215)

Failed to refresh devices??

So I tried to move from homebridge-winkv3 to home bridge-wink3 and I'm running into an error now.
I'm sure its something simple but I just can't seem to figure it out. Any help would be great.

`[5/17/2017, 2:01:35 PM] Homebridge is running on port 51826.
[5/17/2017, 2:01:36 PM] [Wink] Authenticated with wink.com
[5/17/2017, 2:01:36 PM] [Wink] Refreshing devices...
[5/17/2017, 2:01:37 PM] [Wink] Failed to refresh devices. TypeError: Cannot read property 'services' of undefined
at AccessoryHelper.getDefinition (/usr/lib/node_modules/homebridge-wink3/src/AccessoryHelper.js:25:17)
at WinkPlatform.patchAccessory (/usr/lib/node_modules/homebridge-wink3/src/WinkPlatform.js:76:49)
at WinkPlatform.addDevice (/usr/lib/node_modules/homebridge-wink3/src/WinkPlatform.js:103:10)
at Array.forEach (native)
at /usr/lib/node_modules/homebridge-wink3/src/WinkPlatform.js:136:13
at Generator.next ()
at step (/usr/lib/node_modules/homebridge-wink3/dist/WinkPlatform.js:32:191)
at /usr/lib/node_modules/homebridge-wink3/dist/WinkPlatform.js:32:361
at process._tickCallback (internal/process/next_tick.js:109:7)
[5/17/2017, 2:01:42 PM] [Wink] Wink hub (192.168.1.159) is not reachable locally { RequestError: Error: ESOCKETTIMEDOUT
at new RequestError (/usr/lib/node_modules/homebridge-wink3/node_modules/request-promise-core/lib/errors.js:14:15)
at Request.plumbing.callback (/usr/lib/node_modules/homebridge-wink3/node_modules/request-promise-core/lib/plumbing.js:87:29)
at Request.RP$callback [as _callback] (/usr/lib/node_modules/homebridge-wink3/node_modules/request-promise-core/lib/plumbing.js:46:31)
at self.callback (/usr/lib/node_modules/homebridge-wink3/node_modules/request/request.js:188:22)
at emitOne (events.js:96:13)
at Request.emit (events.js:191:7)
at ClientRequest. (/usr/lib/node_modules/homebridge-wink3/node_modules/request/request.js:822:16)
at Object.onceWrapper (events.js:293:19)
at emitNone (events.js:86:13)
at ClientRequest.emit (events.js:188:7)
name: 'RequestError',
message: 'Error: ESOCKETTIMEDOUT',
cause:
{ Error: ESOCKETTIMEDOUT
at ClientRequest. (/usr/lib/node_modules/homebridge-wink3/node_modules/request/request.js:819:19)
at Object.onceWrapper (events.js:293:19)
at emitNone (events.js:86:13)
at ClientRequest.emit (events.js:188:7)
at TLSSocket.emitTimeout (_http_client.js:679:10)
at Object.onceWrapper (events.js:293:19)
at emitNone (events.js:86:13)
at TLSSocket.emit (events.js:188:7)
at TLSSocket.Socket._onTimeout (net.js:352:8)
at ontimeout (timers.js:386:14) code: 'ESOCKETTIMEDOUT', connect: false },
error:
{ Error: ESOCKETTIMEDOUT
at ClientRequest. (/usr/lib/node_modules/homebridge-wink3/node_modules/request/request.js:819:19)
at Object.onceWrapper (events.js:293:19)
at emitNone (events.js:86:13)
at ClientRequest.emit (events.js:188:7)
at TLSSocket.emitTimeout (_http_client.js:679:10)
at Object.onceWrapper (events.js:293:19)
at emitNone (events.js:86:13)
at TLSSocket.emit (events.js:188:7)
at TLSSocket.Socket._onTimeout (net.js:352:8)
at ontimeout (timers.js:386:14) code: 'ESOCKETTIMEDOUT', connect: false },
options:
{ baseUrl: 'https://192.168.1.159:8888',
strictSSL: false,
json: false,
method: 'GET',
uri: '/',
timeout: 5000,
headers: { 'User-Agent': 'Manufacturer/Apple-iPhone8_1 iOS/10.3.1 WinkiOS/5.8.0.27-production-release (Scale/2.00)' },
callback: [Function: RP$callback],
transform: undefined,
simple: true,
resolveWithFullResponse: false,
transform2xxOnly: false },
response: undefined }

`

Stuck on oauth issue

Two errors: This one prior to authorizing in safari (on a mac). Here's my config.json chunk for wink:

"platforms": [{
"platform": "Wink",
"name": "Wink",
"client_id": "client_id",
"client_secret": "client_secret",
"hide_groups": [
"thermostat"
],
"fan_ids": [
"556496",
"556577"
]
},

[Wink] To authenticate, go here using a web browser: http://192.168.0.24:8888
[10/3/2017, 5:00:21 PM] Error: You did not specify {'token'} or {'clientId','clientSecret','code'}, one set of which is required for the new API
at /usr/local/lib/node_modules/homebridge-nest/index.js:80:11
at setupConnection (/usr/local/lib/node_modules/homebridge-nest/index.js:64:9)
at Object.accessories (/usr/local/lib/node_modules/homebridge-nest/index.js:143:3)
at Server._loadPlatformAccessories (/usr/local/lib/node_modules/homebridge/lib/server.js:354:20)
at Server._loadPlatforms (/usr/local/lib/node_modules/homebridge/lib/server.js:298:16)
at Server.run (/usr/local/lib/node_modules/homebridge/lib/server.js:80:36)
at module.exports (/usr/local/lib/node_modules/homebridge/lib/cli.js:40:10)
at Object. (/usr/local/lib/node_modules/homebridge/bin/homebridge:17:22)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.runMain (module.js:604:10)
at run (bootstrap_node.js:394:7)
at startup (bootstrap_node.js:149:9)
at bootstrap_node.js:509:3
[10/3/2017, 5:00:21 PM] Falling back to legacy API.

This one once I authorize:

[10/3/2017, 5:02:52 PM] [Wink] Could not authenticate with wink.com { StatusCodeError: 400 - {"data":{"error":"invalid_grant","error_description":""},"errors":["invalid_grant: "],"pagination":{},"error":"invalid_grant","error_description":""}
at new StatusCodeError (/usr/local/lib/node_modules/homebridge-wink3/node_modules/request-promise-core/lib/errors.js:32:15)
at Request.plumbing.callback (/usr/local/lib/node_modules/homebridge-wink3/node_modules/request-promise-core/lib/plumbing.js:104:33)
at Request.RP$callback [as _callback] (/usr/local/lib/node_modules/homebridge-wink3/node_modules/request-promise-core/lib/plumbing.js:46:31)
at Request.self.callback (/usr/local/lib/node_modules/homebridge-wink3/node_modules/request/request.js:188:22)
at emitTwo (events.js:106:13)
at Request.emit (events.js:191:7)
at Request. (/usr/local/lib/node_modules/homebridge-wink3/node_modules/request/request.js:1171:10)
at emitOne (events.js:96:13)
at Request.emit (events.js:188:7)
at IncomingMessage. (/usr/local/lib/node_modules/homebridge-wink3/node_modules/request/request.js:1091:12)
at IncomingMessage.g (events.js:291:16)
at emitNone (events.js:91:20)
at IncomingMessage.emit (events.js:185:7)
at endReadableNT (_stream_readable.js:974:12)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickCallback (internal/process/next_tick.js:98:9)
name: 'StatusCodeError',
statusCode: 400,
message: '400 - {"data":{"error":"invalid_grant","error_description":""},"errors":["invalid_grant: "],"pagination":{},"error":"invalid_grant","error_description":""}',
error:
{ data: { error: 'invalid_grant', error_description: '' },
errors: [ 'invalid_grant: ' ],
pagination: {},
error: 'invalid_grant',
error_description: '' },
options:
{ method: 'POST',
baseUrl: 'https://api.wink.com',
uri: '/oauth2/token',
body:
{ grant_type: 'code',
client_secret: 'ImKuzGCLFESq_EgG_BCGZntAgkm7fQi1',
code: '2IO5_QzF3yqkOH-wDAxA' },
json: true,
callback: [Function: RP$callback],
transform: undefined,
simple: true,
resolveWithFullResponse: false,
transform2xxOnly: false },
response:
IncomingMessage {
_readableState:
ReadableState {
objectMode: false,
highWaterMark: 16384,
buffer: [Object],
length: 0,
pipes: null,
pipesCount: 0,
flowing: true,
ended: true,
endEmitted: true,
reading: false,
sync: true,
needReadable: false,
emittedReadable: false,
readableListening: false,
resumeScheduled: false,
defaultEncoding: 'utf8',
ranOut: false,
awaitDrain: 0,
readingMore: false,
decoder: null,
encoding: null },
readable: false,
domain: null,
_events:
{ end: [Object],
close: [Object],
data: [Function],
error: [Function] },
_eventsCount: 4,
_maxListeners: undefined,
socket:
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,
destroyed: true,
_bytesDispatched: 251,
_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 },
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,
destroyed: true,
_bytesDispatched: 251,
_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 },
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 (fe33053d43ba)',
'x-content-type-options': 'nosniff',
'x-frame-options': 'SAMEORIGIN',
'x-request-id': 'dc261793-bdc4-829e-0fc0-a55f35cba23c',
'x-runtime': '0.049481',
'x-xss-protection': '1; mode=block',
date: 'Tue, 03 Oct 2017 21:02:52 GMT',
'content-length': '149',
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 (fe33053d43ba)',
'X-Content-Type-Options',
'nosniff',
'X-Frame-Options',
'SAMEORIGIN',
'X-Request-Id',
'dc261793-bdc4-829e-0fc0-a55f35cba23c',
'X-Runtime',
'0.049481',
'X-Xss-Protection',
'1; mode=block',
'Date',
'Tue, 03 Oct 2017 21:02:52 GMT',
'Content-Length',
'149',
'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,
destroyed: true,
_bytesDispatched: 251,
_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 },
_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,
_removedHeader: [Object],
_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: 102\r\nConnection: close\r\n\r\n',
_headers: [Object],
_headerNames: [Object],
_onPendingData: null,
agent: [Object],
socketPath: undefined,
timeout: undefined,
method: 'POST',
path: '/oauth2/token',
_ended: true,
parser: null,
res: [Circular] },
request:
Request {
domain: null,
_events: [Object],
_eventsCount: 5,
_maxListeners: undefined,
method: 'POST',
uri: [Object],
body: '{"grant_type":"code","client_secret":"ImKuzGCLFESq_EgG_BCGZntAgkm7fQi1","code":"2IO5_QzF3yqkOH-wDAxA"}',
readable: true,
writable: true,
explicitMethod: true,
_qs: [Object],
_auth: [Object],
_oauth: [Object],
_multipart: [Object],
_redirect: [Object],
_tunnel: [Object],
_rp_resolve: [Function: s],
_rp_reject: [Function: t],
_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: [Object],
pagination: {},
error: 'invalid_grant',
error_description: '' } } }

Support for Wink Fan Receiver MR101Z

HomeDepot is now selling https://goo.gl/DMmpPk - a Wink compatible fan. When they are added, homebridge-wink3 reports:

[7/25/2017, 4:44:13 PM] [Wink] Not supported by HomeKit: Master Bedroom (fan/4021)
[7/25/2017, 4:44:13 PM] [Wink] Not supported by HomeKit: Living Room (fan/4022)

Adding the 4021 and 4022 to fan_ids in conf file does not do the trick. How can this be implemented?

Refreshing devices after automation

I noticed another odd issue. After running an automation, it performs correctly. In this case, it was an automation that turned off certain lights. However, the Home App still shows (for example) that the lights are "on." The Home App showed this for about 30 minutes until the Wink3 log showed "refreshing devices/Devices refreshed." At that point, the lights correctly showed as "off." Here's the log:

[5/22/2017, 9:27:13 AM] [Wink] Sending update: Kitchen Cabinets (binary_switch/455994) { powered: false }
[5/22/2017, 9:27:13 AM] [Wink] Sending update: Kitchen Main (light_bulb/2645199) { powered: false }
[5/22/2017, 9:27:13 AM] [Wink] Sending update: Kitchen Nook Ceiling (light_bulb/2645178) { powered: false }
[5/22/2017, 9:27:13 AM] [Wink] Sending update: Kitchen Nook Fixture (light_bulb/2645176) { powered: false }
[5/22/2017, 9:27:14 AM] [Wink] Update sent successfully: Kitchen Nook Fixture (light_bulb/2645176)
[5/22/2017, 9:27:14 AM] [Wink] Update sent successfully: Kitchen Cabinets (binary_switch/455994)
[5/22/2017, 9:27:14 AM] [Wink] Update sent successfully: Kitchen Nook Ceiling (light_bulb/2645178)
[5/22/2017, 9:27:18 AM] [Wink] Update sent successfully: Kitchen Main (light_bulb/2645199)
[5/22/2017, 9:55:37 AM] [Wink] Refreshing devices...
[5/22/2017, 9:55:39 AM] [Wink] Devices refreshed

Chamberlain MyQ

Anyone have any functioning work around? I can get it to work with the chamberlain2 plugin, but it doesn't generate any notifications. I assume it is all screwed up by their home bridge application/hardware.

Canary mode notifications

Greetings,

Thanks for the awesome plugin. Definitely the best one so far.

I've noticed that when Canary enters Home mode I get a notification saying it was Armed. Shouldn't it be disarmed since Home mode is usually not recording?

It would also be great to see Security System Disarmed in the HomeKit status when Canary is in Home mode.

Again, thank you for your hard work.

osram color bulbs

since i updated from the original plugin to this one, everytime i try to change the color of a bulb it crashes and wont change.

Door Locks

I'm having an issue with door locks (kwikset).

Everything seems fine in the Home App and works. Locking/Unlocking works as expected.

However, if I tell SIRI to UNLOCK the door, the log shows the plugin is attempting to LOCK the door?? This is happening on all 3 of my locks.

Support for Air Conditioners

I'd like to see better support for Air Conditioners, including native fan speed. Additionally, I'm wondering why air conditioners are using the thermostat classification in HomeKit instead of using Apple's native Air Conditioner device type. Is there a reason not to make that change?

Fix for unknown switches reporting a lights.

If Wink cannot identify a switch it assumes that it is a light bulb. In my case they are Aeon Metered Switches, that wink is setting as a bulb. I'd love to see a way of forcing them to binary switch that they are, within HomeKit at least.

GoControl Garage Door controller

Does this version allow for control of the go control garage door controller? The orginal plugin worked, wink2 doesn't, so I am hoping this is the best of both worlds!

undefined/undefined crash

One more crash:

[5/17/2017, 10:11:33 PM] [Wink] Sending update: Backdoor Deadbolt (lock/151114) { locked: true }
[5/17/2017, 10:11:34 PM] [Wink] Update sent successfully: Backdoor Deadbolt (lock/151114)
[5/17/2017, 10:11:34 PM] [Wink] Received update notification: Backdoor Deadbolt (lock/151114)
[5/17/2017, 10:11:40 PM] [Wink] Received update notification: Backdoor Deadbolt (lock/151114)
[5/17/2017, 10:42:02 PM] [Wink] Received update notification: Backdoor Deadbolt (undefined/undefined)

/usr/lib/node_modules/homebridge-wink3/src/AccessoryHelper.js:124
const context = accessory.context;
^
TypeError: Cannot read property 'context' of undefined
at AccessoryHelper.updateAccessoryState (/usr/lib/node_modules/homebridge-wink3/src/AccessoryHelper.js:124:21)
at WinkPlatform.updateDevice (/usr/lib/node_modules/homebridge-wink3/src/WinkPlatform.js:119:26)
at Subscriptions.WinkPlatform.subscriptions.on.device (/usr/lib/node_modules/homebridge-wink3/src/WinkPlatform.js:38:12)
at emitOne (events.js:96:13)
at Subscriptions.emit (events.js:191:7)
at Subscriptions.onMessage (/usr/lib/node_modules/homebridge-wink3/src/Subscriptions.js:46:12)
at /usr/lib/node_modules/homebridge-wink3/node_modules/pubnub/lib/core/components/core/components/listener_manager.js:45:38
at Array.forEach (native)
at _class.announceMessage (/usr/lib/node_modules/homebridge-wink3/node_modules/pubnub/lib/core/components/core/components/listener_manager.js:44:21)
at /usr/lib/node_modules/homebridge-wink3/node_modules/pubnub/lib/core/components/core/components/subscription_manager.js:404:31
at Array.forEach (native)
at _class._processSubscribeResponse (/usr/lib/node_modules/homebridge-wink3/node_modules/pubnub/lib/core/components/core/components/subscription_manager.js:336:14)
at onResponse (/usr/lib/node_modules/homebridge-wink3/node_modules/pubnub/lib/core/components/core/components/endpoint.js:131:7)
at /usr/lib/node_modules/homebridge-wink3/node_modules/pubnub/lib/networking/modules/networking/modules/web-node.js:63:16
at Request.callback (/usr/lib/node_modules/homebridge-wink3/node_modules/superagent/lib/node/index.js:619:12)
at Stream. (/usr/lib/node_modules/homebridge-wink3/node_modules/superagent/lib/node/index.js:795:18)
at emitNone (events.js:86:13)
at Stream.emit (events.js:188:7)
at Unzip. (/usr/lib/node_modules/homebridge-wink3/node_modules/superagent/lib/node/utils.js:112:12)
at emitNone (events.js:91:20)
at Unzip.emit (events.js:188:7)
at endReadableNT (_stream_readable.js:975:12)

Action required: Greenkeeper could not be activated 🚨

🚨 You need to enable Continuous Integration on all branches of this repository. 🚨

To enable Greenkeeper, you need to make sure that a commit status is reported on all branches. This is required by Greenkeeper because we are using your CI build statuses to figure out when to notify you about breaking changes.

Since we did not receive a CI status on the greenkeeper/initial branch, we assume that you still need to configure it.

If you have already set up a CI for this repository, you might need to check your configuration. Make sure it will run on all new branches. If you don’t want it to run on every branch, you can whitelist branches starting with greenkeeper/.

We recommend using Travis CI, but Greenkeeper will work with every other CI service as well.

GE Zwave Smart Fan Control Device Type in HomeKit is Lightbulb

I’ve begun installing GE Zwave Smart Fan Control Switches to control my fans. In HomeKit they appear as lightbulbs. Most devices give the option to choose between Fan, lightbulb, or switch. However these have no option.

Any ideas or suggestions?

Wink Hub 2 consistently unreachable

I recently added a Wink Hub 2 to my setup in order to add some z-wave devices. Lately, I've noticed that homebridge is reporting that it's not reachable locally, with the following status:

[9/7/2017, 9:27:19 AM] [wink] Checking if hub is reachable (Wink Hub 2, 192.168.86.31)...                 
[9/7/2017, 9:27:24 AM] [wink] Hub is not reachable locally (Wink Hub 2, 192.168.86.31). Error: ESOCKETTIMEDOUT                                                                                                      
[9/7/2017, 9:27:24 AM] [wink] Will continue without local control for hub (Wink Hub 2, 192.168.86.31) 

The Wink app doesn't report any issue with it, and the devices paired with it are still controllable with both the Wink app and HomeKit, though oddly I've discovered that I can't use the actual switches to control their devices, I can only control them through one of the apps, which is weird (no idea if that's related).

I haven't started doing any digging to try and figure out what's going on yet, but I figured someone else might have experienced something similar and have a solution or at least direction to go in.

ERROR LOADING PLUGIN homebridge-wink3 - SyntaxError: Unexpected token {

I keep getting an error with homebridge-wink3 plugin.

0|homebrid | [8/8/2017, 4:40:37 PM] ====================
0|homebrid | [8/8/2017, 4:40:37 PM] ERROR LOADING PLUGIN homebridge-wink3:
0|homebrid | [8/8/2017, 4:40:37 PM] SyntaxError: Unexpected token {
0|homebrid | at exports.runInThisContext (vm.js:53:16)
0|homebrid | at Module._compile (module.js:373:25)
0|homebrid | at Object.Module._extensions..js (module.js:416:10)
0|homebrid | at Module.load (module.js:343:32)
0|homebrid | at Function.Module._load (module.js:300:12)
0|homebrid | at Module.require (module.js:353:17)
0|homebrid | at require (internal/module.js:12:17)
0|homebrid | at Object. (/usr/local/lib/node_modules/homebridge-wink3/dist/WinkPlatform.js:42:19)
0|homebrid | at Module._compile (module.js:409:26)
0|homebrid | at Object.Module._extensions..js (module.js:416:10)
0|homebrid | at Module.load (module.js:343:32)
0|homebrid | at Function.Module._load (module.js:300:12)
0|homebrid | at Module.require (module.js:353:17)
0|homebrid | at require (internal/module.js:12:17)
0|homebrid | at Object. (/usr/local/lib/node_modules/homebridge-wink3/dist/index.js:11:21)
0|homebrid | at Module._compile (module.js:409:26)
0|homebrid | [8/8/2017, 4:40:37 PM] ====================
0|homebrid | [8/8/2017, 4:40:37 PM] Loaded config.json with 0 accessories and 2 platforms.
0|homebrid | [8/8/2017, 4:40:37 PM] ---
0|homebrid | [8/8/2017, 4:40:37 PM] Loading 2 platforms...
0|homebrid | Error: The requested platform 'Wink' was not registered by any plugin.
0|homebrid | at API.platform (/usr/local/lib/node_modules/homebridge/lib/api.js:122:13)
0|homebrid | at Server._loadPlatforms (/usr/local/lib/node_modules/homebridge/lib/server.js:284:45)
0|homebrid | at Server.run (/usr/local/lib/node_modules/homebridge/lib/server.js:80:36)
0|homebrid | at module.exports (/usr/local/lib/node_modules/homebridge/lib/cli.js:40:10)
0|homebrid | at Object. (/usr/local/lib/node_modules/homebridge/bin/homebridge:17:22)
0|homebrid | at Module._compile (module.js:409:26)
0|homebrid | at Object.Module._extensions..js (module.js:416:10)
0|homebrid | at Module.load (module.js:343:32)
0|homebrid | at Function.Module._load (module.js:300:12)
0|homebrid | at Object. (/usr/local/lib/node_modules/pm2/lib/ProcessContainerFork.js:70:21)
0|homebrid | at Module._compile (module.js:409:26)
0|homebrid | at Object.Module._extensions..js (module.js:416:10)
0|homebrid | at Module.load (module.js:343:32)
0|homebrid | at Function.Module._load (module.js:300:12)
0|homebrid | at Function.Module.runMain (module.js:441:10)
0|homebrid | at startup (node.js:139:18)

GE Z-Wave Fan Control reporting

When a GE Fan control switch (motor control dimmer) is listed as a 'fan id' it can control the switch, but if the switch is manually operated, it does not report back and update HomeKit.

a suggestion

perhaps the configuration options for hide_ids and window_ids could take a string like "sensor_pod/123" in addition to "123" ... that would remove any ambiguity for different device types that have the same numeric-identifier...

Failed to refresh devices error

The is the error received when running Homebridge

Failed to refresh devices. TypeError: Cannot read property 'on' of undefined at definition.characteristics.forEach.c (/usr/local/lib/node_modules/homebridge-wink3/src/AccessoryHelper.js:74:11) at Array.forEach (native) at services.forEach.definition (/usr/local/lib/node_modules/homebridge-wink3/src/AccessoryHelper.js:65:34) at Array.forEach (native) at AccessoryHelper.configureAccessoryCharacteristics (/usr/local/lib/node_modules/homebridge-wink3/src/AccessoryHelper.js:62:14) at AccessoryHelper.configureAccessory (/usr/local/lib/node_modules/homebridge-wink3/src/AccessoryHelper.js:43:10) at WinkPlatform.addDevice (/usr/local/lib/node_modules/homebridge-wink3/src/WinkPlatform.js:144:26) at Array.forEach (native) at /usr/local/lib/node_modules/homebridge-wink3/src/WinkPlatform.js:181:13 at next (native)

Here's the code of my config.json file

{
"bridge": {
"name": "Joseph's HomeBridge",
"username": "HIDDEN",
"port": HIDDEN,
"pin": "031-45-157"
},
"description": "This is an example configuration file with all supported devices. You can use this as a template for creating your own configuration file containing devices you actually own.",
"platforms": [
{
"platform": "IFTTT",
"name": "IFTTT",
"makerkey": "HIDDEN",
"accessories": [
{
"name": "Aros",
"buttons": [
{
"caption": "Aros 64",
"triggerOn": "aros_64",
"triggerOff": "aros_off"
},
{
"caption": "Aros 68",
"triggerOn": "aros_68",
"triggerOff": "aros_off"
},
{
"caption": "Aros 72",
"triggerOn": "aros_72",
"triggerOff": "aros_off"
},
{
"caption": "Aros 76",
"triggerOn": "aros_76",
"triggerOff": "aros_off"
},
{
"caption": "Aros 80",
"triggerOn": "aros_80",
"triggerOff": "aros_off"
},
{
"caption": "Aros",
"triggerOn": "aros_on",
"triggerOff": "aros_off"
}
]
}
]
},
{
"platform": "Wink",
"name": "Wink",
"client_id": "HIDDEN",
"client_secret": "HIDDEN",
"username": "HIDDEN",
"password": "HIDDEN",
"hide_groups": [
"garage_door",
"binary_switches",
"cameras",
"garage_doors",
"light_bulbs",
"locks",
"propane_tanks",
"shades",
"sirens",
"smoke_detectors",
"thermostats"
],
"direct_access": "false",
"access_token": "HIDDEN",
"refresh_token": "HIDDEN"
}
]
}

Home App Updates Post Change

Putting this here to discuss -

So this relies on push notifications and doesn't pull updates from Wink? Since there aren't many console.logs I am asking: After I make a change does it poll the API for that hanger? I am noticing the changes are made on Wink but not reflected in the Home app.

Leviton Outlet as Outlets_ID

Any plans to allow to differentiate a levity outlet as such, as opposed to it showing as a light? I tried adding outlets_id to th config, but that didn't work.

Door_Bell.js

door_bell.js.zip

Just trying to see if this works. I cribbed the top part of camera.js for the motion sensor and the battery at the bottom to make a door_bell.js so that the Ring Doorbell motion sensor works.

Getting Error: UUID '...' is not a valid UUID

I've been getting this error trying to connect to my Quirky Aros - any ideas what's going on?

[2017-8-2 23:49:35] [Wink] Refreshing devices...
[2017-8-2 23:49:39] [Wink] Failed to refresh devices. Error: UUID '[removed]' is not a valid UUID. Try using the provided 'generateUUID' function to create a valid UUID from any arbitrary string, like a serial number.
    at new PlatformAccessory (/opt/node/lib/node_modules/homebridge/lib/platformAccessory.js:17:34)
    at WinkPlatform.addDevice (/opt/node/lib/node_modules/homebridge-wink3/src/WinkPlatform.js:142:23)
    at Array.forEach (native)
    at /opt/node/lib/node_modules/homebridge-wink3/src/WinkPlatform.js:181:13
    at Generator.next (<anonymous>)
    at step (/opt/node/lib/node_modules/homebridge-wink3/dist/WinkPlatform.js:52:191)
    at /opt/node/lib/node_modules/homebridge-wink3/dist/WinkPlatform.js:52:361
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)

Automations

I'm not sure if it's because of how it's polling for changes, but Automations don't work for me at all.

Push notifications (device updates) sometimes not working

Background

The plugin subscribes to each Wink device (using PubNub), and receives push notifications whenever a device's state changes (such as when a light bulb is turned on).

An alternative approach to receiving to push notifications would be to poll the Wink API on a regular interval to pull device updates.

Push notifications are beneficial for the following reasons:

  • The plugin can push device updates to HomeKit in real-time
  • The plugin can minimize the number of requests it makes to the Wink API

Note: the plugin still polls the Wink API on an hourly basis, but it uses push notifications for its main source of device updates.

Problem

Sometimes the plugin stops receiving push notifications. This results in device updates being delayed by up to an hour, before showing in HomeKit.

What I can tell so far:

  • Push notifications stop for a period of time, and then resume at a later time
  • I'm not (yet) able to predict when it'll happen or the duration

I've also experienced this situation immediately upon starting the plugin, which leads me to believe the problem is on Wink's end.

Possible Solutions

The only solution I can currently think of, involves polling the Wink API more often.

This isn't a great solution though, as there will still be some delay in updates being pushed to HomeKit and it reduces the number of available API calls for requesting device updates to Wink.

What I'm doing

I've been working with a custom version of the plugin, where I've added extra code to track and log when push notifications stop working. I'm hoping to gain some further insights into the problem.

Outlets and Switches and Fans - Binary Switches

Only the Outlink supports consumption in Wink. But you could have a binary_switch that is connected to an outlet. In this case, the device wouldn't have consumption. Because of this, there needs to be a manual way to set a binary_switch as an outlet.

I have modified the const declarations up the top to;

const isFan = (state, device, config) =>        config.fan_ids.indexOf(device.object_id) !== -1;

const isOutlet = (state, device, config) =>     config.outlet_ids.indexOf(device.object_id) !== -1 ||
                                                state.consumption !== undefined;

const isSwitch = (state, device, config) =>     config.switch_ids.indexOf(device.object_id) !== -1;

const isLightBulb = (state, device, config) =>  !isFan(state, device, config) &&
                                                !isOutlet(state, device, config) &&
                                                !isSwitch(state, device, config);

So an Outlet can be manually defined, or it can look for the consumption property. It also needs a slight modification to the 'Outlet in Use' property;

        characteristic: Characteristic.OutletInUse,
//        get: state => state.consumption > 0.1
        get: state => {
                if (state.consumption == undefined)
                        return state.consumption > 0.1;
                else
                        return state.powered;
        }

If a binary_switch is defined as a Service.Outlet, then you can change the type within Home to;

  • Fan
  • Light
  • Outlet

If a binary_switch is defined as a Service.Switch, then you can change the type within Home to;

  • Fan
  • Light
  • Switch

Which means that, you don't really need to identify a fan. You could just identify it as an Outlet or a Switch, and modify the type within the Home app.

"Merge" with homebridge-wink?

@sibartlett: As @pdlove and I likely both agree, you have done an excellent job revamping the plugin, would you want to just move forward as homebridge-wink (instead of homebridge-wink3. I think the wink2 and wink3 are confusing many people. And the way I see it, mine was v1, @pdlove's (wink2) was v2, and I see yours (wink3) as v3.

Today I went through and merged @pdlove's rewrite into the main homebridge-wink repo and released all the v2 versions to npm as homebridge-wink.

My proposal would be to publish your version as version 3.x.x to homebridge-wink and I can make you a contributor/owner to it in npm. As far as repo's go, I would suggest doing some git subtree magic to include both sources but make your source completely overtake the current source (which is now matches @pdlove's fork). My reasoning for that:

  1. It will finally unify everything
  2. It will give a better outlook as in the progression across the 4 rewrites (the original by various devs, my rewrite when I took it over, @pdlove's rewrite, and of course yours)
  3. Give credit to those who have done leg work on this (same reason I made sure the original developers commits show up on my repo when I severed/adopted it from the main homebridge repo)

Thoughts?

OAuth Authorization Code Error

I log in to http://ip_address:8888 with my username and password and I see that I have been successfully authenticated "Homebridge successfully authenticated with Wink."

But in the terminal, I get the following error:

Could not authenticate with wink.com { Error: EACCES: permission denied, open '/home/pi/.homebridge/config.json'
    at Object.fs.openSync (fs.js:584:18)
    at Object.fs.writeFileSync (fs.js:1314:33)
    at WinkPlatform.updateConfig (/usr/lib/node_modules/homebridge-wink3/src/WinkPlatform.js:66:8)
    at WinkClient.updateConfig (/usr/lib/node_modules/homebridge-wink3/src/WinkPlatform.js:40:36)
    at then.response (/usr/lib/node_modules/homebridge-wink3/src/WinkClient.js:70:12)
    at process._tickCallback (internal/process/next_tick.js:109:7)
  errno: -13,
  code: 'EACCES',
  syscall: 'open',
  path: '/home/pi/.homebridge/config.json' }

my accessories do not show up. I have the sonos plugin installed and that is working fine in homebridge.

My config.json:

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

    "platforms": [{
        "platform": "Wink",
        "name": "Wink",
        "client_id": "xxxxxxxxxxxxx",
        "client_secret": "xxxxxxxxxxxxx",
        "hide_groups": ["garage_door","thermostat"]
    }],
        "accessories": [{
                "accessory": "Sonos",
                "name": "TV Room",
                "room": "TV Room"
        }, {
                "accessory": "Sonos",
                "name": "Living Room",
                "room": "Living Room"
        }]
 }

thanks.

Chamberlain Garage Error

Homekit picks up the garage status correctly. However, executing a close or open within Homekit throws the below error. Which then temporarily puts the Garage in an Not Responding status.

Garage Door (garage_door/76543) { position: 1 } (node:32298) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 12): TypeError: this.log is not a function

Wink v 3 Crashing

I'm getting a 'Cannot set property 'context' of undefined at WinkPlatform.updateDevice error. It causes HomeBridge to crash about every 18-24 hours. I'm about to try the new plugin you made and maybe that'll correct. Otherwise, any idea what this error might be?

REQ: Wink Relay buttons support

This fork is great! Really enjoying it. Encountered a problem with my Wink Relays:

Not supported by HomeKit: Relay #1's Top Button (button/xxxxx)
[8/12/2017, 10:18:11 PM] [Wink] Not supported by HomeKit: Relay #1's Bottom Button (button/xxxxx)
[8/12/2017, 10:18:11 PM] [Wink] Not supported by HomeKit: PA Relay #2's Top Button (button/xxxxx)
[8/12/2017, 10:18:11 PM] [Wink] Not supported by HomeKit: PA Relay #2's Bottom Button (button/xxxxx)

Looks like this was a feature ultimately implemented within the main trunk (homebridge-wink)?

KraigM/homebridge-wink#3

UPDATE: Looks like it actually is supported (the buttons show up in HomeKit and work) but I still see an error message on startup.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.