[OBSOLETE] Wink Relay - Custom SmartThings Integration

Yes, I messaged you so as to not clutter the thread.

2 Likes

Any update of when you are gonna roll out the update?

Are you asking me when will then be now?

I just pushed STWinkRelay 0.3.0a to the update server.

You can navigate to Settings > General > Update app. If you have network connectivity, it should find the the newest version and enable you to download/install it. Remember to open the app at least once after the install to get the services started again.

WARNING: I have not been able to test this release as thoroughly as I would like since my Wink Relay is on the fritz. I would strongly encourage you to make sure ADB debugging is enabled before you disable the OEM app - that way you have a fallback if anything goes awry.

This release includes the following features:

  • OEM Disabler
  • Dark Theme
  • Fixed button press events (correct button IDs)
  • Touch screen or buttons to turn on
  • Automatically turn off after 15 seconds of no touch/button presses
  • Map top button / bottom button to:
    • Do Nothing (Send Events Only)
    • Toggle Relay 1
    • Toggle Relay 2
  • Add HTTP mapping to remotely turn the LCD backlight on/off
3 Likes

Good job! Looks like it’s working fine to me. The buttons are registering correctly and control the relays. Love the dark theme too! Thanks for all your hard work. Sorry to hear about your Wink Relay having problems though.

1 Like

Thanks for the feedback. Glad to hear that the initial results are positive.

My concern is more with the long-term. Android has a built in memory management feature which attempts to kill apps/services when the device needs to free up memory. My concern is that the STWinkRelay services will all be working as expected and turn the LCD backlight off as expected and then Android could kill the services which would prevent the screen from turning back on. The workaround would be a simple reset with the physical button below the screen (or ADB to relaunch the app). I added in some code to promote the services to be foreground services which would normally make it extremely unlikely that Android would kill the app, but the Wink Relay is a pretty resource constrained device so it wouldn’t surprise me! If the issue does crop up I think the next step would be make the STWinkRelay app a system app.

3 Likes

Using this app, can I make the bottom button, which is not connected to any load, trigger a ST routine or device? If so, how?

Yes, the button events are always sent over to SmartThings even if you don’t have them controlling a load.

You can use any of the SmartThings rule engines to use the button presses to trigger Routines, control devices, etc. For example, you could use webCoRE to monitor the topButton and/or bottonButton attributes and react to those.

I’m not at home to test, but something like the following would probably work:

Note that the bottomButton and topButton attributes work like a momentary switch. While the button is pressed down, the value will be on and as soon as you let go of the button the value will change back to off.

image

Sounds like this will be the kick in the butt I need to finally get webCoRE setup and working. I’m planning on setting up the top button to control all the smart bulbs and a led strip in my den

1 Like

Awesome! Let me know how it works.

We can update the TTAS Wiki entry for the Wink Relay to include your current instructions here…
Replacing everything after step 32 with this integration would likely make things infinitely easier to use and bring the document into the present.

I wrote the article, but stepped away from my multiple Wink units because of software updates and the modified APK not being updated. I’d love to bring them back into the mainstream again, possibly with a semi-official app integration into the Wink app with ActionTiles.

1 Like

Thanks for the suggestion! I’d like to give this a bit more ‘burn-in’ time before suggesting the masses use the OEM Disabler feature per my comment in post #134. I want to make sure the foreground service approach is sufficient and if not I’ll get my other Wink Relay installed and test out the System App approach.

I ran into some issues with the android app on the Wink Relay. It installed without issue, but when I launch it, I get a grey screen for half a second, then it goes away and the app is no longer running.

This is the unit I wrote the documentation with, so it’s been attached to the wall for the last many many months and I’ve done nothing more than use it for light control using IFTTT integration. I may have to wipe it and start fresh, which is no big deal… Has anyone else had a similar issue? If so, how did you resolve?

A couple things you might try. You might start by trying an older version of the APK. While I can’t think of anything off the top of my head I suppose it’s possible that this new 0.3.0 version is dependent upon something in a previous version being there first.

The other thing you could do that would be helpful in diagnosing the issue is to run logcat while you try to run the app. If it is crashing for some reason, logcat should have it in the logs.

1 Like

That fixed it. Uninstalling the newer version, then adb installing the old version and running it prompted me for root access. Once I was able to run it as root, I tested the switch control from the app, and then when that worked updated the app to the latest version.

I’m now able to directly automate my front porch instead of relying on faulty IFTTT logic that never really worked right.

Phenomenal work! The Relay is now a feasible piece of equipment for the ST platform.

1 Like

Thanks for the update. I’ll take a look and see if I can recreate on my side and fix.

I’m happy to report that using your app for button/relay control and disabling the OEM app fixed the problem I was having with the buttons acting weird (bottom button turning the top relay on when depressed and back off when un-pressed, and top button acting flakey turning the relay on and immediately off at times). The toast notifications for top/bottom button pressed are also accurate now. This is a really elegant solution.

1 Like

Awesome! Glad to hear it’s working well for you and thanks for reporting your success!

Perhaps this is more on a webCoRe question, but when i do a:
if Wink Realy bottombutton changes to on, then Reading Light turn On
it doesn’t work. The only way to make it work is to add an else statement:
if Wink Realy bottombutton changes to on, then Reading Light turn On else Reading light turn on.

Any idea why?

Great app, I am having a little problem. It seems that the app is going to sleep or something like that. When left alone for a while and then i go try to turn on the top button to turn on the load it is connected to it doesn’t work. If i wake the screen up first and wait a second then it will work.