[Beta] Wink Relay - LAN Integration

PR has been merged. Thanks @adamkempenich!

1 Like

WOW! OK, ran the configure and voila! Thanks a bunch. Now I will keep working on the rest of my relays. By the way, there is a java error that keeps popping up. It is in one of the first of my posts above. Any idea how I kill that little pest while I am at this?

dev:1782020-04-02 16:49:01.616 errorjava.lang.NullPointerException: Cannot invoke method currentValue() on null object on line 182 (parse)

Cheers
Derrick

1 Like

You updated the driver code, correct?

Yes Sir. Worked a treat!

1 Like

You may want to uninstall all of your wink Relay devices from Hubitat and start over, if that persists.

No problem. The hard bit seems to be over now. Actually, the biggest pain in the butt and time consumer, is prepping the relays. So, what language do you use to program these? The last real programming I did was back in university when I studied Fortran, Cobol and Basic. Yup, back when the dinosaurs ruled the Earth. LOL!

1 Like

The code that runs on the Wink Relay itself is a mix of C and Java.

The code that runs on Hubitat is Groovy (which itself is Java-ish).

Hi Josh
Appreciate the assistance you and Adam provided. For a while I figured these were headed for the landfill. I will have to pick up a good Java primer somewhere and see if I can get my head around it.
Cheers
Derrick

I can confirm it is now working. Thank you for the quick fix

1 Like

Hi Josh
How hard would it be to have the program report temperatures in Celsius? (For us lot up in the "Great White North". LOL!

Cheers

1 Like

I’ll throw a PR in later to offer a °C option :slight_smile:

1 Like

Adam, Josh, I am having a devil of a time getting the buttons on this Wink Relay to work with loads that are not directly connected to it. I have looked through the posts and can't seem to find any definitive ways to do this with the relay setup as device and the buttons as children. Could you instruct me on how to do this properly?
Thanks, in advance, for the assist.
Cheers
Derrick

I don't think there's a definitive guide, but the following post has some tips that might be helpful:

On the Wink Relay, within the custom STWinkRelay app, there are configuration options to choose what pressing the physical buttons on the relay does.

You can configure the device to do nothing when the button is pressed. In that case, it won't physically actuate the built-in relay (switch) on the Wink Relay, but it will still send the button press event to Hubitat.

You can then use the built-in Rule Machine or Button Controller (depending on your hub software version) to use the button press events from the (parent) Wink Relay device to trigger actions on other devices.

Hi Josh

I keep getting this error every time I try to trigger the buttons. Top and bottom, both, give the same error. Any ideas?

2020-04-06 18:49:42.519 errorjava.lang.NullPointerException: Cannot invoke method sendEvent() on null object on line 228 (relay1On)

Name this Rule*

Select Trigger Events
Master Bedroom Wink Relay button 1 pushed

Select Actions to Run
Toggle: Master Bedroom Bedside Table Lamp, Master Bedroom Bedside Table Lamp 2

This is what I have in rule machine

Checked the Wink Relay and both buttons are set to "Do Nothing (Event Only)
Cheers

How are you trying run the rule?

That block of code should only be run when one of the commands is used on the device (eg. on(), relay1On() or toggle()). In the case of you physically pressing the button on the Wink Relay, those blocks of code shouldn't be called by default as it's just an event update.

Either there's lines missing from your log snippet or the device isn't being actuated physically.

HI Josh

OK, so, what do I need to do in order to press one of the buttons and, say, turn on a bedside lamp that is not electrically connected to the relay? (Say, Relay 1 for illustrative purposes)

Sorry, old, tired, brain.

Cheers
Derrick

Good Evening Josh

I figured it out. I had been at this new hub continuously for several days and I guess I should have left it alone for a bit. Anyway, it hit me today what you were saying and how to do it. Felt like a complete idiot. Again, thanks for the help and, more importantly, your forbearance.
Cheers
Derrick

1 Like

when I try and install the STWinkRelay.apk, the apk will not install get the following error:

adb: error: failed to copy 'STWinkRelay_0-3-0a.apk' to '/data/local/tmp/STWinkRelay_0-3-0a.apk': remote Permission denied

any ideas?