Wink Relay Integration with SmartThings

Hi all,

I have had a lot of fun trying to integrate the Black Friday special that wink.com had for the Wink Relay ($30 each so I bought two of them) and they’ve been fairly easy to hack and customize to my desires. If all else fails, reset and you’re back to scratch. Below are my complete notes on how to make this talk to SmartThings, MQTT, IFTTT and Home Assistant. Please see this page for step-by-step guides on some if not most of the steps below: ThingsThatAreSmart.wiki

FACTORY RESET
Hold top button on the Wink Relay and press the small reset button located directly below the middle of the screen but behind the clear plastic. After the reset, let go of the top button. Doing the factory reset takes the Wink Relay back ALL THE WAY and removes any of the updates. This is a great way to restart everything. First is to run Wipe data/factory reset and afterwards Reset to Factory Image.

AFTER FIRST BOOT
Connect to wifi obviously. Put your finger over the proximity sensor (black oval on top of screen) then press and hold bottom button on the Wink Relay for about 30 seconds. The relay will flicker a few times and you will be taken to the standard Android home screen. At that point change the two very important settings. Settings->Security->Unknown Sources and put a check mark there. Then Settings->About and click Build Number many times. After enabling Developer Options, back up to Settings->Developer Options and uncheck then re-check USB Debugging. After this, you can connect to the Wink Relay via ADB. Try the following:
adb connect 192.168.0.33
or
adb connect 192.168.0.33:5554

You can always bring up the Launcher or Settings via ADB using:
adb shell am start -n com.android.launcher/com.android.launcher2.Launcher
adb shell am start -a android.settings.SETTINGS

After connecting is when you can do the following to install all the apps you want to. You can do that via the browser and apkpure.com or better & faster via ADB:
adb install c:\apks\Multi-action Home Button_2.2.7.apk

If you do an update (by logging into your Wink account on the Relay), just come back to Settings->Developer Options and check the “USB debugging” which was disabled in the upgrade. Recommending to upgrade all Wink stuff at least after installing a few key APK’s. Home button replacement/emulation, Launcher, BusyBox and Kingroot are the key 4 pieces.

The following set of applications should be considered:
Multi-action Home Button or Soft Keys Home Back Button (for Home button or soft-keys depending on desire)
Apex Launcher or Assistive Touch for Android (launcher for Android)
Firefox & Chrome Browser
Quick Reboot
BusyBox
ES File Explorer
ES Task Manager
Fancy Widgets
Google Maps
Root Checker
Disable Application or App Disabler
SmartThings
Wink
Sensi, Nest
TinyCam
Amcrest, MyDLink Lite, etc.

ROOTING THE WINK RELAY
Kingroot is the way to go. However, I had a desire to switch to the old reliable SuperSU but kept getting “su binary occupied” error when updating the binary via SuperSU. I found this thread which helped me to get rid of Kingroot and replace it with SuperSU. I’ve tried many methods and this one definitely works: here or here
I used the MRW scripted method rather than SuperSU-Me (but may end up testing it soon). After that, I updated to latest SuperSU and was able to update the binary with ease. The key was to realize that CHMOD does not work for some reason under /sdcard/mrw so I copied the mrw folder to /data/mrw then CHMOD 777 root.sh file with ./root.sh and finished without issues.

GOOGLE PLAY SERVICES
This was nice and exciting until the Google account kept being removed so it was a race against time to get all I want from Play Store before my account info disappeared. So it wasn’t really worth the hassle. Here’s the thread.

FINAL STAGE OF CONNECTING WINK RELAY TO SMARTTHINGS
For this I used IFTTT and it works great. First step is to install a Device Handler that I created (switch that toggles rather than stateful on/off swiches, which is essentially how the Wink Relay functions). After adding the Device Handler, create a new device and use the new handler for it. Provision the ST IFTTT SmartApp to have access to that new/fake switch. On the Wink Relay create two “shortcuts” to power on and power off the desired Wink Relay button. Obviously connect to both Wink and SmartThings via IFTTT. Then create 3 recipes in IFTTT. If Wink Button pressed then turn on or off (on & off do the same thing anyway) the fake ST button. Then create two more for SmartThings, if button is ON then run the Wink Shortcut for ON. Do the same for off.

I also have Home Assistant and MQTT (using smartthings-mqtt-bridge) enabled so I do indeed use WebHooks channel and call the IFTTT service via Home Assistant automations. However, the same can be achieved via SmartThings CoRE or even Wink Robots.

HOME ASSISTANT
The white Home Assistant dashboard is very bright at night on the Wink Relay. Try using Firefox with color reversal achieved via one of these Add-ons: Night Reader for Firefox or Dark Background and Light Text. Don’t forget to pin your page using the sandwich on top right, page, add to home screen. Each Wink Relay got its own tab with exactly what I want for the Relay to show.

DEVICE HANDLER FOR WINK BUTTONS
The device handler tries to detect “duplicate” calls because that can cause some issues on a momentary/toggle/stateless switch. So there is an option in the handler where you can say how many seconds between calls. Default is 10 seconds to ignore subsequent calls.

Good luck and let me know if you have issues… do expect the answer to be “do a factory reset” at times :slight_smile:

6 Likes

there’s a hacked version of the relay’s wink app. the original one clears stored app data of non-wink apps about once an hour or so

Got it, you da man :slight_smile: I knew there was a reason why I saw the hacked app but never saw the reason so didn’t bother using it. I’ll update the notes to include that… awesome, thanks for the tip, trying it out! This also explains the “weirdness” in general with SmartThings account not sticking around, etc.

To be honest I don’t use ST on the Wink Relay. Just in case the unit gets stolen, it’s the entire house that comes along with it if ST is installed. I just use Home Assistant and created a tab per Wink Relay with exactly what I needed to see. One of my pet peeves with the ST app device provisioning (lack there of) and absolutely no native dashboarding.

:joy: … That’s quite a scenario - A burglar ripping your Wink out of the wall in order to subsequently hack your home’s SmartThings???

Regardless, if you use ActionTiles, simply changing your ActionTiles Account password will disable access of all other connections within minutes.

Or just uninstall the “ActionTiles V6 Connect” SmartApp to instantly disable ActionTiles for your Location / Hub.

1 Like

Paranoia :slight_smile: just trying to plug all of the possible gaps. I’m assuming burglars are smart enough to know how to even work the Wink Relay :slight_smile: but making it super easy to use with a full featured launcher doesn’t help to secure the Wink. My kids can use the hacked version by the time I’m done customizing it… I’ve been trying to find a good remote-wipe app but lacking location abilities in the Wink Relay is not making it easy on me.

Don’t get me wrong, I like ActionTiles and have seen it come up. However, there is a cost… Secondly, it ties me further into SmartThings while Home Assistant does not and achieves 99% of my desires. I have nightmares of the day when my hub v2 dies and hence the reason to diversify a bit away from ST.

1 Like

Hey @lordorwell sadly the device fails connectivity when opening that hacked APK and trying to register the device with Wink services “please wait while we finish configuring your device”. Hack was obtained from ThingsThatAreSmart.wiki.

Hi JZ, Thank you for working on this. I followed your instructions on integrating the two switches with IFTTT and I get this error:
groovy.lang.GroovyRuntimeException: Ambiguous method overloading for method java.lang.Long#minus.
Cannot resolve which method to invoke for [null] due to overlapping prototypes between:
[class java.lang.Character]
[class java.lang.Number]
I copied the device handler code and created my own device, I hope I did it correctly. There was no option of updating it from your repo.
I’m a newbie, so any advice is appreciated.
Cheers.

How is this different from what’s already been done in the 6+ threads you linked to this post from? It sounds like it still fundamentally relies upon IFTTT. Is it the switch handler which handles some basic de-duping of events?

@joshua_lyon yep there was no de-dupe momentary ST switch handler anywhere so that was the bigger contribution… unless you can point out a sample that does de-duping, which I obviously didn’t find :slight_smile: but looked plenty, I promise. I’m also putting together what I feel is optimal for the Wink Relay. Not asking for folks to agree but hoping it helps somebody from researching for hours. Lastly, I bring in Home Assistant into the picture which is not documented anywhere in this context. It runs very nicely on the Relay with FireFox & inverted colors.

The only other alternative piece I’ll document above is the removal of Wink Relay software and replacing with pure MQTT as I’ve seen out there. I keep my posts up to date and literally use them as guides myself when setting up a new device from scratch. The goal is not to regurgitate scattered info from all over the web but to organize it a bit in a consumable format.

The deduped events in the switch handler is nice - great work with that. I was just surprised to see this cross-posted in 6+ Wink Relay threads as the much of the instructions were already in those threads.

The ThingsThatAreSmart.wiki that you linked to in your response to @lordorwell has a lot of the information about getting the Wink Relay setup including rooting, installing apps, disabling the built-in apps:
http://thingsthataresmart.wiki/index.php?title=Wink_Relay

Perhaps adding a section to that wiki around options for integrating with SmartThings would be helpful? It sounds like most people are currently either using IFTTT or Stringify as a bridge and you are taking a similar approach, but with the addition of your custom handler. Keeping it in the wiki is especially helpful since you’ll lose the ability to edit your original posts overtime as it seems like you’ve run into with your other projects (which look great, by the way!).

1 Like

Damn, you make a great point :slight_smile: totally forgot that they lock you out of your original post. That’s why I love XDA — but who doesn’t.

The reason for cross posting is because it applies to things within those longs posts that never really got answered. Folks wanted simple and I think this is as simple as it gets. I just wish the older/hacked Wink Relay worked as others have mentioned. That would make this device completely unlocked.

1 Like

What do you mean?

Installing the “hacked” Wink Relay app per the Wiki I mentioned does not seem to work anymore. That hacked APK stops the Wink Relay app from erasing other app data like Google Play Services and SmartThings credentials & app data.

@Krakonosh you are 100% right. Please go to GitHub and obtain the latest code. That’s what I get for testing & developing. I installed a new device from scratch and had identical problem as you. Now I simply default some non-null value into fields where I expect to find some value. Give it a shot and let me know how it goes.

1 Like

Thanks JZ, the new code works perfectly.

@JZst I put together a custom integration for Wink Relay that you might be interested in. It runs completely on your LAN so it’s super fast in updating state from the Wink Relay into SmartThings and in controlling relays. Check it out at:

3 Likes