Close
0%
0%

Wink Hub Hacking

Things I've learned and planning to do with my rooted Wink Hub

Similar projects worth following
After rooting my hub, I figured out how to use the "aprontest" command to control bulbs via SSH and setup the crontab to put them on a schedule. Now that I have everything working as I want, I'm exploring what else I can do with it.

So for me this all started with just wanting my porch lights to automatically turn on at dusk and off at dawn. A day/night sensor ~should~ be the easy solution, but neither fixture would accommodate one, and given that I rent my house, I couldn't just go install new fixtures or install timer switches.

Some time ago I saw a post about how to root the hub, and given Home Depot had a sale going on, it was the cheapest option and the obvious choice. Appalled at the absolute bloat (seriously, a 45 MB app to turn light bulbs on and off, just, really?!) and terrible reliability of the wink app (scheduler worked correctly 1 out of 7 days), it was time to start hacking.

*** Update: These tutorials are outdated. See my project log "Firmware update & rootwink forums" for the new stuff.***

Obtaining root proved to be more of a challenge than the HaD blog post seemed to indicate, but after a couple hours of tweaking and Google searches, I was logged in as root. (BTW, the first two command of this XDA forums post were what finally got me logged in as root. ) Next, I had to figure out how to control the bulbs via the "aprontest" command. Again, Google was of little help here, and the usual "--help" command line argument didn't give any examples (a stack of arguments are required to make it function), so I had to figure it out via trial and error message. Below is the "help" execution, for reference:

Usage: aprontest [OPTION]...
Send commands and list information about connected devices

Operations:
  -a            Add a new home automation device
  -n            Manually add a home automation device to the database only.  USE WITH CAUTION.
                Only supports zigbee at this time.
  -d            Delete a home automation device
  -f            Force delete a home automation device from the database only.  USE WITH CAUTION.
                Only supports zigbee at this time.
  -u            Update the state of a home automation device with a new value
  -e            Force a refresh of a home automation device
  -g            Set a generic callback for a radio for one minute of radio
                testing
  -l            List general information about automation devices, or specific
                information about one device
  --set-name    Set user-readable name for a device

Other Options:
  -r     Specify a radio for an Add Device or Generic Callback operation.
                One of lutron, zwave, zigbee, kidde
  -m        Specify a master device ID for a Delete, Update, Refresh, or
                List operation
  -t        Specify an attribute ID for an Update operation
  -v     Specify a new value to set for an Update operation

Kidde Specific Operations:
  -k        Set Kidde system ID

Z-Wave Specific Operations:
  --zwave_controller_reset      Reset the zwave controller. USE WITH CAUTION.
                                Existing z-wave network will be lost.
  --zwave_remove_failed         Remove a failed zwave device.
  --zwave_replace_failed        Replace a failed zwave device.
  --zwave_learn_mode            Enter Learn Mode on the Zwave Controller.
  --zwave_controller_shift      Hand off control to another (new) Zwave controller.
  --zwave_exclusion_mode        Enter Exclusion Mode on the Zwave Controller.

So first, to add a device (again the smartphone app completely failed here), the command is:

aprontest -a -r zigbee

Then the hub searches for any new zigbee devices and adds them. To view all paired devices, use

[root@flex-dvt ~]# aprontest -l
Found 3 devices in database...
MASTERID |     INTERCONNECT |                         USERNAME
       1 |           ZIGBEE |                front porch light
       2 |           ZIGBEE |              kitchen porch light
       3 |           ZIGBEE |                        Engr unit
Note: you can name the device (USERNAME column) with
aprontest -m 3 --set-name "living room"
which will change the name of device #3 ("Engr unit) to living room. Note: -m 3 specifies device 3
[root@flex-dvt ~]# aprontest -m 3 --set-name "living room"
[root@flex-dvt ~]# aprontest -l
Found 3 devices in database...
MASTERID |     INTERCONNECT |                         USERNAME
       1 |           ZIGBEE |                front porch light
       2 |           ZIGBEE |              kitchen porch light
       3 |           ZIGBEE |                      living room
Next, each device has its own attributes you can set. In the case of the bulb, there is power (ON or OFF, case sensitive) and brightness (1 to 255). View as shown.
[root@flex-dvt ~]# aprontest -m3...
Read more »

  • 1 × Wink Hub
  • 3 × GE Link LED bulb

  • WiFi issues resolved

    agm77710/27/2016 at 22:12 0 comments

    I have had nothing but trouble getting the hub to connect and stay connected to my wireless router. I recently figured out the cause. I had placed my hub about ~5 ft from my router, and evidently that was close enough to saturate the hub's wifi radio. I moved it to the other side of the room and it has worked perfectly since then.

  • Firmware update & Root Wink forums

    agm77707/24/2015 at 03:42 0 comments

    So after the wink's Epic Fail, I could no longer use the smartphone app. (BTW I made bank on their screw up though, and got a power genius bar for the cost of shipping. Woot! BTW it works great as-is, no tweaking req'd like the hub) So I decided to update to the newest firmware, v 1.01, details on that in a bit. I also discovered this nifty site rootwink.com, with some nice tutorials, one of which I followed. Before I get into how my firmware upgrade went, here's some useful tutorials I found:

    Root new hub out of the box

    A better tutorial for the cron daemon

    Unsupported devices that work

    Read about my firmware upgrade experience before attempting these:

    Firmware upgrade preserving root

    Root any firmware the hard way

    So, my firmware upgrade fiasco. I began following the procedure in the "firmware upgrade preserving root" link posted above. Here's where I went wrong: my SSH access was dependent upon entering a root password instead of the RSA key method. If you don't want to mess with the serial terminal, make sure you can SSH with the RSA key. So anyway, I followed the said tutorial without problem up till the step where you reboot into the upgrade/recovery partition. That's where I lost SSH access. Oh, and once set to boot to the upgrade/recovery partition, it won't boot to the normal OS until the upgrade is finished. Essentially it was bricked. Fortunately, you can recover from this using the serial console, as described in the "root any firmware the hard way" link. Here's the difficult part: you have to short pin 29 on the NAND chip to ground on powerup and get the timing just right. Short it while powering on or too soon (I believe about 1 sec after power on), and the bootloader won't go. Half a second too late, and the OS boots. Oh, and those pins are tiny! Anyway, a bunch of bad words later, I got it back up and running.

  • Crontab MIA

    agm77704/05/2015 at 13:44 0 comments

    Hmmm... my wifi router went haywire causing the hub to lose its wifi connection and went to its "blinking pink" factory reset state. Restarted the whole system and it reconnected without having to set it up all over again. However, in this process, somehow my crontab file got deleted. Don't know if that is because the /var/spool directory doesn't get written to the flash or if there is some kind of tamper-proofing script that found it and deleted it upon reboot. (If you know, comment) Anyway, lesson learned, make a backup copy. I'm putting mine in root's home folder; I'm pretty sure that does get written to the flash. In any case, I'll find out...

View all 3 project logs

Enjoy this project?

Share

Discussions

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates