HA stops reporting Wink state changes

Yikes. Hate to hear that as I still haven’t installed mine yet - have to get an electrician in for the outlet and a plumber for the pipe.

@w1ll1am23, yep I’ll send it over in a little while.

@rpitera, I was told by Wink that the Leaksmart sensors are actually the problem and that it’s being worked on. That being said, it seems like most of the time when the valve goes offline one of my Link bulbs goes with it. So I’m not sure if it’s the sensor screwing up the Zigbee network or the bulbs that are causing all the issues.

Hmmm just ran update to .37 and Wink doesn’t work at all. Getting this error:

17-01-28 22:43:44 ERROR (MainThread) [homeassistant.bootstrap] Error during setup of component wink
Traceback (most recent call last):
  File "/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/bootstrap.py", line 151, in _async_setup_component
    None, component.setup, hass, config)
  File "/usr/lib/python3.4/asyncio/futures.py", line 388, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/lib/python3.4/asyncio/tasks.py", line 286, in _wakeup
    value = future.result()
  File "/usr/lib/python3.4/asyncio/futures.py", line 277, in result
    raise self._exception
  File "/usr/lib/python3.4/concurrent/futures/thread.py", line 54, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/components/wink.py", line 90, in setup
    token = token_response.text.split(':')[1].split()[0].rstrip('<br')

Any idea why.

Also if I use my API client_id and secret I get error that it has expired. Odd. All was working fine on the pre-release.

I just tested a fresh install with and without my client_id and secret with no problems. Make sure you cleared out any wink.py files you may have had in your custom_components directory. Also, the error from above looks like it is missing the bottom section of the traceback, if you are still seeing this copy the error from the log again and get try to get a few lines above and below the Traceback.

Just restarted with my dev install and got the “Maybe token expired?” message. I am thinking Wink may be having some trouble at the moment?

Still no luck. This is the complete log. I have disabled any components causing other errors:

17-01-29 10:28:28 ERROR (MainThread) [homeassistant.bootstrap] Error during setup of component wink
Traceback (most recent call last):
  File "/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/bootstrap.py", line 151, in _async_setup_component
    None, component.setup, hass, config)
  File "/usr/lib/python3.4/asyncio/futures.py", line 388, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/lib/python3.4/asyncio/tasks.py", line 286, in _wakeup
    value = future.result()
  File "/usr/lib/python3.4/asyncio/futures.py", line 277, in result
    raise self._exception
  File "/usr/lib/python3.4/concurrent/futures/thread.py", line 54, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/components/wink.py", line 90, in setup
    token = token_response.text.split(':')[1].split()[0].rstrip('<br')
IndexError: list index out of range

Seems related to the credentials. Should that line (90 wink.py) read:

token = token_response.text.split(':')[1].split()[0].rstrip('<br>')

not

token = token_response.text.split(':')[1].split()[0].rstrip('<br')

Just got done with all the renaming - had to go through groups, customize and automations - but not seeing any token or authentication issues over here.

[Edit for clarification: I am using client_id/client_secret.]

Had an issue with the Pivot Power Genius, but it was transient and after the rename restart I’m not seeing it again.

So far so good. Will keep an eye on things.

When I plugin the access_token manually I don’t get the error. I am still getting it with client id and secret and with my user and password. I can work with this but I don’t think this is my configuration. The user and password are right. I used them to login to winkathome and gett access_token.

I verified that code is correct, the second split() is splitting on white space. The response comes back with a <br > so the trailing > is already gone.

I was able to recreate the error you are getting using an invalid password in my config using the form and using the client_id and secret. Make sure you aren’t wrapping it in "" or you don’t have any extra spaces.

Can you try running the below wink.py in your config/custom_components directory and see what the log says? You should end up with a log entry above the Traceback showing the response text from the homeassistant.io form.

http://pastebin.com/HGBnG5LW

I need to add some useful error logging around this block of code.

@w1ll1am23:

I seem to be getting that error about the Pivot Power outlets again:

17-01-29 10:53:41 ERROR (SubscribeMessageWorker) [homeassistant.components.wink] Error in pubnub JSON for Outlet #1 polling API for current state
17-01-29 10:53:41 ERROR (SubscribeMessageWorker) [homeassistant.components.wink] Error in pubnub JSON for Outlet #2 polling API for current state
17-01-29 10:53:41 ERROR (SubscribeMessageWorker) [homeassistant.components.wink] Error in pubnub JSON for Outlet #1 polling API for current state
17-01-29 10:53:42 ERROR (SubscribeMessageWorker) [homeassistant.components.wink] Error in pubnub JSON for Outlet #2 polling API for current state

