homebridge-wink icon indicating copy to clipboard operation
homebridge-wink copied to clipboard

Installed and recognized all devices, can't actually control them

Open charlesthomas opened this issue 8 years ago • 10 comments
trafficstars

I got homebridge and the plugin working, and I see all of my Wink devices in homekit, and they're even reading the correct statuses (on vs off at the time of config) but I can't actually control any of them in the iOS Home app.

charlesthomas avatar Dec 06 '16 19:12 charlesthomas

This is all I'm getting in the console:

[12/6/2016, 2:07:22 PM] [Wink] Changing target property 'powered' of the light_bulbs called Office Overhead to 1 [12/6/2016, 2:07:54 PM] [Wink] Changing target property 'powered' of the light_bulbs called Office Overhead to 1 [12/6/2016, 2:07:55 PM] [Wink] Changing target property 'powered' of the light_bulbs called Office Overhead to 0 [12/6/2016, 2:07:56 PM] [Wink] Changing target property 'powered' of the light_bulbs called Office Overhead to 1 [12/6/2016, 2:07:56 PM] [Wink] Changing target property 'powered' of the light_bulbs called Office Overhead to 0 [12/6/2016, 2:07:57 PM] [Wink] Changing target property 'powered' of the light_bulbs called Office Overhead to 1 [12/6/2016, 2:07:57 PM] [Wink] Changing target property 'powered' of the light_bulbs called Office Overhead to 0 [12/6/2016, 2:08:01 PM] [Wink] Changing target property 'powered' of the light_bulbs called Office Overhead to 1 [12/6/2016, 2:08:10 PM] [Wink] Changing target property 'powered' of the undefined called Coffee Pot to 1 [12/6/2016, 2:08:12 PM] [Wink] Changing target property 'powered' of the undefined called Coffee Pot to 1

charlesthomas avatar Dec 06 '16 19:12 charlesthomas

Exactly the same issue here

dakkathx avatar Dec 18 '16 21:12 dakkathx

Also having this same issue

microb0x avatar Dec 22 '16 01:12 microb0x

I'm having the same issue as well. The plug-in worked for me probably about 6+ months ago, but I haven't really tried using it again until recently, which is when I've observed this problem. Has anyone had any luck, or tried forking this and adding some additional debugging?

scoobyshi avatar Dec 29 '16 04:12 scoobyshi

So, with a few additional debug statements, I found that the device "desired_state" on the initial request was empty:

{"object_type":"light_bulb","object_id":"1338xxx","uuid":"cdb488fc-7d56-4c61-b7fe-xxxx","icon_id":"71","icon_code":"light_bulb-light_bulb","desired_state":{}" . .

and this line in lib/wink-accessory.js was then causing the app to error out and never actually submit the requested desired_state (on/off):

else if (this.device.desired_state[sProperty] == undefined)

I commented this section out and while I can now successfully control my devices there are few inconsistencies I'd like to understand. I'm not sure why the desired_state payload is empty first of all, given that when I call the API directly (for example through Postman) it returns data there.

scoobyshi avatar Jan 02 '17 21:01 scoobyshi

I tried this too, and it worked as expected. After that, I was getting a lot of messages about retries, though. Lights were turning on or off as appropriate, but then would change back and I'd see retry messages in the console output. I commented out the retry line in the block where I found the logs. Not an ideal solution, but it's working now.

charlesthomas avatar Jan 03 '17 03:01 charlesthomas

Same issue here, commenting out the undefined detection worked for me as well. Same as Charles, lots of retries.

ckdake avatar Jan 20 '17 00:01 ckdake

So, I have a fork and pull request that resolves the ability to control, the retries, and the dimness controls: https://github.com/KraigM/homebridge-wink/pull/75, just waiting on either some feedback or an accept. I've been using it for a few weeks and it's behaving quite well.

scoobyshi avatar Jan 20 '17 01:01 scoobyshi

@scoobyshi nice! This works perfectly for me.

ckdake avatar Jan 20 '17 03:01 ckdake

@scoobyshi Your changes seem to be working for me. I'm still having some retries but they are very infrequent.

microb0x avatar Feb 04 '17 19:02 microb0x