Author Topic: PLUGIN: Wink Connect (formerly Wink Hub Controller)  (Read 167434 times)

Online cybrmage

  • Moderator
  • Hero Member
  • *****
  • Posts: 1068
  • Karma: +106/-5
Re: PLUGIN: Wink Hub Controller
« Reply #30 on: January 17, 2015, 05:02:47 pm »
This version is IT!   It is working ;D ;D

EXCELLENT!! Glad its working for you now...

I think there may be an issue with differences in the Lua processor between UI5 and UI7... If you would be so kind, now that it is working, could you check the logs for anything output by the plugin that contains "[NIL]" and let me know if you find anything. Thanks.

If you don't find anything, I'll publish a new version in the marketplace.
EVL3Vista - Wink Connect - Caseta Connect - Venstar Colortouch - WiFi UDP Switch Controller - Broadlink RM - MyQGateway

Offline ckohouse

  • Newbie
  • *
  • Posts: 13
  • Karma: +0/-0
Re: PLUGIN: Wink Hub Controller
« Reply #31 on: January 17, 2015, 06:14:05 pm »

I think there may be an issue with differences in the Lua processor between UI5 and UI7... If you would be so kind, now that it is working, could you check the logs for anything output by the plugin that contains "[NIL]" and let me know if you find anything. Thanks.
One item in the log associated with the Hub. The switch is ok.
0   01/17/15 17:09:21.100   luup_log:22: (Wink_Hub::startPollProcess) Starting Wink Hub device update. <0x2dce0680>
08   01/17/15 17:09:21.101   JobHandler_LuaUPnP::HandleActionRequest device: 22 service: urn:micasaverde-com:serviceId:Wink_Hub1 action: PollWinkDevices <0x2dce0680>
50   01/17/15 17:09:21.102   luup_log:22: (Wink_Hub::startPollProcess) Completed Wink Hub device update. <0x2dce0680>
01   01/17/15 17:09:22.002   luup_attr_get interface 0xfabee0 args 2 <0x2b5ac000>
01   01/17/15 17:09:22.003   LuaInterface::CallFunction_Job device 22 function SWinkHub1_Wink_Hub1_PollWinkDevices_job failed [string "-- Wink_Hub..."]:1490: attempt to concatenate local 'current_name' (a nil value) <0x2b5ac000>
01   01/17/15 17:09:22.003   Lua_Job::Run job#289 : dev:22 (0x1039c58) P:50 S:0 failed <0x2b5ac000>
04   01/17/15 17:09:22.006    <0x2b5ac000>
02   01/17/15 17:09:22.017   JobHandler::PurgeCompletedJobs purge job#289 : dev:22 (0x1039c58) P:50 S:2  status 2 <0x2b5ac000>
04   01/17/15 17:09:26.257    <0x2bce0680>
04   01/17/15 17:09:56.237    <0x2bce0680>
50   01/17/15 17:10:21.100   luup_log:22: (Wink_Hub::startPollProcess) Starting Wink Hub device update. <0x2dce0680>
08   01/17/15 17:10:21.101   JobHandler_LuaUPnP::HandleActionRequest device: 22 service: urn:micasaverde-com:serviceId:Wink_Hub1 action: PollWinkDevices <0x2dce0680>
50   01/17/15 17:10:21.102   luup_log:22: (Wink_Hub::startPollProcess) Completed Wink Hub device update. <0x2dce0680>

Offline Bboy486

  • Full Member
  • ***
  • Posts: 214
  • Karma: +2/-2
Re: PLUGIN: Wink Hub Controller
« Reply #32 on: January 17, 2015, 10:39:08 pm »
It might just be me but this plugin seems to have slowed down the firing of scenes. I have two scenes one using a Wemo motion sensor turning on a jasco Zwave light and the other using a Wemo motion sensor turning on a ge link via wink hub. When I restart vera the scenes fire correctly. But after some time the response time gets slower and slower and then does fire, or it might but I haven't seen the scenes run. I also can see that my notifications are slower by several seconds. Not saying it's this plugin but I suspect it might be.


Sent from my iPad using Tapatalk

Online cybrmage

  • Moderator
  • Hero Member
  • *****
  • Posts: 1068
  • Karma: +106/-5
Re: PLUGIN: Wink Hub Controller
« Reply #33 on: January 18, 2015, 12:00:32 pm »
Not saying it's this plugin but I suspect it might be.

Plugins have very little control of the events/triggers/notifications in LuaUPnP. Basically, you define the Events that the UPnP plugin will generate within the device's json and service files. Beyond that, the system generates the events, fires scenes, send notifications automatically.

