[BETA RELEASE] Lutron support in SmartThings using custom Wink Hub software - looking for testers / the adventurous

Hey Benji,

Yes, you are correct regarding the platform issues, and perhaps I should wait. The strange part is that some of the SMARTWINK devices are responding whereas others are not. So I am not sure this is a platform issue or not.

But, I will continue to troubleshoot while awaiting the all clear form SmartThings Support.

Thanks for the feedback,
Ryan

Hello Michael,

Adding some more information on the topic. I was able to telnet directly to the Wink Hub and manually control the Lutron Casetta devices. After making sure they were controllable, I removed the two Lutron Casettas outlets that I had added through SmartWink thinking that would return control to the SmartWink app. This did not work and I still get the error 357 form the Smartapp and still receive blank screens from within the app.

I have tried to remove the Wink Hub from within the app and this does not work either.

Thanks,
Ryan

If youā€™ve already removed the devices, Iā€™d remove and reinstall the app - I noticed yesterday that the keys and values across all smartapp data were briefly swapped (I suspect the SmartThings ā€œdatabase updateā€), and had to uninstall and reinstall a bunch of them (my hue bulbs stopped working in particular). If this continues past the duration of the outage, Iā€™ll investigate the IllegalArgumentException you saw.

Thanks Michael, Although painful to remove and re-add all the PICO and Casetta devices, this did the trick. I removed the SmartApp and Re-added it. It is now functioning again so all I have to do is rebuild all my SmartLighting routines.

Thanks again for the advice and for the great SmartApp!

Ryan

Great, glad that worked! I think this was a one-off issue resulting from the SmartThings downtime yesterday, but if it does happen again, let me know and Iā€™ll investigate further.

Iā€™m trying out the Smartwink code, I just rooted my spare updated wink hub via the NAND method and was trying to untar the binaries file and encountered the ā€œinvalid tar magicā€. Can you give me a step by step? I tried to ugzip the file first on the wink before trying to untar it but no dice. Used to a tar version that can do it all.

Matt

Looks like the Wink version of tar canā€™t extract tarballs created by gnutar! Iā€™ve updated the tarball; please try again.

Hi Michael,

I found this thread a few days ago and it was exactly what I was looking for. I have Wink hub which I started my home automation with and it was frustrating experience. Then I moved to Staples Connect and it worked fine except it is closed platform and Staples is abandoning it. So I decided to try out SmartThings. My only problem is that I already heavily invested in Lutron Caseta and ST hub is not supporting ClearConnect.

So my configuration is the following Wink hub already updated to the latest version and the second generation of ST hub. I rooted my Wink hub and followed your instructionsā€¦

Eventually, I was able to see my hub in the ST mobile app and even pair one of my Lutron in-wall dimmers. However, the dimmer was not accepting commands and the app were stuck in ā€œturningonā€/ā€œturningoffā€ state with no effect on lights. I started digging into the problem. I found that ā€œset.phpā€ fails with ā€œno such deviceā€ when I simulate the call from curl. I added my own list.php to return all devices from ā€œlutronDevicesā€ table from /database/apron.db" and it appeared to be empty, while ā€œDeviceā€ table in ā€œ/database/lutron-db.sqliteā€ contained a record for my dimmer. ā€œaprontest -lā€ also returns list with my dimmer in it and I am able to turn it on and off via ā€œaprontest -uā€ command.

I had some issues during rooting and perhaps broke something. For instance, my hub is not connecting to Wink servers anymore though I didnā€™t change hosts file. And start-stop-daemon wasnā€™t starting apron-wrapper saying about problems with pid file, so I had to change file name to ā€œaprond-wrapper.pidā€ insead of ā€œapron.pidā€.

Is there any idea on what went wrong with my setup?

It sounds like apron recognizes your device, but lutron-core doesnā€™t (or isnā€™t writing it to /database/lutron-db.sqlite). Do you know what firmware version youā€™re on, offhand? Also, what do you see when you issue ls -l /database/lutron*?

Actually, /database/lutron-db.sqlite contains right records, so lutron.php correctly returns my device:
[{ā€œidā€:4,ā€œserialā€:21131947,ā€œnameā€:ā€œCaseta Wall Dimmerā€,ā€œtypeā€:ā€œWALL_DIMMERā€}]
It is apron.db which is not populated by adding this device record into ā€œlutronDeviceā€.

Hub version is 2.49


