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

Offline ckohouse

  • Newbie
  • *
  • Posts: 13
  • Karma: +0/-0
Re: PLUGIN: Wink Hub Controller
« Reply #15 on: January 14, 2015, 02:24:48 pm »
I have a Startup Lua Failed error, but it does show that I am logged in.  I also noticed that my install is version .9 and I cannot select auto-update.

More details (copy of log output - showing the failure) would be helpful.

You can't auto-update, because there is nothing to update to... V0.10 is still pending approval... Once approved you will be able to update to it...

Below are the log entries.  Thanks!

Code: [Select]
50 01/14/15 11:59:05.725 luup_log:22: (Wink_Hub::Wink_Hub_Startup): Quirky Wink Hub Automation Gateway - Plugin version [0.9 Wink] - isDisabled [0] __LEAK__ this:4096 start:1085440 to 0x10fb000 <0x2bb8a680>
50 01/14/15 11:59:05.725 luup_log:22: (Wink_Hub::getVariable) variable [PluginVersion]. <0x2bb8a680>
50 01/14/15 11:59:05.725 luup_log:22: (Wink_Hub::getVariable) Got PluginVersion [0.9 Wink]. <0x2bb8a680>
50 01/14/15 11:59:05.726 luup_log:22: (Wink_Hub::setVariable) SID [urn:micasaverde-com:serviceId:Wink_Hub1] variable [PluginVersion] value [0.9 Wink]. <0x2bb8a680>
50 01/14/15 11:59:05.736 luup_log:22: (Wink_Hub::connectToWinkAPI): Connected to the Wink Hub API Server. <0x2bb8a680>
06 01/14/15 11:59:05.738 Device_Variable::m_szValue_set device: 22 service: urn:micasaverde-com:serviceId:Wink_Hub1 variable: Hub_Token_Timestamp was: 1421202933 now: 1421202933 #hooks: 0 upnp: 0 skip: 0 v:(nil)/NONE duplicate:1 <0x2bb8a680>
50 01/14/15 11:59:05.738 luup_log:22: (Wink_Hub::Wink_Hub_Startup): connectToWinkAPI succeeded. <0x2bb8a680>
01 01/14/15 11:59:07.147 LuaInterface::CallFunction_Startup-1 device 22 function Wink_Hub_Startup failed [string "-- Wink_Hub..."]:1098: attempt to index local 'text' (a nil value) __LEAK__ this:372736 start:1458176 to 0x1156000 <0x2bb8a680>
01 01/14/15 11:59:07.147 LuImplementation::StartLua running startup code for 22 I_Wink_Hub1.xml failed <0x2bb8a680>
50 01/14/15 11:59:19.101 luup_log:5: InitD: 1421241382 : 1421258359 : 1421275481 __LEAK__ this:49152 start:1507328 to 0x1162000 <0x2c98a680>

Offline cybrmage

  • Moderator
  • Hero Member
  • *****
  • Posts: 1007
  • Karma: +99/-5
Re: PLUGIN: Wink Hub Controller
« Reply #16 on: January 14, 2015, 06:38:34 pm »
Try this lua file (it is version v0.11)...

Uploaded it to your Vera using "Apps"/"Develop Apps"/"Luup Files" and then reload the LuaUPnP engine.

(FAULTY attachment removed)
« Last Edit: January 15, 2015, 12:35:56 pm by cybrmage »
EVL3Vista - Wink Connect - Caseta Connect - Venstar Colortouch - WiFi UDP Switch Controller - MyQGateway

Offline cybrmage

  • Moderator
  • Hero Member
  • *****
  • Posts: 1007
  • Karma: +99/-5
Re: PLUGIN: Wink Hub Controller
« Reply #17 on: January 14, 2015, 08:39:21 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.

As a note, the as-shipped firmware is really bad for device support, and the crude local interface is almost unusable for device control... there is also no easy way to pair devices without the Wink API and IOS/Android app.

I do have two Wink Hub for development purposes and plan to try to develop something for local control of a rooted hub, if time permits...

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

Offline ckohouse

  • Newbie
  • *
  • Posts: 13
  • Karma: +0/-0
Re: PLUGIN: Wink Hub Controller
« Reply #18 on: January 15, 2015, 10:32:35 am »
Try this lua file (it is version v0.11)...

Uploaded it to your Vera using "Apps"/"Develop Apps"/"Luup Files" and then reload the LuaUPnP engine.

Thanks for the file. The "LUA engine failed to load".  From the log, I found:
01   01/15/15 9:25:24.723   LuaInterface::LoadCode: [string "-- Wink_Hub..."]:2331: 'end' expected (to close 'function' at line 145) near '' <0x2ad18000>

Offline cybrmage

  • Moderator
  • Hero Member
  • *****
  • Posts: 1007
  • Karma: +99/-5
