[BETA] Wink Relay - Custom SmartThings Integration

The update now works in the updated Smart Things App. Nice work! I still am not sure how to control the switches separately using Alexa. I am unsure if there is something else I am missing here or if it is even possible.

Also updated to the latest version of the app. Looking great and also excellent work.
Only issue I am having with the latest 1.0 version is the proximity sensor update takes a long time to work. No huge deal here but thought I would let you know if that is coming in the next iteration.

Again, amazing work. I am still in amazement that this app wasn’t in development for two years and you hopped right back to it when wink users were in trouble. Bravo sir.

1 Like

The button presses are instant / reactive events, but the sensors poll every 0.5 seconds. I didn’t want to go much faster than that as I found that the Wink Relays are quite finicky.

In fact, when I added in the proximity based backlight trigger, I had to rework some of the logic to share the trigger and backlight timeout with the touch input… and when I did, I found that the Wink Relay was crashing much more frequently, so I had to add some throttling that only triggers the screen-on at most every 1 second. Otherwise the device would get overwhelmed and crash.

(This is ‘leading edge’ which means it triggers as soon as it receives the first value over the threshold, but as noted above that would be at least 0.5 seconds between each poll)

Perhaps at some point I can revisit the approach used for the sensors and see if there’s anything else that can be done there. At this point, I figured 0.5 seconds was ‘good enough’… and I still feel like there’s a fundamental issue with the proximity detection and the values. As Tony mentioned in the Hubitat community, his proximity values seem to drift quite a bit and his suspicion is that there might be other factors Wink used since the wake on motion seemed to work well when it was running the OEM Wink App.

1 Like

Not surprised about that crashing when doing a poll above every .5s. I wouldn’t be surprised if the N64 had a better clock than this thing lol. I could see those values drifting dependent on time of day or light in a room as well. I would love to get my hands on the edison.zip file one of these days and take a look at how they pulled it off. That might be a project for me after I get off work lol.

Also if anyone is interested in some scripts to do most of the software installs for you let me know. It cut down the cracking time from an hour plus each to about 30 minutes with little user intervention.

Thank you!!! I found them in there! I thought they would be with switches…duh!

That adds the sugar to this already sweet deal!

Appreciate the help!

One more thing, if the button for the Scene is set to “do nothing event only” the physical button wont work.

Thanks again @joshua_lyon!!!

Ended up figuring out a workaround to get the top and bottom switches to work independently and also have them enabled in Alexa.

I created a Virtual or “Simulated Switch” in the smart things IDE. FAQ: Creating a virtual Device

This switch is going to allow this to communicate with Alexa.
Using the new app I pressed the (+) button on the top right and created a Smart Lighting automation. I then followed the steps on screen to mirror the new virtual switches I created.

Note: Just did this and they are working great. One thing I noticed is if I turn on a light by the switch the new virtual switch did not update in the app. I fixed this by making sure I had both Wink Relay (switch x) and Virtual switch in both directions for mirroring. For example:

  • Smart lighting 1 - Wink Relay Switch 1 - Virtual Switch 1
  • Smart lighting 2 - Virtual Switch 1 - Wink Relay switch 1

This should fix any weirdness that is going on. It is kind of a hacky solution but it works until I can find something better.

2 Likes

Thanks so much!

you run adb commands directly from your laptop to the relay?

I am just getting connection denied when trying to connect to my relay on port 5555… also unable to get into the android home screen

Sucks but i’ve been there too and I had to reset and start over. Make sure ADB is enabled before you do any updates from the wink network.

To troubleshoot ADB, make sure you ping the IP address before trying to connect to make sure it is online. Also if it doesn’t work make sure you uncheck and recheck the USB debugging option, reboot and try again.

I never rooted this before and did not have ADB running… I guess I cannot root it now although I find that not likely since they would still want a way to allow developers to login.

Did you try the steps recommended above:

yeah I tried those steps and after it “factory resets” my network is still connected to, so something is screwed up there where it is not clearing some data…

Log out of the wink relay 1st party app then wipe cache. Then factory reset.

With the ending of free wink coming soon, is there a way to update without their servers? It just occurred to me that this might be an issue in the near future. Also if I did not log out of the device before I disabled the app I think I should be good right?

Here’s what I wrote over in the Hubitat community:

Several people in the Hubitat community have transitioned over to the custom STWinkRelay integration without running through the updates.