[root@flex-dvt ]# ls -l /database/lutron*
-rw-rā€“r-- 1 root root 295936 Mar 27 22:56 /database/lutron-db.sqlite

/database/lutron.d:
total 8
-rw-rā€“r-- 1 root root 9 Jan 1 1970 coproc-os-version-programmed
-rw-rā€“r-- 1 root root 69 Jan 1 1970 database-converted


Some other thoughts. It looks like scripts from /etc/rc.d/init.d are not auto-starting at boot. So they only start when monit detects they are not running and restarts them. So the boot log looks like this:

Jan 2 07:43:48 flex-dvt user.info monit[1164]: Starting monit daemon with http interface at [127.0.0.1:2812]
Jan 2 07:43:48 flex-dvt user.info monit[1164]: Starting monit HTTP server at [127.0.0.1:2812]
Jan 2 07:43:48 flex-dvt user.info monit[1164]: monit HTTP server started
Jan 2 07:43:48 flex-dvt user.info monit[1164]: ā€˜flex-dvtā€™ Monit started
Jan 2 07:43:49 flex-dvt user.err monit[1164]: ā€˜ntpdā€™ process is not running
Jan 2 07:43:49 flex-dvt user.info monit[1164]: ā€˜ntpdā€™ trying to restart
Jan 2 07:43:49 flex-dvt user.info monit[1164]: ā€˜ntpdā€™ stop: /etc/rc.d/init.d/ntp
Jan 2 07:43:49 flex-dvt user.info root: Stopping ntpd
Jan 2 07:43:49 flex-dvt user.info monit[1164]: ā€˜ntpdā€™ start: /etc/rc.d/init.d/ntp
Jan 2 07:43:49 flex-dvt user.info root: Process: ntpd not found.
Jan 2 07:43:50 flex-dvt user.info root: Starting ntpd
Jan 2 07:43:51 flex-dvt kern.info kernel:Bluetooth: 83193eec
Jan 2 07:43:51 flex-dvt kern.err kernel:wlan0 (WE) : Wireless Event too big (4128)
Jan 2 07:43:51 flex-dvt user.notice root: Received event: CONNECTED
Jan 2 07:43:52 flex-dvt daemon.info udhcpc[1225]: udhcpc (v1.22.1) started
Jan 2 07:43:52 flex-dvt user.debug root: udhcpc deconfig
Jan 2 07:43:52 flex-dvt daemon.info udhcpc[1225]: Sending discoverā€¦
Jan 2 07:43:52 flex-dvt daemon.info udhcpc[1225]: Sending select for 192.168.1.165ā€¦
Jan 2 07:43:52 flex-dvt daemon.info udhcpc[1225]: Lease of 192.168.1.165 obtained, lease time 86400
Jan 2 07:43:52 flex-dvt user.debug root: udhcpc renew or bound
Jan 2 07:43:52 flex-dvt kern.warning kernel:dhd_aoe_hostip_clr failed code -23
Jan 2 07:43:52 flex-dvt kern.warning kernel:aoe_update_host_ipv4_table failed
Jan 2 07:43:54 flex-dvt user.err monit[1164]: ā€˜lutron-coreā€™ process is not running
Jan 2 07:43:54 flex-dvt user.info monit[1164]: ā€˜lutron-coreā€™ trying to restart
Jan 2 07:43:54 flex-dvt user.info monit[1164]: ā€˜aprondā€™ stop: /etc/rc.d/init.d/apron
Jan 2 07:43:54 flex-dvt user.info root: Stopping aprond
Jan 2 07:43:54 flex-dvt user.info monit[1164]: ā€˜lutron-coreā€™ stop: /etc/rc.d/init.d/lutron
Jan 2 07:43:54 flex-dvt user.info root: Stopping lutron-wrapper
Jan 2 07:43:54 flex-dvt user.info monit[1164]: ā€˜lutron-coreā€™ start: /etc/rc.d/init.d/lutron
Jan 2 07:43:54 flex-dvt user.info root: Process: lutron-wrapper not found.
Jan 2 07:43:54 flex-dvt user.info root: Starting lutron-wrapper
Jan 2 07:43:55 flex-dvt user.info lutron-core: Core version 00.06.00a000 startingā€¦
Jan 2 07:43:55 flex-dvt user.info lutron-core: Daemonizingā€¦
Jan 2 07:43:55 flex-dvt user.info lutron-core: lutron-core starting
Jan 2 07:43:55 flex-dvt user.info lutron-core: Starting linkā€¦
Jan 2 07:43:55 flex-dvt user.info lutron-core: Link Started