The responsiveness of all of this behind the scenes action would depend on the state of the vera device... the more it is doing at any given moment, the slower the response is going to be.

Regarding the plugin specifically... Once the initial startup is completed (on every LuaUPnP reload), the plugin schedules the update task and returns control to the OS... Once the "poll interval" expires, the OS calls the plugin, which sends a command to the Wink API servers, and then processes the response (this is the task that updates the state of each device). This operational model is followed by all the devices on the system - including native Z-Wave devices...

The more devices you have attached to your Vera, the more load you will have on the device and the slower the responsiveness...

And the OS will only run one task per plugin at any given moment... If you send a command to a wink attached device while the plugin is retrieving the device status, the command will not run until the status command completes.

So, really, I don't know how the plugin can be "fixed" to correct this situation... or if it is indeed "broken" to cause this.
EVL3Vista - Wink Connect - Caseta Connect - Venstar Colortouch - WiFi UDP Switch Controller - Broadlink RM - MyQGateway

Offline dzmiller

  • Sr. Member
  • ****
  • Posts: 394
  • Karma: +9/-14
Re: PLUGIN: Wink Hub Controller
« Reply #34 on: January 18, 2015, 12:52:13 pm »
Thanks for doing this plugin.

I've been recommending Wink for simple systems. It's really a good solution for fire/CO/leak detection plus a few lights. Now I can add one to Vera at my house.

Offline Bboy486

  • Full Member
  • ***
  • Posts: 214
  • Karma: +2/-2
Re: PLUGIN: Wink Hub Controller
« Reply #35 on: January 18, 2015, 01:47:58 pm »

Not saying it's this plugin but I suspect it might be.




So, really, I don't know how the plugin can be "fixed" to correct this situation... or if it is indeed "broken" to cause this.

Totally understand and I get it. This plugin is great and I have been looking at the logs. I think I just need to do a proper backup and restore. I was searching for he proper way to do this as I think I have to backup both the Zwave and actual Vera.

Will this plugin work with the new Cree bulbs?


Sent from my iPhone using Tapatalk

Online cybrmage

  • Moderator
  • Hero Member
  • *****
  • Posts: 1068
  • Karma: +106/-5
Re: PLUGIN: Wink Hub Controller
« Reply #36 on: January 18, 2015, 03:22:03 pm »
I think I just need to do a proper backup and restore. I was searching for he proper way to do this as I think I have to backup both the Zwave and actual Vera.

Yes, you need to backup both. I believe the build-in "backup to server" functionality provides a backup for both.

Will this plugin work with the new Cree bulbs?

I don't know, as the Cree bulbs are not yet available in Canada... nut, if they connect to the Wink Hub, it should report them as a "light_bulb", and both binary and dimmable lights are supported.
EVL3Vista - Wink Connect - Caseta Connect - Venstar Colortouch - WiFi UDP Switch Controller - Broadlink RM - MyQGateway

Offline ckohouse

  • Newbie
  • *
  • Posts: 13
  • Karma: +0/-0
Re: PLUGIN: Wink Hub Controller
« Reply #37 on: January 18, 2015, 04:43:02 pm »

I think there may be an issue with differences in the Lua processor between UI5 and UI7... If you would be so kind, now that it is working, could you check the logs for anything output by the plugin that contains "[NIL]" and let me know if you find anything. Thanks.

I found another issue (UI7). The IOS app will not turn the switch off. It will turn it on. The browser turns the switch on and off without a problem.

From the logs:
01   01/18/15 15:12:43.893   luup_attr_get interface 0xfabee0 args 2 <0x2b5ac000>
01   01/18/15 15:12:43.894   LuaInterface::CallFunction_Job device 22 function SWinkHub1_Wink_Hub1_PollWinkDevices_job took 22 seconds <0x2b5ac000>
01   01/18/15 15:12:43.896   LuaInterface::CallFunction_Job device 22 function SWinkHub1_Wink_Hub1_PollWinkDevices_job failed [string "-- Wink_Hub..."]:1490: attempt to concatenate local 'current_name' (a nil value) <0x2b5ac000>
01   01/18/15 15:12:43.898   Lua_Job::Run job#3464 : dev:22 (0x1348bc0) P:50 S:0 failed <0x2b5ac000>
04   01/18/15 15:12:43.905    <0x2b5ac000>
02   01/18/15 15:12:43.906   JobHandler::PurgeCompletedJobs purge job#3464 : dev:22 (0x1348bc0) P:50 S:2  status 2 <0x2b5ac000>

