Wink errors/reconfiguration

Great timing I am updating the doc page now and was wondering what I should put for the website info.

Just submitted the changes for the documentation, it should be live shortly. Check them out and let me know what you think.

@brg468 @harvey @n0dyjeff @DarthSebulba04

1 Like

The revised documentation looks good. Thanks for doing that so quickly! Have submitted my request and hope to hear back from Wink soon. Will update when Iā€™ve received it and things are back working again.

1 Like

Looks good to me!

1 Like

It looks like local control was the problem. It was able to load all states and toggle the beeper on and off.

Iā€™ll take a look at the docs later tonight.

Thanks for your help!

Looks good and straight forward!

1 Like

Is this still a problem? I managed to get through the setup through the
wink:
only configurator, and get the success message, but then the configurator stills shows on all my pages. Iā€™m getting the same 401 error in my homeassistant log, and Iā€™m wondering if itā€™s api related.

Iā€™m also wondering where I can update client_id and secret. Iā€™ve seen whispers of a separate wink.yaml file, but I donā€™t know if thatā€™s still created with the new method.

There is a .wink.conf file its hidden. It should be deleted and you should attempt to set up wink again. Also make sure you are using client id and secret from developer.wink.com not from an email.

Excellent. That did it. I looked for that file during all the initial troubles I was having, apparently related to SSL/TLS, domains, and port forwarding. I mustā€™ve not done it after it was created.

The file I deleted had the client_id, but no secret. In case thatā€™s useful. Regardless, my wink relay is showing under the states tab. Next, Iā€™ve got to figure out the right syntax to get them into my groups. Thanks.

I am having the same problems. I have tried to get everything set up as described, but unsuccessfully.
I have an approved application authorization, and have gone to https://developer.wink.com/clients and find that I have been assigned a client id and client secret. I moved the ā€œ.wink.confā€ file out of the ā€œ.homeassistantā€ directory.
When I go to the address for configuration http://192.168.1.xxx:8123/auth/wink, I get ā€œNo code returned from Wink APIā€.

Are you prompted with the login before you get the no code message?

No, I wasnā€™t, but things have changed for no observable reason.
Now when I go to: http://192.168.1.100:8123/auth/wink
I get:
ā€œClient is not authorized or could not be found.ā€
At one point HA asked me for the client id and client secret. I entered them, but nothing changed. Tried a reboot and things went back to the old situation with HA.

Port forwarding is set up in the router for the HA host. I am wondering if my new bitdefender box could be causing problems.

No I doubt that. Other people have reported this same issue. Can you PM me the URL that you are getting redirected to when you get that error?

I can start a new thread if need be but Iā€™ve only ever been using Wink with the new developer account method, I never set it up using the old process at all. Here at some point after upgrading to 0.57.3 with Hassio on a Pi3 my Wink stopped working. On the main Overview page it says my ā€œThe following components and platforms could not be setup: wink Please check your config.ā€ I still have the same .wink.yaml file in the folder and it has my developer information in it. I found this in the log after trying to restart the system to see if that fixed it. Iā€™m not exactly sure what I need to do to resolve this. My Wink2 hub did have a firmware update recently.

2017-11-20 11:15:04 ERROR (MainThread) [homeassistant.setup] Error during setup of component wink
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/homeassistant/setup.py", line 194, in _async_setup_component
component.setup, hass, processed_config)
  File "/usr/lib/python3.6/asyncio/futures.py", line 331, in __iter__
yield self  # This tells Task to wait for completion.
  File "/usr/lib/python3.6/asyncio/tasks.py", line 244, in _wakeup
future.result()
  File "/usr/lib/python3.6/asyncio/futures.py", line 244, in result
raise self._exception
  File "/usr/lib/python3.6/concurrent/futures/thread.py", line 55, in run
result = self.fn(*self.args, **self.kwargs)
  File "/usr/lib/python3.6/site-packages/homeassistant/components/wink/__init__.py", line 320, in setup
pywink.get_subscription_key())
  File "/usr/lib/python3.6/site-packages/pywink/api.py", line 565, in get_subscription_key
response_dict = wink_api_fetch()
  File "/usr/lib/python3.6/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?

It may help if I explain how the tokens work.

When you first setup Wink a token and a refresh token are obtained from Wink. Those are written to the .wink.conf

When your token expires, python-wink (the library used by Home Assistant for wink support) uses the refresh token to get an updated token. These new tokens are stored in memory and used to make any new requests.

If Home Assistant is shutdown or restarted properly those new tokens will be written to the .wink.conf however if there is a power loss or a forced shutdown of Home Assistant those updated tokens could fail to be updated in the file.

Soā€¦ I not sure if that is what happened to you, but it sounds like it is a possibility. So I would recommend shutting down Home Assistant then deleting the .wink.conf (HA has to be shutdown before the file can be deleted because like I mentioned above the file gets written at shutdown) restart Home Assistant and set Wink up again.

I will look in to making some sort of scheduled writing of the .wink.conf that may prevent some of these issues.

2 Likes

I keep my Pi3 on a UPS to ensure it stays online and try to only stop/start HA gracefully. That doesnā€™t mean something didnā€™t cause those issues still though. Maybe during a HA upgrade it didnā€™t gracefully process?

I shutdown HA, deleted the .wink.yaml file, started HA, and redid the Wink config and now it works again. Thanks!

1 Like

Iā€™ve tried to be very careful with my Hassio setup since the Wink config was lost that last time. Itā€™s still on a UPS and Iā€™m making sure to do everything gracefully. However I lost my Wink config again.

I saw 0.62 has your save hourly fix for this so Iā€™m going to upgrade to 0.62 once itā€™s Hassio available and redo my Wink config again and keep an eye on it.

1 Like