Rooted Wink Local Control

I tried my luck to create a component that would control the wink Hub without the cloud.

It is a work in progress and I would love comments and improvements as I am no Python writer.

I posted it here on Gist Hub

You will need to have a rooted wink hub and get your access token from the hub by sshing to it and reading

vi /database/local_control_data/config.json

To install the service
add the following to your configuration.yaml

wink_lc_service:
  key:
  host:

host is your wink’s IP address and key is your access token.

and create wink_lc_service.py (from gist) in the custom_components directory

To use the service

I then use the service by using the new service (wink_lc_service.set)

  • service: wink_lc_service.set
    data:
    {“devicetype”: “lights”, “id”: “5”, “action”: “true”}

True for on
False for off
the ID of the light or switch can be found by using the aprontest command via SSH

At this time lights is the only devicetype but it controls switches and lights.

I have a Wink Hub I want to root. Any heads up or links?

thx

the first post here has some links and that is what I followed.

1 Like

Thanks. Tried to do it but ran into a roadblock I can’t figure out and spent too much time on.
Can get the Wink into the mode, by minimum is not accepting text input from the keyboard.

I have done more testing with my service and realized it is sometimes slower then just using cloud control.

The issue seems to be with

16-10-11 12:04:53 INFO (ThreadPool Worker 3) [requests.packages.urllib3.connectionpool] Starting new HTTPS connection (1): 192.168.47.157

The process seems to be inconsistent when starting the connection to the hub,

I created a command line switch which is a little bit faster at times but still very inconsistent.

switch:
  - platform: command_line
switches:
  frontporch_lc:
   command_on: "curl -X PUT -k -H \"Authorization: Bearer TOKEN\" -H \"Content-Type: application/json\" -d '{\"desired_state\":{\"powered\":true}}' https://192.168.47.157:8888/lights/5"
   command_off: "curl -X PUT -k -H \"Authorization: Bearer TOKEN\" -H \"Content-Type: application/json\" -d '{\"desired_state\":{\"powered\":false}}' https://192.168.47.157:8888/lights/5"

The Wink Hub itself now offers local control. I’m thinking/hoping its just a matter of time before the component could be updated to also allow for direct local control as well.

I’m not a coder, so that just my home hope and guess on things. I did get my Oath2 token from Wink a while back. But have no idea regarding trying to connect to it locally.

I did confirm though by unplugging my router at home, and then still being able to control things via the Wink App with no internet access. And things were faster.

Supposedly the Wink App will automatically switch between local and remote use as well for faster response time with in the home.

And finally, I did read there is a new Wink2 hub coming out soon with better, fasters specs and hardware. One can only hope in the ability to root thew new Wink2 hubs and run HASS directly on it. That would almost be a perfect solution with all radios already built it.

I am using the same api as the Wink mobile app is for local control. I am just trying to find the best/fastest way to create an https sessions and push data.

My third attempt at a quick and dirty local control of the wink hub. Which seems to be the fastest so far.

I am using SSH sessions sharing.

ha@homeass:~# vi ~/.ssh/config

Add the following

ControlMaster auto
ControlPath ~/.ssh/control:%h:%p:%r

then open an ssh session to your wink hub and and allow it to run in the background. (using tmux or screen)

Then in your configuration.yaml

  frontporch_lc1:
   command_on: "ssh WINKIPADD '/usr/sbin/aprontest -m 5 -u -t1 -v ON'"
   command_off: "ssh WINKIPADD '/usr/sbin/aprontest -m 5 -u -t1 -v OFF'"