Home Assistant and August Connect and August Lock

Hey guys,

So I am wondering, does anyone use the august lock with august connect in their setup? I currently live in an apartment where I can’t fully change the locks and the the august lock fits in perfectly with this. I would like to hook it into my home assistant setup I recently started growing (two aeontec zw098 light bulbs with an ecobee 3 lite wifi thermostat). Any help or point would be appreciated.

I bought a wink gen 1 just for this purpose. HA can lock/unlock it with about 95% success rate now.

I got the lock working with the wink component without the need for the wink hub. Turns out the lock works natively with the api as long as you have an august connect for each lock.

Hi Bman

Would you mind explaining how you managed to get the wink working without the hub? For me it won’t even let the server start.

Thanks a Lot

Hey miratur,

I got it to work following this example: Wink Component - Home-assistant.io . This should get you up and running while you wait for your api keys from wink.

Thanks Bman

I will be waiting for the api keys.

Cheers

@Bman Can you give me some more detail on your setup? Do you have an August connect (I would assume so…)? How does it work without the hub? Does it lock and unlock properly as it’s supposed to?

Sure, so to use the component, I have an august connect. This allows me to use the wink component without a physical wink hub (in accordance to wink’s website). It locks and unlocks properly although the august app does a better job. This may be do to the distance the august connect is from the lock since the august app takes a while to connect remotely. The distance thing came up in the setup of it. Its not bad though.

@Bman Thanks for the info. And does Home Assistant correctly report the state of the lock?

Yes, it does. There’ll be a little lock icon representative of the lock. When you unlocked, it’ll update the icon as such and vice versa

Very cool! Thanks for the info!

Hey @Bman
Got my keys and installed the wink following the new instructions. Did you have any problem after restarting the server? What happens to me now is that as soon as I restart I get an error saying that the wink config is wrong even tho the first time it worked fine and I got all the way to the configurator and api authorization.

Hope you can help :slight_smile:

Cheers

How did you add the key to Home assistant? If its in the configuration file, you need to take it out. Then restart the server and there should be a configuration card that comes up for wink and that’s where you add the key you received from wink, as I recall.

Yes

That part worked perfect. The problem is when I restart the server. It says that there was a problem with the config.
For clarity here are the steps I did:

  1. Got the keys
  2. added wink: to the configuration.yaml
  3. On the configurator box on the dashboard I added the ClientId and Secret
  4. It asked me to go to the Redirect http://myip:port/auth/wink/callback
  5. Accessing the url I was asked to log in.
  6. Logged in and got a message saying that everything was ok and suggesting to restart
  7. file .wink.conf was created with acees_token, client_id, client_secret and refresh_token

After restarting:

  1. Error on the log files saying that there was an issue with the configuration
  2. I don’t see the lock or any wink object

Do you think this is a bug?

Cheers

What error is given in the logs as to why the wink platform can’t be set up?

Hey @marthocoo

Here is what is see:

2017-11-03 12:01:43 ERROR (MainThread) [homeassistant.setup] Error during setup of component wink
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/homeassistant/setup.py", line 194, in _async_setup_component
    component.setup, hass, processed_config)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/asyncio/futures.py", line 332, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/asyncio/tasks.py", line 250, in _wakeup
    future.result()
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/asyncio/futures.py", line 245, in result
    raise self._exception
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/concurrent/futures/thread.py", line 55, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/homeassistant/components/wink/__init__.py", line 361, in setup
    pywink.get_subscription_key())
  File "/Users/pedro/.homeassistant/deps/lib/python/site-packages/pywink/api.py", line 566, in get_subscription_key
    first_device = response_dict.get('data')[0]
IndexError: list index out of range
    `indent preformatted text by 4 spaces`

That seems odd - I would raise as an issue on GitHub. What it looks like is happening is that pywink is requesting a list of hubs, getting none, and so erroring. Clearly you should be able to use the platform without a hub.

I’m expecting API keys in a couple of days, will be interesting to see if I can reproduce this error.

@w1ll1am23 any ideas?

Actually scratch that. Took a look at the python-wink code and it looks like get_subscripion_key() calls on wink to provide it with a response of a dict containing your devices, and expects that response to not be empty so that it can use the first device in the dict. Might be an obvious question but do you have any devices added to your wink app/account?

Hmm yeah something strange is happening. So that call to get_subscription_key basically calls the api.wink.com/users/me/wink_devices endpoint to get all the accounts devices, and then gets the subscription key from the first device. Apparently no devices are being returned…

@miratur
Ahhh okay I was able to re-crete this with a new account. So… not sure how it should be handled, shouldn’t crash thats for sure lol. I am guessing that you don’t have the lock paired to your account yet? You need to pair the August lock with the offical Wink app on iOS or Android first and then restart HomeAssistant.

I suppose you could query wink_devices early on in the initialization process and if it returns NULL you could log “No devices found in your Wink account. Please pair your devices with Wink and then restart Home Assistant.” Or something to that effect - after all, the wink platform is pretty useless if wink doesn’t have any devices to control/pass to Home Assistant.