WinkAPIException Unexpected

Anybody having issues with Wink integration all of a sudden? Getting the “Setup of wink is taking over 10 seconds.” followed by failures. I’ve cleared out the .wink.config, rebooted the Wink 2 hub, cycled HASS numerous times. Same errors…

Traceback (most recent call last):
  File "/usr/src/app/homeassistant/setup.py", line 154, in _async_setup_component
    component.setup, hass, processed_config)  # type: ignore
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/app/homeassistant/components/wink/__init__.py", line 452, in setup
    hubs = pywink.get_hubs()
  File "/usr/local/lib/python3.7/site-packages/pywink/api.py", line 569, in get_hubs
    hubs = get_devices(device_types.HUB)
  File "/usr/local/lib/python3.7/site-packages/pywink/api.py", line 699, in get_devices
    ALL_DEVICES = wink_api_fetch(end_point)
  File "/usr/local/lib/python3.7/site-packages/pywink/api.py", line 689, in wink_api_fetch
    raise WinkAPIException("Unexpected")
pywink.api.WinkAPIException: Unexpected

Was on 0.91.0 and rolled back to 0.90.2 and no difference…same issue.

Turn on debug logs for wink and restart and see what happens. Took a quick look at the code and it looks like a bad response body is coming back from the API

logger:
  default: info
  logs:
      wink: debug
      pywink.api: debug
      pubnub: debug

Interesting…

Debug cranked up and I’m getting Response 200 for the most part except right before the exception…I get a 500

2019-04-05 20:59:12 DEBUG (SyncWorker_8) [pywink.api] <Response [500]>

Wink devices are now loading in the front-end. Toggling lights/switches are super slow (a minute) and don’t update on the front-end.

Debug logging before the error isn’t showing much…

2019-04-05 20:58:56 DEBUG (SyncWorker_15) [pywink.api] Local_control_id: REMOVED

2019-04-05 20:59:01 DEBUG (SyncWorker_15) [pywink.api] <Response [200]>

2019-04-05 20:59:04 DEBUG (SyncWorker_1) [pywink.api] <Response [200]>

2019-04-05 20:59:06 WARNING (MainThread) [homeassistant.components.light] Setup of platform wink is taking over 10 seconds.

2019-04-05 20:59:06 WARNING (MainThread) [homeassistant.components.switch] Setup of platform wink is taking over 10 seconds.

2019-04-05 20:59:06 WARNING (MainThread) [homeassistant.components.cover] Setup of platform wink is taking over 10 seconds.

2019-04-05 20:59:12 DEBUG (SyncWorker_8) [pywink.api] <Response [500]>

2019-04-05 20:59:12 ERROR (MainThread) [homeassistant.components.cover] Error while setting up platform wink

  File "/usr/src/app/homeassistant/components/wink/cover.py", line 16, in setup_platform

    for shade in pywink.get_shade_groups():

  File "/usr/local/lib/python3.7/site-packages/pywink/api.py", line 654, in get_shade_groups

  File "/usr/local/lib/python3.7/site-packages/pywink/api.py", line 703, in get_devices

    json_data = wink_api_fetch(end_point)

  File "/usr/local/lib/python3.7/site-packages/pywink/api.py", line 689, in wink_api_fetch

    raise WinkAPIException("Unexpected")

pywink.api.WinkAPIException: Unexpected

2019-04-05 20:59:33 DEBUG (SyncWorker_10) [pywink.api] <Response [200]>

2019-04-05 20:59:41 DEBUG (SyncWorker_18) [pywink.api] <Response [200]>

2019-04-05 21:00:01 INFO (MainThread) [homeassistant.components.discovery] Found new service: wink {'host': '10.0.0.5', 'port': 8888, 'ssdp_description': 'https://10.0.0.5:8888'}

2019-04-05 21:00:01 INFO (MainThread) [homeassistant.components.discovery] Found new service: wink {'host': '10.0.0.14', 'port': 8888, 'ssdp_description': 'https://10.0.0.14:8888'}

2019-04-05 21:00:01 INFO (MainThread) [homeassistant.components.discovery] Found new service: wink {'host': '10.0.0.32', 'port': 8888, 'ssdp_description': 'https://10.0.0.32:8888'}

2019-04-05 21:04:17 INFO (SyncWorker_3) [pywink.api] Setting state via online API

Missed just above that where the id, secret, and tokens are coming through. I removed them but they look like the gibberish they should be.

2019-04-05 20:57:49 DEBUG (SyncWorker_5) [pywink.api] Client_id: <CLIENT> Client_secret: <SECRET> Access_token: <ACCESS_TOKEN> Refreash_token: <REFRESH_TOKEN

2019-04-05 20:58:20 DEBUG (SyncWorker_5) [pywink.api] <Response [200]>

2019-04-05 20:58:45 DEBUG (SyncWorker_5) [pywink.api] <Response [200]>

At the point of the crash it’s all get requests to Wink and if you are getting a 500 they must be having an issue because we aren’t sending anything to them. How’s the official app working?

Official app is working fine from what I can tell - not showing anything offline, actions are quick. I restarted hass again and I’m back to no devices on the front-end (lovelace errors displaying) and many “Setup failed for dependencies: wink”

I just noticed wink@home isn’t working for me either. It is redirecting to the wink login but upon trying to authenticate with my wink account, it is throwing an error.

Same issue here - app isn’t working either.

The official app could be using local control. Can you force close the app and open it back up on LTE not wifi and see if things keep working?

Ahh, there we go. It’s local control that is working. No luck on LTE. Wink must be having problems again. I assumed that at first because it’s no surprise these days but twitter was quiet and status.winkapp.com didn’t have anything related.

I have had issues several times that I know were on there end called to report it and they said nothing was wrong. That’s when I started moving things off wink. I think it is very common for one of the HA users to find a Wink issue long before Wink even knows, or at least reports that they know.

1 Like

Just agreeing with above. Wink API appears to be misbehaving for me again as well…

Same errors for me. Will wait and see.

This morning a restart initialed fine

My Wink Hub2 went offline yesterday around 6pm and must have come back at some point during the night. Wink have been having loads of issues lately

same problem there

Things seem to be back to normal this morning after a hass restart. Wink@home is also working. I don’t really use that, but a good thing to test in the future to see if Wink APIs are having a problem.

Same here, came back about 4h ago.