I think Wink might have changed the default resolution in one of the updates… not sure what else they might have changed, but it looks like you should at least be able to still use the units even without the Wink updates. I guess we’ll see for sure here soon. :stuck_out_tongue:

You might be running into the ‘Groundhog Day’ state that some of us have experienced. It’s like the Wink Relay takes a snapshot at some point in time and anytime you reboot, it goes back to that snapshot. It’s not the end of the world if you’ve already at least got the basics done so you have access to the underlying Android OS, but it’s an issue if it snapshotted itself on a newer Wink Update before you were able to factory reset and make the necessary tweaks. :confused:

Version 1.1.0 of the STWinkRelay APK was released last night:

If you are already on version 1.0.0 from the day prior, you should be able to use the built-in update utility within the app from Settings > System > Update App.

:information_source: For anyone on an older version, refer to the instructions in this post.

This version includes the following improvements:

  • Added a Backlight Timeout option which can be used to set how long the system waits before it turns the backlight off (in seconds).
  • Added a Motion Only option for the backlight trigger
    • Someone reported that their touch screen was wonky and potentially reporting ghost touches
    • :warning: Make sure to set the Proximity Threshold to a reasonable value.
      If you get stuck, you’ll either have to put your finger directly on the sensor to trigger a high proximity value, use the screenBacklightOn() command on the device via SharpTools.io / WebCoRE, or factory reset.
3 Likes

Joshua, @joshua_lyon
Amazing instructions and thanks for making this available! Instead of throwing away my Wink Relay I now have two functioning controllers! Amazing!

Michael @mbell35
I am trying to figure out how to see the two switches of my Wink Relay as individual switches in the new Smarthings app, assign them actions (e.g. turn all lights off) and also how to activate them through Alexa.
I am completely new to SmartThings, just switched from Wink.

I created the “Simulated Switch” following the instructions you linked, but have no idea how to associate this simulated switch with the actual switch on the wink relay.

When I look at the Wink relay device I can see two switches (Wink Relay (Switch 1) and Wink Relay (Switch 2) in the “child devices” section and I can activate them when I click into the Wink Relay item on the SmartThings app.

I tried creating an “Automation” (not sure if that is different from the “smart lighting automation” you mention), but I can’t select the individual switch in the automation.

As devices I only see the “Wink Relay”. Basically in the automation I do:

  • If
  • click on +
  • select “Device status”
  • list of devices shows up, but only has the “wink Relay”, which if I click on it has one “on” and one “off” selection.

I know I am missing something. It would be great if you could point me in the right direction of maybe post a bit more detail on how you achieved the integration and individual switches.

I just played around with ActionTiles and SharpTools. Both can see three switches per Wink Relay (Wink Relay, Wink Relay Switch 1, Wink Relay Switch 2). Just not showing up in SmartThings app.

Basically I would like to achieve the following:

  • In the SmartThings app have one “device” for each button on the relay, that will make it easier to just find the button instead of tapping on the entry for the relay, then on the button within the “relay”
  • be able to activate these buttons using Alexa
  • assign the buttons to a different action. I have two Wink relays and only one of the total 4 buttons controls a load physically connected to the Relay. With Wink I used to use the other three buttons for other actions (e.g. turn off all lights on one of them).

Thanks

Andreas

@joshua_lyon,
First of all, thanks a ton for being such an amazing and supportive developer! I’m another Wink refugee and was so excited to see that you had put together a well documented solution for salvaging my relay :slight_smile:

I’m 99% of the way to a working setup, and I am hoping that you can help me figure out how to get that last 1%. I’ve got your latest app installed on my rooted wink relay, the OEM app disabled, and all services appear to be running (I just uploaded logs for device 60674e7d20a97b7d). I have the app and two devices saved and published in the smartthings IDE (originally I had the app published as the main device, similar to @rahulneel , but then deleted and replaced that device with the correct device definition and deleted the useless relay device that showed up in my new smartthings app).

My problem is that the SmartThings classic app is unable to ‘find’ my wink relay when searching for the device. I can access 192.168.0.104:8080/device.xml from my phone and laptop, but even when using direct IP manual discovery the classic smartthings app cannot find my device. In both cases I have waited at least 10 minutes.
IDE log from auto discovery: https://pastebin.com/bXWEpjAL
IDE log from manual discovery: https://pastebin.com/FCQiMrdX
I have tried restarting the relay by pressing the little button underneath it, but the problem persists.

Do you have any ideas for things I can try, or things I might have done wrong? Thanks again for being so responsive to everyone on this thread!