50   01/18/15 15:13:21.100   luup_log:22: (Wink_Hub::startPollProcess) Starting Wink Hub device update. <0x2dce0680>
08   01/18/15 15:13:21.101   JobHandler_LuaUPnP::HandleActionRequest device: 22 service: urn:micasaverde-com:serviceId:Wink_Hub1 action: PollWinkDevices <0x2dce0680>
50   01/18/15 15:13:21.102   luup_log:22: (Wink_Hub::startPollProcess) Completed Wink Hub device update. <0x2dce0680>
01   01/18/15 15:13:21.766   luup_attr_get interface 0xfabee0 args 2 <0x2b5ac000>
01   01/18/15 15:13:21.767   LuaInterface::CallFunction_Job device 22 function SWinkHub1_Wink_Hub1_PollWinkDevices_job failed [string "-- Wink_Hub..."]:1490: attempt to concatenate local 'current_name' (a nil value) <0x2b5ac000>
01   01/18/15 15:13:21.767   Lua_Job::Run job#3467 : dev:22 (0x13236e0) P:50 S:0 failed <0x2b5ac000>
04   01/18/15 15:13:21.785    <0x2b5ac000>

Online cybrmage

  • Moderator
  • Hero Member
  • *****
  • Posts: 1068
  • Karma: +106/-5
Re: PLUGIN: Wink Hub Controller
« Reply #38 on: January 19, 2015, 01:03:47 am »
One item in the log associated with the Hub. The switch is ok.

I found another issue (UI7). The IOS app will not turn the switch off. It will turn it on. The browser turns the switch on and off without a problem.

First off... Do you have un-named devices on your Wink Hub???

second: The IOS app??? what IOS app??? What switch??

third... both logs show the same error, just at different times...  There is nothing in the log showing any action being commanded or performed, so I can't even start to look into that issue...

I did make changes for fix the error in the logs...

EVL3Vista - Wink Connect - Caseta Connect - Venstar Colortouch - WiFi UDP Switch Controller - Broadlink RM - MyQGateway

Offline seanh

  • Sr. Newbie
  • *
  • Posts: 40
  • Karma: +0/-4
Re: PLUGIN: Wink Hub Controller
« Reply #39 on: January 19, 2015, 01:52:37 am »
Hi - 2 questions.  Does this actually need a Wink Hub installed or just an account on Wink?   2nd - on UI7, I see you disable the MYQ from coming in since there is a great Vera App.  Are you doing the same thing with NEST?  I am interested in seeing how Nest devices might come in since the current Vera doesn't have great compatibility with UI7.

Online cybrmage

  • Moderator
  • Hero Member
  • *****
  • Posts: 1068
  • Karma: +106/-5
Re: PLUGIN: Wink Hub Controller
« Reply #40 on: January 19, 2015, 12:30:26 pm »
Does this actually need a Wink Hub installed or just an account on Wink?

No, a physical wink hub is not required. However, the only devices I have that do not require a hub are the MYQ controller and the philips hue hub.

Any device that connects to a Wink API account could be supported, however the MYQ controller under UI5 is the only one I can confirm as working at the moment. Although the philips huw/lux bulbs appear in the device list for the wink account, they do not report the correct status nor are they controllable... I have not yet determined if this is a Wink API issue or a plugin issue, although I suspect that it is an API issue...

on UI7, I see you disable the MYQ from coming in since there is a great Vera App.

Yes, MYQ support is disabled under UI7. This is not due to the MYQ Vera plugin... it is due to the fact that although MYQ support works under UI5, it does not under UI7...

Are you doing the same thing with NEST?

No, NEST support is not specifically disabled. I have tested the thermostat control with a Z-Wave thermostat (specifically, a 2-Gig manufactured Radio Thermostat CT-30 marketed as a Current Innovations CI-300e) and it works correctly under both UI5 and UI7.

If the NEST is configured in the Wink API as other thermostats, it should work without issue (barring Wink API flaws)... Until someone tries it, it is an unknown.

EVL3Vista - Wink Connect - Caseta Connect - Venstar Colortouch - WiFi UDP Switch Controller - Broadlink RM - MyQGateway

Offline shady

  • Beta Testers
  • Hero Member
  • *****
  • Posts: 1326
  • Karma: +11/-0
  • This monkey knows his Window Coverings!
Re: PLUGIN: Wink Hub Controller
« Reply #41 on: January 19, 2015, 11:36:59 pm »
once the Wink "phones home" the root exploit will be removed.

Not exactly correct...

If you do the root exploit and follow it as instructed, the Wink hub will not "phone home" and will not update its firmware, so you will not lose the "root:... But you will also not be able to use the Wink API (or the IOS/Android app)... This is because the exploit as documented blocks the hubs access to the firmware update servers AND the wink API server AND the Wink API server requires the firmware on the hub be updated beyond the initial firmware. So if rooted, the hub will not be controllable remotely...

