Oh well, at least now you have an easier method. Always impressed by the amount of info and troubleshooting possible with Wink@Home.
BTW, for other users that may not be familiar with this - Wink@Home is an online web interface for Wink systems. Itâs available at www.winkathome.net.
Yup. Accept it was a remote that caused my issue. I think I saw other devices too but canât be 100% sure. The remote was how I tested until it was fixed. Iâd reboot, use the remote and then no Wink updates. I quoted my errors above:
So I know you arenât seeing the pubnub error now, but do you still see the error above that when using the remote?
That shouldnât be happening. It looks like python-wink is confused about your remote, acting like it is a hub. Do you have a binary sensor called binary_sensor.office_remote_hub?
I am not sure how that would cause this problem, but I wonder if pubnub handler object is getting destroyed in home assistant, and pubnub is still running in another thread so it trys to call whatever that loop method is and then dies too.
I am catching the errors that I think pubnub and wink can through inside of home-assistant. I wonder if maybe that is too late and pubnub has died at that point. Maybe I need to catch the errors in pubnubsub-handler?
I see what you mean. I missed the word hub in that error. But to answer your question no I am not getting that error anymore. I am occasionally getting a few errors now but they seem to be related to a DropCam I have hooked up to Nest:
17-01-10 13:33:53 aiohttp.server: Error handling request
Traceback (most recent call last):
File "/home/hass/deps/aiohttp/web_server.py", line 61, in handle_request
resp = yield from self._handler(request)
File "/home/hass/deps/aiohttp/web.py", line 249, in _handle
resp = yield from handler(request)
File "/usr/lib/python3.4/asyncio/coroutines.py", line 143, in coro
res = yield from res
File "/usr/lib/python3.4/asyncio/coroutines.py", line 143, in coro
res = yield from res
File "/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/components/http/__init__.py", line 427, in handle
result = yield from result
File "/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/components/camera/__init__.py", line 186, in get
response = yield from self.handle(request, camera)
File "/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/components/camera/__init__.py", line 204, in handle
image = yield from camera.async_camera_image()
File "/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/components/camera/__init__.py", line 91, in async_camera_image
None, self.camera_image)
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 269, in result
raise CancelledError
concurrent.futures._base.CancelledError
Just for the heck of it I checked my logs and they are clean - single error, which is something I know about thatâs informational and not related.
Just triggered the top load switch on my relay from HA to see if it would cause an error and waited but saw nothing.
Then triggered the physical switch and immediately got the error!
17-01-10 17:23:59 homeassistant.components.wink: Error in pubnub JSON for Wink Relay's Top Button hub polling API for current state
17-01-10 17:23:59 pubnub: take message interrupted: 'NoneType' object has no attribute 'loop'
Odd thing is that I canât duplicate it. I tried the bottom switch, which is not connected to a load but instead fires a shortcut. No error. Then I thought, maybe itâs just the load switches and pressed the top load switch but again, no new error.
But like I said, my log was clean until I hit that switch for the first time and the error matched the time perfectly.
Cool! Now we might be on to something. So, can you test something for me? Clearly there is an issue with things thinking they are hubs when really they arenât. Based on your message it looks like you probably have a binary_sensor.wink_relays_top_button_hub? That shouldnât be there, but even though it is I donât think you should be getting this error, so can you change your wink.py in your custom_components directory from this.
def _pubnub_update(self, message):
try:
if message is None:
_LOGGER.error("Error on pubnub update for %s "
"polling API for current state", self.name)
self.update_ha_state(True)
else:
self.wink.pubnub_update(message)
self.update_ha_state()
except (ValueError, KeyError, AttributeError):
_LOGGER.error("Error in pubnub JSON for %s "
"polling API for current state", self.name)
self.update_ha_state(True)
To this
def _pubnub_update(self, message):
try:
if message is None:
_LOGGER.error("Error on pubnub update for %s "
"polling API for current state", self.name)
self.update_ha_state(True)
else:
self.wink.pubnub_update(message)
self.update_ha_state()
except (ValueError, KeyError, AttributeError):
_LOGGER.error("Error in pubnub JSON for %s "
"polling API for current state", self.name)
_LOGGER.error(message)
self.update_ha_state(True)
Adding in the _LOGGER.error(message) that should spit out the pubnub message when you see this error to the log. I am thinking the message is bad in some way I am not expecting.
Also could you provide me with the JSON from your relay switches? Should be able to get it from wink@home.
Before I change anything, let me give you some info -
I donât have a binary_sensor.wink_relays_top_button_hub, but I do have a binary_sensor.wink_relays_bottom_button_hub
And when you say âClearly there is an issue with things thinking they are hubs when really they arenât.â you do realize that they do in fact act as hubs. When I pair a new device in, I can pair it to my Wink Hub or my Wink Relay. In fact I only have three devices paired to it, a garage tilt sensor and a GE Link light, also in the garage, because they are physically closer to my Relay than to my hub. In addition I also have another Link light connected via the Relay.
I checked this over at Wink@Home, where my relay shows up under âHubsâ along with my Wink v1 and my Hue Hub.
Relay JSON going to you via PM. Iâm holding off on any changes until I see what you think about my response on whether Relays are actually hubs or not.
I am aware they act as a hub. The problem is, you should get one sensor for each hub and I think something is getting confused and creating more. For example in @kevince52 case, I donât think he should have a hub sensor named office remote hub, I believe he has a remote called office remote, and python-wink is thinking it should be a hub, when in fact it should not. I think this is a flaw in the way I am creating the hub sensors.
I no longer see the office remote hub. I canât tell you if it existed either other than that error.
I do see my hubs which is a new thing since 3.5.3 I think. I do have one device that doesnât make sense. Something called binary_sensor.hub_hub. It reads as unavailable. I hide it because it annoys me. I think itâs an old Wink hub that I had to return because it wouldnât update. I donât see it in the Wink app but itâs been in Wink @ Home for a while.
I see a Philips Hue hub in there too even though I revoked access at meethue.com. Odd that Wink holds on to these things. I recently update from a v1 Wink hub to v2. Before this problem. Thatâs not there anymore.
Is it at all useful for me to make these edits? Iâm not getting the error anymore.
So do you see those three in home-assistant as well? They should be entities with names like binary_sensor.phillips_hue_hub and binary_sensor.wink_hub_v2.