[BETA] Wink Relay - Custom SmartThings Integration

android
dth_lighting
dth_sensors
project_sensors
winkrelay

(Joshua Lyon (SharpTools.io Dashboard)) #21

Thanks for the additional details. I’ve added the updated logging. I’m just wrapping up a mechanism to share the logs easily then I’ll post the updated package.

What other apps do you have running on the Wink Relay? Was the Relay just sitting there between the time you could load the XML file and when it stopped or was there some action taken?


(alvarez513@gmail.com) #22

Hi I had the same issue come up, I forced closed josua_lyon’s Wink Relay app in settings and relaunched and was able to reach the xml page again…


#23

I cheated and added the device manually and so far so good. The only quirk I had was that both statements at the end of the parse() routine (to set the switch on/off if the hardware switches are on/off) kept returning false no matter what state the switches were in because device.currentValue(“switch”) kept returning null. I added defaultState:true to the “on” state (so it would return “on” by default instead of null and that fixed it.

In theory I think pressing the button in SmartThings would have set the state by changing it but it didn’t seem to work… but it might have if I fiddled with it that way instead.

Really well done so far. This is already very powerful… I’m looking forward to seeing it evolve.


#24

I tried that earlier but no luck, can you share the steps you took please?


#25

The trick is that the device ID needs to be a hex ip, colon, hex port (8080
converted to hex which is 1F90). So if your wink relay is at 192.168.1.10
your device id will be:

C0A8010A:1F90

You can use this tool to convert the wink relay’s IP to hex:

http://www.kloth.net/services/iplocate.php

Sorry I’m on my phone so I can’t write out more detailed instructions right
now but that was the biggest hurdle so hopefully it helps.


(Ragai Meena) #26

I followed your steps and added defaultState:true to line 171 in the device handler and it seems to work. The problem is that I have to press the refresh button almost every time to force the app to report the manual switch status


#27

It should actually be line 61… I changed:

attributeState “on”, label:’${name}’, action:“switch.off”, icon:“st.lights.philips.hue-single”, backgroundColor:"#00a0dc", nextState:“turningOff”

to:

attributeState “on”, label:’${name}’, action:“switch.off”, icon:“st.lights.philips.hue-single”, backgroundColor:"#00a0dc", nextState:“turningOff”, defaultState: true

As far as refreshing goes, I haven’t gotten a chance to experiment too much yet.


(Joshua Lyon (SharpTools.io Dashboard)) #28

I’ve uploaded a new APK for installation on the Wink Relay which includes some enhanced logging and diagnostic features.

http://sharptools.boshdirect.com/STWinkRelay_0-2.apk

Install it the same way as before, either download via your browser and install or ADB install -r STWinkRelay_0-2.apk

As usual, you should open the application at least once to make sure the services are all started. There’s now a settings icon in the action bar at the top of the main screen.

You can go to Settings > General > Service Status to see if all of the services are running. I would note that this just checks to see if Android can see the services as started and running, but doesn’t necessarily mean they are working as expected!

You can go to Settings > General > Submit Logs to upload the most recent STWinkRelay logs to me. Note that this also runs a set of diagnostics which check for network connectivity, sends a test SSDP request, tests the built-in webserver, and grabs a list of the locally installed apps (in case something is causing a conflict).

I made a really minor tweak to the SSDP service, but I don’t think it would solve the issue. I’m still at a bit of a loss as to why the SSDP service is working for me, but not working for many of you, but hopefully some of you can submit logs and we can try to track down what’s going wrong. Note that after you submit your logs, please send me the device ID which is showing on the page. I should only need the first three and last three characters to retrieve your submitted logs.


(Ragai Meena) #29

any plan to have each button on the relay show up as an indiviudal thing so that they can be integrated separately in different routines and automations


#30

Joshua, the link for the updated Wink Relay app isnt working


(Joshua Lyon (SharpTools.io Dashboard)) #31

Should be fixed now. Had an extra letter in the original URL.


#32

Logs uploaded…Device ID: 8ec7327bce2f32be


(Joshua Lyon (SharpTools.io Dashboard)) #33

Thanks! I got the logs. It looks like all the services are starting up as expected and I was able to see that the SSDP requests are being received, responses appear to be sent, and the device.xml file is being requested. Was the discovery process working for you this time?


(Chris Hammerbeck) #34

b6ebb9f647a58c0f
Just sent mine…


(Joshua Lyon (SharpTools.io Dashboard)) #35

Thanks @chammerbeck I’m seeing similar results in your logs. The SSDP search request is coming in, the response is sent, then a few moments later the device.xml request is coming in. Is the discovery working for you now?


(Chris Hammerbeck) #36

No discovery. Tried a few times after the update. Also rebooted the Wink Relay.


(Joshua Lyon (SharpTools.io Dashboard)) #37

What were you seeing in the SmartThings logs when you tested? The logs that were submitted show one half of the equation. The Wink Relay was receiving the SSDP request, responding, and then getting the device.xml request. I assume that’s coming from SmartThings, but I suppose it could be something else on your network.


(Chris Hammerbeck) #38

d41f6d0d-2f28-4534-8b56-e697ea163cfc 10:05:18 AM: debug Searching for urn:sharptools-io:device:WinkRelay:1
d41f6d0d-2f28-4534-8b56-e697ea163cfc 10:05:18 AM: debug Running device discovery (page)…
d41f6d0d-2f28-4534-8b56-e697ea163cfc 10:05:13 AM: debug Searching for urn:sharptools-io:device:WinkRelay:1
d41f6d0d-2f28-4534-8b56-e697ea163cfc 10:05:13 AM: debug Running device discovery (page)…
d41f6d0d-2f28-4534-8b56-e697ea163cfc 10:05:08 AM: debug Searching for urn:sharptools-io:device:WinkRelay:1
d41f6d0d-2f28-4534-8b56-e697ea163cfc 10:05:08 AM: debug Running device discovery (page)…
d41f6d0d-2f28-4534-8b56-e697ea163cfc 10:05:03 AM: debug Searching for urn:sharptools-io:device:WinkRelay:1
d41f6d0d-2f28-4534-8b56-e697ea163cfc 10:05:03 AM: debug Running device discovery (page)…
d41f6d0d-2f28-4534-8b56-e697ea163cfc 10:04:57 AM: debug Searching for urn:sharptools-io:device:WinkRelay:1
d41f6d0d-2f28-4534-8b56-e697ea163cfc 10:04:57 AM: debug Running device discovery (page)…
d41f6d0d-2f28-4534-8b56-e697ea163cfc 10:04:52 AM: debug Searching for urn:sharptools-io:device:WinkRelay:1
d41f6d0d-2f28-4534-8b56-e697ea163cfc 10:04:52 AM: debug Running device discovery (page)…
128cf9a6-3d05-4f7d-8a72-ac0fd8276e9a 10:04:49 AM: debug sending data to AT
128cf9a6-3d05-4f7d-8a72-ac0fd8276e9a 10:04:49 AM: debug A sensor event occurred: [name:energy, deviceId:3881da14-87ab-4b91-b309-709f65bcf5a3, isoDate:2017-12-31T16:04:49.445Z, unit:kWh, value:5832.499]
904e492d-ed97-4b07-b47e-bd935deb8a8a 10:04:49 AM: debug updating TS
904e492d-ed97-4b07-b47e-bd935deb8a8a 10:04:49 AM: debug event from: HEM House, value: 5832.499, source: DEVICE, description: zw device: 2C, command: 3202, payload: 21 64 00 58 FF 33 00 3C 00 58 FF 13
d41f6d0d-2f28-4534-8b56-e697ea163cfc 10:04:47 AM: debug Searching for urn:sharptools-io:device:WinkRelay:1
d41f6d0d-2f28-4534-8b56-e697ea163cfc 10:04:47 AM: debug Running device discovery (page)…
d41f6d0d-2f28-4534-8b56-e697ea163cfc 10:04:41 AM: debug Searching for urn:sharptools-io:device:WinkRelay:1
d41f6d0d-2f28-4534-8b56-e697ea163cfc 10:04:41 AM: debug Running device discovery (page)…
d41f6d0d-2f28-4534-8b56-e697ea163cfc 10:04:35 AM: debug Searching for urn:sharptools-io:device:WinkRelay:1
d41f6d0d-2f28-4534-8b56-e697ea163cfc 10:04:35 AM: debug Running device discovery (page)…
d41f6d0d-2f28-4534-8b56-e697ea163cfc 10:04:30 AM: debug Searching for urn:sharptools-io:device:WinkRelay:1
d41f6d0d-2f28-4534-8b56-e697ea163cfc 10:04:30 AM: debug Running device discovery (page)…
7524929e-5e53-4c91-82fd-9824a2d98292 10:04:28 AM: debug Parse returned [name:temperature, value:65, unit:F, descriptionText:{{ device.displayName }} was {{ value }}°F, translatable:true]
7524929e-5e53-4c91-82fd-9824a2d98292 10:04:28 AM: debug description: temperature: 18.33
d41f6d0d-2f28-4534-8b56-e697ea163cfc 10:04:24 AM: debug Searching for urn:sharptools-io:device:WinkRelay:1
d41f6d0d-2f28-4534-8b56-e697ea163cfc 10:04:24 AM: debug Running device discovery (page)…
d730f5c2-b690-4b83-ade4-a7b4ccd45225 10:04:11 AM: trace getPhrases(), state.welcomeIssue = null
d730f5c2-b690-4b83-ade4-a7b4ccd45225 10:04:11 AM: trace getPhrases(), state.welcomeIssue = null


(Chris Hammerbeck) #39

Just an FYI. I will be probably unavailable after 10:30CST today…
Hope my info helps.
Thanks again for this great idea/project.
Happy New Year!


(Joshua Lyon (SharpTools.io Dashboard)) #40

Thanks Chris. It’s showing the discovery being sent, but isn’t showing the response or the device.xml request… which is a bit confusing since your original WinkRelay logs were showing that they were receiving the SSDP request, responding, and then getting a device.xml request from something.

I’ll put together some instructions for sending in the debug information. Ideally, I need the logs from SmartThings and the logs from the Wink Relay from the same timeframe and the rough time that the discovery was attempted. I’ll add some additional logging to the Wink Relay so I can see what IP address the device.xml requests are coming from and if the IP address of the SmartThings hub is included, then I should be able to correlate everything.