Wink/PubNub not updating

Yep it still download from ps.pndsn.com
(Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by ‘ReadTimeoutError(“HTTPSConnectionPool(host=‘ps.pndsn.com’, port=443): Read timed out. (read timeout=10)”)’:

I don’t see anything about notifier.wink.com. Do I need to change anything in my config file?

I have:

wink:
   local_control: True

I’m getting:

May 05 09:29:59 automation hass[30820]: 2019-05-05 09:29:59 ERROR (MainThread) [homeassistant.setup] Error during setup of component wink
May 05 09:29:59 automation hass[30820]: Traceback (most recent call last):
May 05 09:29:59 automation hass[30820]:   File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/setup.py", line 156, in _async_setup_component
May 05 09:29:59 automation hass[30820]:     component.setup, hass, processed_config)  # type: ignore
May 05 09:29:59 automation hass[30820]:   File "/usr/lib/python3.5/asyncio/futures.py", line 380, in __iter__
May 05 09:29:59 automation hass[30820]:     yield self  # This tells Task to wait for completion.
May 05 09:29:59 automation hass[30820]:   File "/usr/lib/python3.5/asyncio/tasks.py", line 304, in _wakeup
May 05 09:29:59 automation hass[30820]:     future.result()
May 05 09:29:59 automation hass[30820]:   File "/usr/lib/python3.5/asyncio/futures.py", line 293, in result
May 05 09:29:59 automation hass[30820]:     raise self._exception
May 05 09:29:59 automation hass[30820]:   File "/usr/lib/python3.5/concurrent/futures/thread.py", line 55, in run
May 05 09:29:59 automation hass[30820]:     result = self.fn(*self.args, **self.kwargs)
May 05 09:29:59 automation hass[30820]:   File "/home/homeassistant/.homeassistant/custom_components/wink/__init__.py", line 250, in setup
May 05 09:29:59 automation hass[30820]:     from pubnubsubhandler import PubNubSubscriptionHandler
May 05 09:29:59 automation hass[30820]:   File "/srv/homeassistant/lib/python3.5/site-packages/pubnubsubhandler.py", line 26
May 05 09:29:59 automation hass[30820]:     def __init__(self, origin="https://notifier.wink.com", sub_key, keep_alive_function=None, keep_alive=3600,
May 05 09:29:59 automation hass[30820]:                 ^
May 05 09:29:59 automation hass[30820]: SyntaxError: non-default argument follows default argument

Joining the fray!

I’m seeing custom wink load, but fail in setup. Looks like something else needs to be updated in init.py Here’s the log:

2019-05-05 08:26:56 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for wink whic
2019-05-05 08:26:57 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for custom_up
2019-05-05 08:27:00 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for life360 w
2019-05-05 08:27:42 ERROR (MainThread) [homeassistant.setup] Error during setup of component wink
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/homeassistant/setup.py", line 156, 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 "/config/custom_components/wink/__init__.py", line 250, in setup
    from pubnubsubhandler import PubNubSubscriptionHandler
  File "/config/deps/lib/python3.7/site-packages/pubnubsubhandler.py", line 26
    def __init__(self, origin="https://notifier.wink.com", sub_key, keep_alive_function=None, keep_alive=3600,
                ^
SyntaxError: non-default argument follows default argument

Ahh I did something wrong, hold up let me get beta 3 up.

In the mainifest.json file in the wink folder in the custom_components folder change the version of pubnubsub-handler from 1.0.3b2 to 1.0.3b3 and restart.

I think you needed to remove sub_key since it was replaced by origin=

Connection handler for PubNub Subscriptions.
"""

def __init__(self, origin="https://notifier.wink.com", keep_alive_function=None, keep_alive=3600,
             sub_delay=1):

Just moved the origin to the end. sub_key is still needed. Can’t have a default value set in front of arguments that don’t have default arguments.

Yep, just tested my (invalid) theory. Will test your fix now…

EDIT: like this, I assume:

def __init__(self, sub_key, keep_alive_function=None, keep_alive=3600,
             sub_delay=1, origin="https://notifier.wink.com"):

EDIT-2: Hmmm, “name does not resolve”?

2019-05-05 08:56:45 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for wink which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you do experience issues with Home Assistant.
2019-05-05 08:56:46 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for custom_updater which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you do experience issues with Home Assistant.
2019-05-05 08:56:49 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for life360 which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you do experience issues with Home Assistant.
2019-05-05 08:56:59 ERROR (EndpointThread-Subscribe-0) [pubnub] Exception in subscribe loop: Connection Error: HTTPSConnectionPool(host='https', port=443): Max retries exceeded with url: //notifier.wink.com/v2/subscribe/sub-c...<and a whole lot more...>
(Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x70cb7950>: Failed to establish a new connection: [Errno -2] Name does not resolve'))

This worked! Haven’t validated everything, but one light was turned on via Wink and the state came through to HASS

1 Like

Now, what’s a guy need to do to get the other custom components to work with this in there too? Any ideas?

Any luck with sensors reporting ?

Sure are! Just tested a door sensor. First time in 48+ hours for me.

I’m pretty new to home assistant, and linux in general. What did you do to get it to work? I put the wink folder from the download link provided in the /config folder. I have no other custom components. I edited the manifest to use 1.0.3b3 like advised above. I still see it trying to connect to pubhub.

I’m not sure how to check if the custom component is being pulled in

I also removed the https:// it should just be the domain not the https:// part.

Just drop the wink folder in to your custom_components folder

OK, states now seem to be working and updating properly again after making the change to manifest.json.

But I am getting this error:

2019-05-05 10:06:15 ERROR (EndpointThread-Subscribe-0) [pubnub] Exception in subscribe loop: Connection Error: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))
2019-05-05 10:06:16 ERROR (EndpointThread-Subscribe-0) [pubnub] Exception in subscribe loop: Connection Error: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))
2019-05-05 10:06:17 ERROR (EndpointThread-Subscribe-0) [pubnub] Exception in subscribe loop: Connection Error: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))
2019-05-05 10:07:18 ERROR (EndpointThread-Subscribe-0) [pubnub] Exception in subscribe loop: Connection Error: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))
2019-05-05 10:08:19 ERROR (EndpointThread-Subscribe-0) [pubnub] Exception in subscribe loop: Connection Error: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))
2019-05-05 10:11:35 ERROR (EndpointThread-Subscribe-0) [pubnub] Exception in subscribe loop: Connection Error: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))

Restart again and check the log to see if pubnubsub-handler gets downloaded. Sometime pypi is slow to update so the cache thinks the package isn’t available

1 Like

I haven’t even implemented your fix… and my wink stuff is reporting states to HA again…

I’m happy… but also confused. :face_with_raised_eyebrow:

I would hope that Wink is working on getting the official PubNub stuff fixed for people who haven’t updated their apps and stuff so maybe they have got their PubNub stuff working again? Hard to say. Could also only be implementing the Wink Pubnub for some accounts and not others.

The API is sending the origin back so I will need to make an update to use the origin Wink is sending and not hard code one or the other like I am doing now.