Wink client_id/client_secret setup isn't working

You shouldn’t be navigating to auth/wink/callback. You need to visit auth/wink which will direct you to a log in. After logging in you will be automatically redirected to auth/wink/callback.

Thanks. When I do that, i get: Client is not authorized or could not be found.

Can you send the URL from the page that is saying unauthorized?

Thanks:

https://api.wink.com/oauth2/authorize?client_id=Z5TW_no5Ct2ZiKpw1Mx1PGTqqX16Koex&redirect_uri=http%3A//192.168.1.91%3A8123/auth/wink/callback

Okay, URL looks good. Can you make sure that the client ID section in that URL actually matches what you have listed in developer.wink.com?

I have confirmed that the url and the client ID match

Try to start fresh.

  1. Stop home assistant. (You must stop it first or these steps won’t work)
  2. In the configuration directory delete the .wink.conf
  3. Restart home assistant
  4. The wink configurator will show up on the front end carefully copy the client id and the client secret and paste them in to the configurator
  5. Navigate to 192.168.1.91:8123/auth/wink
  6. Sign in with your Wink credentials
    Hope for the best.

Thank you. Had to head out of town on business so I’ll try later in the week.

Thank you for all of your help. Followed your steps with no luck.
Still getting: Client is not authorized or could not be found.

So you have team viewer? If so would you like to screen share with me and we can try to figure it out.

Also you may want to try this from an incognito chrome tab or a private firefox tab to prevent any cache issues.

Incognito tab didn’t work.
I do have TeamViewer and would be happy to share. What is the best way to get started?

Shoot me a PM with your team viewer ID and your password. We can start this now if you have the time.

@w1ll1am23 Could you please help me out to find out what is the problem I have

   2018-01-03 11:59:43 INFO (Thread-4) [homeassistant.components.wink] Using legacy oauth authentication
2018-01-03 11:59:43 ERROR (MainThread) [homeassistant.setup] Error during setup of component wink
Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/homeassistant/setup.py", line 193, in _async_setup_component
    component.setup, hass, processed_config)
  File "/usr/lib/python3.5/asyncio/futures.py", line 380, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/lib/python3.5/asyncio/tasks.py", line 304, in _wakeup
    future.result()
  File "/usr/lib/python3.5/asyncio/futures.py", line 293, in result
    raise self._exception
  File "/usr/lib/python3.5/concurrent/futures/thread.py", line 55, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.5/dist-packages/homeassistant/components/wink/__init__.py", line 320, in setup
    pywink.get_subscription_key())
  File "/root/.homeassistant/deps/lib/python3.5/site-packages/pywink/api.py", line 576, in get_subscription_key
    response_dict = wink_api_fetch()
  File "/root/.homeassistant/deps/lib/python3.5/site-packages/pywink/api.py", line 597, in wink_api_fetch
    raise WinkAPIException("401 Response from Wink API.  Maybe Bearer token is expired?")
pywink.api.WinkAPIException: 401 Response from Wink API.  Maybe Bearer token is expired?

I set up everything correctly, with username, password and client credentials provided by wink for developers

Where did you get your client id and secret from? If its from developer.wink.com you can’t use the legacy oauth method. You need to use the Wink configurator so you should only have wink: in your config.

1 Like

@w1ll1am23
Thank you very much! It does! =)

On my system after deleting the .wink.conf it doesn’t prompt me to reconfigure wink. To add it says there is a configuration issue, no .wink.conf files is recreated. I’ve verified the configuration.yaml is correct. In the log Im seeing:

File “/usr/lib/python3.5/concurrent/futures/thread.py”, line 55, in run
result = self.fn(*self.args, **self.kwargs)
File “/srv/homeassistant/homeassistant_venv/lib/python3.5/site-packages/homeassistant/components/wink/init.py”, line 320, in setup
pywink.get_subscription_key())
File “/srv/homeassistant/homeassistant_venv/lib/python3.5/site-packages/pywink/api.py”, line 565, in get_subscription_key
response_dict = wink_api_fetch()
File “/srv/homeassistant/homeassistant_venv/lib/python3.5/site-packages/pywink/api.py”, line 584, in wink_api_fetch
raise WinkAPIException(“401 Response from Wink API. Maybe Bearer token is expired?”)
pywink.api.WinkAPIException: 401 Response from Wink API. Maybe Bearer token is expired?

Noteworthy: If I go to the 192.168.1.XX:8123/auth/wink/callback I get a 404: Not Found

Any help would be appreciated. I’m not sure why this just stopped working.

You can’t delete the .wink.conf while HA is running. You have to stop the service, then delete the file, and then restart. Part of the shutdown process is to write the current values in to the .wink.conf.

Also you don’t navigate to auth/wink/callback you should never have to type that. You navigate to /auth/wink and after authenticating you automatically get sent to the callback url.

I shutdown HA and deleted the file. Also /auth/wink provides the same: 404: Not Found.

You are navigating to auth/wink when the configurator says to? The endpoint is only available when the configurator indicates you should navigate to it.

Here are a few mistakes I noticed. One I had spaces in front of both ID and Secret after copy/pasting from the wink developer page.

When I got to the 401 page, edit the URL.

change it to your IP address of HA plus the :8123 port. Then refresh. After that I was able to sign in.