Re: PLUGIN: Wink Hub Controller
« Reply #19 on: January 15, 2015, 12:33:15 pm »
The "LUA engine failed to load".

And thats what happens when I make changes when I dont have access to my Vera for testing... 8-}

This should fix it...
EVL3Vista - Wink Connect - Caseta Connect - Venstar Colortouch - WiFi UDP Switch Controller - MyQGateway

Offline ckohouse

  • Newbie
  • *
  • Posts: 13
  • Karma: +0/-0
Re: PLUGIN: Wink Hub Controller
« Reply #20 on: January 15, 2015, 02:16:19 pm »
Nice work. The engine loads and a new switch is created (Lutron dimmable).  However, the new switch generates an error and does not toggle the light.
01   01/15/15 13:10:11.607   LuaInterface::CallFunction_Startup-1 device 22 function Wink_Hub_Startup failed [string "-- Wink_Hub..."]:2001: attempt to concatenate local 'hubId' (a nil value) __LEAK__ this:528384 start:1880064 to 0x109d000 <0x2c15c680>
01   01/15/15 13:10:11.607   LuImplementation::StartLua running startup code for 22 I_Wink_Hub1.xml failed <0x2c15c680>

Offline Bojangles

  • Sr. Newbie
  • *
  • Posts: 28
  • Karma: +1/-0
Re: PLUGIN: Wink Hub Controller
« Reply #21 on: January 15, 2015, 03:11:31 pm »
Does the app recognize the Spotter as one of the child devices and controlled by Vera.

Offline osmosis

  • Full Member
  • ***
  • Posts: 121
  • Karma: +3/-1
Re: PLUGIN: Wink Hub Controller
« Reply #22 on: January 15, 2015, 04:30:11 pm »
Does the app recognize the Spotter as one of the child devices and controlled by Vera.

Mine does not.  But I have found out that the spotters are kinda weird.  The spotters are wifi and do not connect to the hub it seems.  I found this out when I had to delete my hub and tried to reset everything wink to square one.  I "reset" the hub in the app, and completely unplugged it.  There was no hub listed in my wink app.  The spotters still work fine.  I left the hub unplugged for over 24 hours and still got all my spotter notifications via the wink app.  I can program the spotters without a hub also.  Once the spotters are on your network, they communicate directly over wifi.

I also can't see the wink lights in apps like homewave, but that could be operator error as I am just figuring out homewave.

Offline cybrmage

  • Moderator
  • Hero Member
  • *****
  • Posts: 1007
  • Karma: +99/-5
Re: PLUGIN: Wink Hub Controller
« Reply #23 on: January 15, 2015, 05:16:14 pm »
Nice work. The engine loads and a new switch is created (Lutron dimmable).  However, the new switch generates an error and does not toggle the light.

Strange... The Lutron dimmers were devices I actually tested the plugin with...

The section of code involved enumerates the Vera child devices and matches them against the devices reported by the hub... So either the device list returned by the Wink Hub is missing some data, has changed format or something else completely...

Can you go to the setup page for the Lutron Dimmer device, go to the Advanced tab and check the ID parameter... it should be similar to "Wink_123456_123456"...

Also, can you go to the settings page for the hub devices, click on "Debug" to turn on debugging output then do a reload and post the section of the log before the error that start with "(Wink_Hub::findChildDevices): testing device" and before that "(Wink_Hub::HUB_DEVICES::getDeviceList): processing device" for the device. I need to see what the Wink API is sending as the device definition and the results of processing that definition into a vera device. Thanks

Does the app recognize the Spotter as one of the child devices and controlled by Vera.

Mine does not.  But I have found out that the spotters are kinda weird.

I do not have any spotters, so I have not been able to add support for them.

Although the spotters are not attached to a hub, they are attached to your Wink API account... The plugin uses the Wink API to get device information, so if someone can provide the data format that the Wink API provides for the spotter, i should be able to add support for it...

If someone wants to provide the required data, enable debug mode and then do a reload. then post the section from the log that starts ""(Wink_Hub::HUB_DEVICES::getDeviceList): processing device" for the spotter device.

If anyone has additional devices that are not supported - provide the appropriate data and i'll try to add support.

I also can't see the wink lights in apps like homewave, but that could be operator error as I am just figuring out homewave.

The lights should show up in any mobile app, as they use the same device type in vera as any other binary light light or dimmable light. You may need to refresh the configuration in the mobile app before they will show up... If that is not the case, let me know and I will try to track down the problem (eventually... when I have my toys set up in the new house...)
EVL3Vista - Wink Connect - Caseta Connect - Venstar Colortouch - WiFi UDP Switch Controller - MyQGateway

Offline ckohouse

  • Newbie
  • *
  • Posts: 13
  • Karma: +0/-0
