HA stops reporting Wink state changes

:sob: I think I am out of ideas. Clearly it is able to access the API since you can turn lights in and off, so I donā€™t understand why the calls being made every hour arenā€™t working. Issuing those exact commands from an external script worked for @shire210 but donā€™t work when calling automatically. @shire210 when using the keep_alive_call as a service does it fix your problem?

Yes. Changing the call to a service did make the updates start working again. This new wink file you posted today for me still appears to be working too. Should know for sure around 7 est tonight when the old file would usually stop working

Okay, so I guess worse case we can make this a service and let everyone know to add an automation to call the service.

1 Like

That ok. It was worth a try. Maybe updating the wink hub will make it work. lol

The states stopped updating after 6 hours. I think the best option would be, like you said, to create a service and let the user set up an automation if they are having the issue.

Can you set yours back up using the service and confirm one more time that it is working? I reached out to @balloob on the PR I opened and he wasnā€™t a fan of the service, which I am not either since it will require the user to set it up. Maybe he can provide some insight into whatā€™s going on.

There is no reason to expect users to set it up. We should have the wink component set it up automatically.

Can everyone try the newest file pushed in the PR located here https://github.com/home-assistant/home-assistant/pull/7051

This is using the function @balloob suggested using an async call to execute the API polling via HomeAssistant.

Iā€™ll give it a shot. Iā€™ve had one or two sensors not update in the last day or two.

I added the new wink.py file to the custom_components folder and I am getting an error message now. And none of my lights are showing up.

17-04-17 20:50:57 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "uvloop/future.pyx", line 374, in uvloop.loop.BaseTask._fast_step (uvloop/loop.c:112704)
  File "/usr/src/app/homeassistant/setup.py", line 60, in async_setup_component
    return (yield from task)
  File "uvloop/future.pyx", line 230, in __iter__ (uvloop/loop.c:110600)
  File "uvloop/future.pyx", line 434, in uvloop.loop.BaseTask._fast_wakeup (uvloop/loop.c:114018)
  File "uvloop/future.pyx", line 146, in uvloop.loop.BaseFuture.result (uvloop/loop.c:109361)
  File "uvloop/future.pyx", line 101, in uvloop.loop.BaseFuture._result_impl (uvloop/loop.c:108900)
  File "uvloop/future.pyx", line 372, in uvloop.loop.BaseTask._fast_step (uvloop/loop.c:112669)
  File "/usr/src/app/homeassistant/setup.py", line 144, in _async_setup_component
    component = loader.get_component(domain)
  File "/usr/src/app/homeassistant/loader.py", line 141, in get_component
    module = importlib.import_module(path)
  File "/usr/local/lib/python3.5/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 986, in _gcd_import
  File "<frozen importlib._bootstrap>", line 969, in _find_and_load
  File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 669, in exec_module
  File "<frozen importlib._bootstrap_external>", line 775, in get_code
  File "<frozen importlib._bootstrap_external>", line 735, in source_to_code
  File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
  File "/config/custom_components/wink.py", line 7
    <!DOCTYPE html>
    ^
SyntaxError: invalid syntax

Looks like you downloaded the html for the page and not the actual file.

I downloaded and have it running. Iā€™ll report back tomorrow.

Whoops. That makes sense. Updated to actual file and have it running now

1 Like

Wink still stopped updating after 6 hours. Hopefully others are having better luck.

There were a few errors that popped up related to the keep_alive_call(). They do not appear every hour but it always happens around when I have the automation set to turn on the lights every hour at 30 after. (It is also around when I started HA). @w1ll1am23 I will pm you my full logs.

17-04-18 05:30:32 ERROR (Recorder) [homeassistant.core] Error doing job: Future exception was never retrieved
Traceback (most recent call last):
  File "/usr/local/lib/python3.5/concurrent/futures/thread.py", line 55, in run
    result = self.fn(*self.args, **self.kwargs)
TypeError: keep_alive_call() takes 0 positional arguments but 1 was given
17-04-18 05:30:32 ERROR (Recorder) [homeassistant.core] Error doing job: Future exception was never retrieved
Traceback (most recent call last):
  File "/usr/local/lib/python3.5/concurrent/futures/thread.py", line 55, in run
    result = self.fn(*self.args, **self.kwargs)
TypeError: keep_alive_call() takes 0 positional arguments but 1 was given

Sorry, that was my bad. The keep_alive_call method should have a input variable defined. It doesnā€™t need to be used, but it does have to be there. Iā€™ll update that and send a new one out.

Sorry, I didnā€™t get a chance to do this last night; are you saying I should wait until you get a new one out then?

Yeah, Iā€™ll send it over in an hour or so.

1 Like

No rush. I have a 3D printer arriving today and Iā€™m busy making room for it in the office!

1 Like

Unfortunately, it had stopped refreshing state when I got up this morning after the update.

@w1ll1am23 Just saw this update this morning. Should we go ahead and install?