If you root the hub, you can then update the firmware manually and keep the root. If you then unblock the API server, you have a rooted hub that will not update its firmware automatically with API access.

Thank you, I discovered that this was possible after posting.  The easiest root exploit is available when it is fresh out of the box .33 as described here:
http://www.rootwink.com/viewtopic.php?f=8&t=8
Then I guess I'd follow the code posted at here to disable its access:
http://forum.xda-developers.com/showpost.php?p=58002647&postcount=84
And if any ssh'ing issues:
http://forum.xda-developers.com/showpost.php?p=58011855&postcount=87

I will try to keep it completely isolated from the internet until I think I have followed one of many available tutorials to preserve root access through the manual firmware upgrades.
Vera3 1.5.346, Schlage (3)DB (2)Lever, Kwikset (1)Lever, RCS TZ43 Thermo, (2) Vizia RZI06-1LX 600W Dimmers, (17) Monster (Leviton) Dimmers (6) Monster (Leviton) IWC Scene Controllers (1) Etherrain-8, (3) HSM 100's (1)GE 3-Way set

Online cybrmage

  • Moderator
  • Hero Member
  • *****
  • Posts: 1068
  • Karma: +106/-5
Re: PLUGIN: Wink Hub Controller
« Reply #42 on: January 20, 2015, 05:39:52 am »
The easiest root exploit is available when it is fresh out of the box .33 as described here:

Fresh out of the box, the Wink Hub is at firmware version 00.00... (the current firmware is 00.56)

The only things that the links you posted miss are:

 - edit /etc/default/dropbear to remove the "-sg" from the DROPBEAR_ARGS... these parameters prevent dropbear from accepting a password login (meaning only accept a certificate based login) and prevent a password login for root...

Ideally, the DROPBEAR_ARGS should now be "DROPBEAR_ARGS=-B", to allow password logins and allow password logins for root and allow blank passwords (now that the root password is blank. This gives a "backup" way to gain a root shell in case you misplace your login certificate.

Once you have exploited the hub and have a root login with your own certificate and copied the authorized_keys to /database and created the ENABLE_SSH file, you should never lose the root.... (until they remove the ability to use SSH completely).

Also, the wink hub will not automatically update its firmware... at least not currently... The update is (currently) only performed when you select update in the app, when the app prompts that a firmware update is required... There is also a bug in the wink app that does not allow any control of any device when any hub attached to the account requires an update...

With previous firmware, the need to update the hubs was not reflected in the device status reported by the API... The API now reports that the hub firmware needs updating... A future update to the plugin will incorporate this information so that it is obvious why your devices stop functioning.

EVL3Vista - Wink Connect - Caseta Connect - Venstar Colortouch - WiFi UDP Switch Controller - Broadlink RM - MyQGateway

Offline seanh

  • Sr. Newbie
  • *
  • Posts: 40
  • Karma: +0/-4
Re: PLUGIN: Wink Hub Controller
« Reply #43 on: January 20, 2015, 03:15:15 pm »
@cybrmage - As an FYI, I think you do need to have a Wink controller for this plugin to work.  I had previously purchased a Wink Hub, but returned it shortly after seeing its shortcomings.  I still have a Wink account with the Wink app on my phone which shows and I can control my Nest and MyQ.  I installed the wink plugin - again with the hopes of better integrating my Nest into Vera.  Once the app is installed, and it is going thru the detection process and get message no hub detected and the app shows unconfigured.  This weekend I will pick up a hub and try again and will update you with the results.

Offline ckohouse

  • Newbie
  • *
  • Posts: 13
  • Karma: +0/-0
Re: PLUGIN: Wink Hub Controller
« Reply #44 on: January 20, 2015, 03:37:33 pm »

First off... Do you have un-named devices on your Wink Hub???

second: The IOS app??? what IOS app??? What switch??

third... both logs show the same error, just at different times...  There is nothing in the log showing any action being commanded or performed, so I can't even start to look into that issue...

I did make changes for fix the error in the logs...

1. I do have a second switch that cannot be deleted in Wink and I am not using. The switch was successfully created in Vera, but maybe not fully. I have contacted Wink support and they are trying to delete for me from Wink. I will assume that this is the issue until (if) wink can resolve the issue.
2. The apple IOS Vera mobile app (UI7). I looked at this some more. It appears that the app is not updated when the light is turned on and thus does not turn off. i.e. does not show the light on.  Maybe a vera problem??  No log generated on the attempt to turn off the light.
3. OK - Same issue as #1 - my bad on reading the logs.

The last file works great (.11g)