Yep, your lutron-db is in the right place and isnā€™t empty.

Itā€™s interesting that aprontest shows the device, but itā€™s not in apron.db. Do the same with /database/apron*? Also check that aprond is running (ps a | grep apron).

If youā€™ve got strace installed (opkg install strace if you donā€™t), you can try an strace -f aprontest -l 2>&1 | grep ā€˜open.*apron.dā€™. This will show you the file that aprontest is reading from to pull its information.

I did all three:
[root@flex-dvt ]# ls /database/apron*
/database/apron.db /database/apron.db.old /database/apron_kidde.dat /database/aprondb.sqlite
[root@flex-dvt ]# ps a | grep apron
1378 root socat -u EXEC:/usr/sbin/aprond,stderr,pty,ctty,end-close -
1379 root {apron-monitor} /bin/sh /usr/share/smartwink/apron-monitor -
1383 root /usr/sbin/aprond
17339 root grep apron
[root@flex-dvt ]# strace -f aprontest -l 2>&1 | grep ā€˜open.*apron.dā€™
[pid 17366] open("/var/lib/database/apron.db", O_RDWR|O_LARGEFILE|O_CLOEXEC) = 4

The last command shows /var/lib/database/apron.db. I changed set.php to use the db file at this location and now my light turns on and off!!! :slight_smile: There is 1-2 extra seconds lag comparing to Staples Connect hub I am currently using with Lutron devices. But it is still better than using Wink hub with their app directly.

Thank you, Michael. You did a great job by creating this solution!

As part of a general feedback, I think something needs to be done on ST device handler side to process errors when Wink hub is not responding or responding with an error. ST app just stuck with transitional stage ā€œturning of/orfā€ forever and even refresh button doesnā€™t help. Since now it is working Iā€™ll play a bit more with it and let you know, if I find some other issues.

Excellent, glad to hear itā€™s working, and Iā€™ll take that feedback into account. Iā€™ll also make sure it looks in /var/lib/database as well as /database, since it sounds like certain versions of the Wink firmware have placed it there.

The extra 1-2s latency over using Staples Connect is almost entirely SmartThings, Iā€™m afraid. Staples Connect has local processing, so itā€™s much faster than SmartThings is (pity Staples never really built it out; they could have had a nice platform). But see the ā€œhard link picoā€ app in the same package if youā€™d like to hardware-pair Pico remotes to Caseta dimmers, specifically - this will give you instant control of those dimmers with the picos.

I have a wink hub on the way to try this out. Iā€™m a little concerned because I have a feeling it may already be updated past the version where rooting is going to be easy, or possible. Itā€™s from amazon warehouse deals, so no idea how long this device may be sitting aroundā€¦

So far though the Lutron caseta switches Iā€™ve installed have been FANTASTIC for solving some of the issues Iā€™ve had with installing 3/4/5 way switches - they just work and with ledā€™s with no neutral wires.

Can you guys point out any sources (even specific google searches) that might help with the process? Iā€™ve been looking at forum.xda-developers.com

Hi @e8link, If you are talking about the hardwire root, do a search on the KEYWORDS Root and WINK. I actually used the information from three different sites and was able to accomplish it using a Raspberry PI and an accessory wire. If you read the information out there, you can do it with little prior knowledge. Once you get in, as long as you donā€™t update the hub, you will be able to connect over SSH.

Good Luck!
Ryan

Is there a confirmation once the hub is put into pairing mode? The Next button is enabled, but it doesnā€™t lead me anywhere.

Do I need to put the remotes into pairing mode somehow?

Yep, you need to pair the remotes as well by holding the off button for six seconds once the hub is placed in pairing mode (until the lights on the remotes flash). You should see the text in the app change when theyā€™re successfully paired.

Sounds like my hub may be having issues getting into pairing mode because it sits on the ā€œPlease wait while we put your hub in pairing mode.ā€ Do you have tips to troubleshoot?

Check the log at the SmartThings IDE - commands and responses relating to pairing should be shown there. You can also work around this by sshing into the hub and issuing aprontest -a -r lutron manually, then pairing your pico remotes there. They should then be picked up when you install / configure the SmartApp.

1 Like