Let me know if you need the JSON from Wink@Home. If so, I’ll PM you with it.

That isn’t an error, well technically I guess it is, but that is how I address what pubnub is sending.

Let me try to explain

Pubnub send back a state update any time something chages, so for example you turn on a light and pubnub pushes that state change back down to pubnubsub-handler which then pushes it to hass which then pushes it to python-wink which hass then queries python-wink for the new state. Kinda wonky, but it works.

So when you make a chance to a device that has “sub devices” like the power strip or the spotters, the above process occurs X number of times for however many devices there are. In the case of the powerstrip, that would happen 3 times. It is happening really quick and pubnub can’t keep up. So pubnub sends back a response, and says hey changes are happening too quick, poll the Wink API and they should have the latest state for you.

So you may see that “error” from time to time but it is a valid/safe to ignore error as long as you don’t see any tracebacks after it.

1 Like

:grimacing: Reset password and all working fine now. Sorry should have tried that first. All with API credentials. Now to do a bit of renaming.

Thanks for your great work. Makes me not regret buying hub v2.

1 Like

Sweet! Glad its working. Like I said, I really need to add some better error logging.

Thanks; that explains it well. So I won’t worry about seeing them occasionally.

I seem to be getting this error since upgrade to .37. Related to Wink

    During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.4/asyncio/tasks.py", line 233, in _step
    result = coro.throw(exc)
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/core.py", line 1052, in _event_to_service_call
    yield from service_handler.func(service_call)
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/components/light/__init__.py", line 242, in async_handle_light_service
    yield from light.async_turn_on(**params)
  File "/usr/lib/python3.4/asyncio/futures.py", line 388, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/lib/python3.4/asyncio/tasks.py", line 286, in _wakeup
    value = future.result()
  File "/usr/lib/python3.4/asyncio/futures.py", line 277, in result
    raise self._exception
  File "/usr/lib/python3.4/concurrent/futures/thread.py", line 54, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/components/light/wink.py", line 111, in turn_on
    self.wink.set_state(True, **state_kwargs)
  File "/home/homeassistant/.homeassistant/deps/pywink/devices/light_bulb.py", line 83, in set_state
    "desired_state": desired_state
  File "/home/homeassistant/.homeassistant/deps/pywink/api.py", line 36, in set_device_state
    headers=API_HEADERS)
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/requests/api.py", line 124, in put
    return request('put', url, data=data, **kwargs)
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/requests/api.py", line 56, in request
    return session.request(method=method, url=url, **kwargs)
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/requests/sessions.py", line 488, in request
    resp = self.send(prep, **send_kwargs)
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/requests/sessions.py", line 609, in send
    r = adapter.send(request, **kwargs)
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/requests/adapters.py", line 497, in send
    raise SSLError(e, request=request)
requests.exceptions.SSLError: EOF occurred in violation of protocol (_ssl.c:600)

I got that one but it was transient and a restart cleared it up.

Yeah, that isn’t new to 0.37 it is some sort of timeout when accessing Winks API. I was hoping it would be better with 0.37 because we poll the API only twice during startup verses X number of times based on the number of types of devices you have. Apparently that isn’t the case.

Like @rpitera said, a reboot should fix it. Any time I have seen it a reboot or two and it goes away.

Thanks, I’ll try another reboot.

Definitely a Wink issue? I had been wondering. I have a GoControl motion detector that sometimes becomes “Unavailable” in the early hours of the morning. No other sensor registers a problem, but it’s also a time when no other sensor would be expected to have a state change. Never could figure out if it was a Wink thing or an HA thing or even a GoControl thing.

I see this too, though less often now with the update. Of course it’s only been a few hours so empirical testing will need to be done, but I do see this with one GoControl window sensor and one of the PIR sensors as well.

The window one is the one that bugs me because another sensor from the same package on the window next to it, never goes unavailable.

It’s for sure not a GoControl thing, because the one that I’m having all the issues with is an Ecolink. I see it go offline quite a bit but that never causes me any issues, it’s when it reports motion when nobody’s home or in the middle of the night. This is happening daily for me. It also coincides with temperature readings in my Leaksmart sensors showing random temperatures at the same moment, easy to see on the temp graphs. I can watch it all happen in the Wink app if I power cycle the hub, which is why I can say it’s definitely a Wink issue.