Re: PLUGIN: Wink Hub Controller
« Reply #24 on: January 16, 2015, 10:07:34 am »
Can you go to the setup page for the Lutron Dimmer device, go to the Advanced tab and check the ID parameter... it should be similar to "Wink_123456_123456"...

Also, can you go to the settings page for the hub devices, click on "Debug" to turn on debugging output then do a reload and post the section of the log before the error that start with "(Wink_Hub::findChildDevices): testing device" and before that "(Wink_Hub::HUB_DEVICES::getDeviceList): processing device" for the device. I need to see what the Wink API is sending as the device definition and the results of processing that definition into a vera device. Thanks
I do have an ID parameter -->  WINK_dimmer_30278_80198

The Debug toggle on the Wink device fails [ERROR: device not ready]. Below is the log (btw-I am on UI7)
08   01/16/15 9:01:34.191   JobHandler_LuaUPnP::HandleActionRequest device: 22 service: urn:micasaverde-com:serviceId:Wink_Hub1 action: ToggleDebugMode <0x2e310680>
08   01/16/15 9:01:34.191   JobHandler_LuaUPnP::HandleActionRequest argument DeviceNum=22 <0x2e310680>
08   01/16/15 9:01:34.191   JobHandler_LuaUPnP::HandleActionRequest argument serviceId=urn:micasaverde-com:serviceId:Wink_Hub1 <0x2e310680>
08   01/16/15 9:01:34.191   JobHandler_LuaUPnP::HandleActionRequest argument action=ToggleDebugMode <0x2e310680>
02   01/16/15 9:01:34.192   Device_LuaUPnP::HandleActionRequest 22 not ready 0xc8b218 <0x2e310680>
02   01/16/15 9:01:34.192   JobHandler_LuaUPnP::RunAction device 22 action urn:micasaverde-com:serviceId:Wink_Hub1/ToggleDebugMode failed with -911/Device not ready <0x2e310680>
« Last Edit: January 16, 2015, 02:27:12 pm by ckohouse »

Offline cybrmage

  • Moderator
  • Hero Member
  • *****
  • Posts: 1007
  • Karma: +99/-5
Re: PLUGIN: Wink Hub Controller
« Reply #25 on: January 16, 2015, 08:50:55 pm »
I do have an ID parameter -->  WINK_dimmer_30278_80198

That's a good sign...


The Debug toggle on the Wink device fails [ERROR: device not ready]. Below is the log (btw-I am on UI7)

And that's not so good but ok... It means that the plugin is not running (which we pretty much already knew), so we know that the device is configured and the Hub API data is ok...

Try the attached update...
EVL3Vista - Wink Connect - Caseta Connect - Venstar Colortouch - WiFi UDP Switch Controller - MyQGateway

Offline ckohouse

  • Newbie
  • *
  • Posts: 13
  • Karma: +0/-0
Re: PLUGIN: Wink Hub Controller
« Reply #26 on: January 17, 2015, 02:06:30 pm »
Still not it. It looks like the same start up error as before.

LuaInterface::CallFunction_Startup-1 device 22 function Wink_Hub_Startup failed [string "-- Wink_Hub..."]:583: attempt to concatenate local 'devId' (a nil value) __LEAK__ this:409600 start:1761280 to 0x116e000 <0x2be2c680>
01   01/17/15 13:03:29.148   LuImplementation::StartLua running startup code for 22 I_Wink_Hub1.xml failed <0x2be2c680>


Offline cybrmage

  • Moderator
  • Hero Member
  • *****
  • Posts: 1007
  • Karma: +99/-5
Re: PLUGIN: Wink Hub Controller
« Reply #27 on: January 17, 2015, 02:56:10 pm »
Still not it. It looks like the same start up error as before.

Same error... different location...

This version MAY be it...

If it isn't... please provide logs going back to the plugin startup...
« Last Edit: January 17, 2015, 02:57:44 pm by cybrmage »
EVL3Vista - Wink Connect - Caseta Connect - Venstar Colortouch - WiFi UDP Switch Controller - MyQGateway

Offline ckohouse

  • Newbie
  • *
  • Posts: 13
  • Karma: +0/-0
Re: PLUGIN: Wink Hub Controller
« Reply #28 on: January 17, 2015, 04:32:56 pm »
This version MAY be it...
This version is IT!   It is working ;D ;D

The Lutron caseta with pico remote are great for table lamps.  A new realm of possibilities. Thanks for your effort and persistence.

Offline bweaver9

  • Newbie
  • *
  • Posts: 1
  • Karma: +0/-0
Re: PLUGIN: Wink Hub Controller
« Reply #29 on: January 17, 2015, 04:54:53 pm »
Is Support for Scenes based on wink devices planned?

I have created a scene with one of my Wink devices as a trigger. However the scene never gets triggered.