I do have 2 codes in mine. 1 my wife and I use and 1 for anyone else that can be reprogrammed. I don’t use them but assumed they did what @w1ll1am23 said.
Oh man, I thought that was something only the ZWave guys could get from the lock; this clears up a whole lot for me.
I almost deleted it from Wink and was going to move it over to ZWave because I thought I was missing something. Turns out I had it all the time.
Thanks so much!
Still seeing similar behavior on the latest stable release 0.36. I setup a command line sensor that looks for that error in the log and notifies me. Each time it fails (sees the log error) I verify if the Wink components are no longer updating in HA.
Did your changes make it into .36? Not in a hurry to update. Just wondering. Got an odd wink error I haven’t seen recently:
Traceback (most recent call last):
File "/usr/lib/python3.4/asyncio/tasks.py", line 233, in _step
result = coro.throw(exc)
File "/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/core.py", line 1049, in _event_to_service_call
yield from service_handler.func(service_call)
File "/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/components/light/__init__.py", line 243, in async_handle_light_service
yield from light.async_turn_off(**params)
File "/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/helpers/entity.py", line 363, in async_turn_off
None, ft.partial(self.turn_off, **kwargs))
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/light/wink.py", line 115, in turn_off
self.wink.set_state(False)
File "/home/hass/deps/pywink/devices/standard/bulb.py", line 90, in set_state
"desired_state": desired_state
File "/home/hass/deps/pywink/api.py", line 39, in set_device_state
headers=API_HEADERS)
File "/srv/hass/hass_venv/lib/python3.4/site-packages/requests/api.py", line 124, in put
return request('put', url, data=data, **kwargs)
File "/srv/hass/hass_venv/lib/python3.4/site-packages/requests/api.py", line 56, in request
return session.request(method=method, url=url, **kwargs)
File "/srv/hass/hass_venv/lib/python3.4/site-packages/requests/sessions.py", line 488, in request
resp = self.send(prep, **send_kwargs)
File "/srv/hass/hass_venv/lib/python3.4/site-packages/requests/sessions.py", line 609, in send
r = adapter.send(request, **kwargs)
File "/srv/hass/hass_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)
There are changes, yes. Hopefully they address the pubnub issues. I think the issue you are seeing is from polling the api really quickly during startup to get all devices. I see it sometimes and am able to get around it with a few restarts. I made a change in the PR I am working on to cache the response to only poll the api once during startup which should hopfully prevent this.
Sorry, I just reviewed that traceback a little more, that does look different. I am thinking it was an issue on winks side. Maybe they were too slow to respond. Is this continuous or did you only see it once?
Yeah. won’t make a difference, should be the same file but if you forgot it will cause problems later.
Oddly I don’t see the custom_components directory anymore. Could that have been deleted by the update?
Shouldn’t be. Mine never is. In fact I think specifically that installs and updates don’t touch that because some devs use it for testing.
That makes sense. Where did it go. I guess it must have been me. Wow. I’m getting old.
And… it’s back:
17-01-17 08:00:43 homeassistant.components.wink: Error in pubnub JSON for Main Floor Master hub polling API for current state
17-01-17 08:00:44 pubnub: take message interrupted: 'NoneType' object has no attribute 'loop'
That “Main Floor Master” is a pico remote. No one ever uses it. I’ll ask my wife if she used it but I’d be surprised.
I’m checking on status from my office. When I change a light in Wink HASS seems to change it back. Yikes. Wife is gonna be pissed.
Yeah, that’s going to be the case for a bit until @w1ll1am23 gets a chance to update the Wink component as well as getting an answer back from the pubnub guys.
I’ve been working with him on the support (just providing data, not doing any of the ‘heavy lifting’ like he is!) and he’s discovered a lot of things from looking at my JSON output so I think that overall Wink support is going to improve quite a bit once he’s done. One of the things he noticed is that some devices like Relay load buttons and apparently your Pico remote are being improperly read in as hubs.
It’ll be worth the wait.
@kevince52 @rpitera I think I am done with the python-wink work now. I am working on the home-assistant side now. I will test this for a few days probably, but once I am done I will need you guys to test.
There were 122 files changed in the python-wink PR resulting in 6020 lines added and 6495 lines removed. So, less lines of code with more supported devices. This next change should include camera support, remote support, relay button support, sprinkler support, and door bell support.
You know how to reach me - I’ll be glad to test. Thanks for all your hard work!
Edit: Whoa! Just realized 122 file changes; will I be able to test using the custom_components folder? I’m not sure I know how to do it another way.
Yeah I’ll get together a setp by step on what needs done. Its 122 files in python-wink so you won’t need to touch that. Should only be maybe 6 files in homeassistant.
Cool - I’m in. (I mean I would have been in anyway but this makes it less scary!)
I’m in for testing too. Let me know.
I finally was able to recreate this pubnub error which running my new code. Looks like home-assistant is throwing the error.
ERROR:homeassistant.components.wink:Error in pubnub JSON for Spotter loudness polling API for current state
ERROR:pubnub:take message interrupted: 'NoneType' object has no attribute 'loop'
Exception in thread SubscribeMessageWorker:
Traceback (most recent call last):
File "/home/w1ll1am/.virtualenvs/hass_dev/lib/python3.4/site-packages/homeassistant-0.37.0.dev0-py3.4.egg/homeassistant/components/wink.py", line 129, in _pubnub_update
self.update_ha_state()
File "/home/w1ll1am/.virtualenvs/hass_dev/lib/python3.4/site-packages/homeassistant-0.37.0.dev0-py3.4.egg/homeassistant/helpers/entity.py", line 191, in update_ha_state
self.async_update_ha_state(force_refresh), self.hass.loop
AttributeError: 'NoneType' object has no attribute 'loop'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.4/threading.py", line 911, in _bootstrap_inner
self.run()
File "/usr/lib/python3.4/threading.py", line 859, in run
self._target(*self._args, **self._kwargs)
File "/home/w1ll1am/.virtualenvs/hass_dev/config/deps/pubnub/workers.py", line 25, in run
self._take_message()
File "/home/w1ll1am/.virtualenvs/hass_dev/config/deps/pubnub/pubnub.py", line 341, in _take_message
self._process_incoming_payload(msg)
File "/home/w1ll1am/.virtualenvs/hass_dev/config/deps/pubnub/workers.py", line 85, in _process_incoming_payload
self._listener_manager.announce_message(pn_message_result)
File "/home/w1ll1am/.virtualenvs/hass_dev/config/deps/pubnub/managers.py", line 202, in announce_message
callback.message(self._pubnub, message)
File "/home/w1ll1am/.virtualenvs/hass_dev/config/deps/pubnubsubhandler.py", line 186, in message
func(json.loads(json_data))
File "/home/w1ll1am/.virtualenvs/hass_dev/lib/python3.4/site-packages/homeassistant-0.37.0.dev0-py3.4.egg/homeassistant/components/wink.py", line 133, in _pubnub_update
self.update_ha_state(True)
File "/home/w1ll1am/.virtualenvs/hass_dev/lib/python3.4/site-packages/homeassistant-0.37.0.dev0-py3.4.egg/homeassistant/helpers/entity.py", line 191, in update_ha_state
self.async_update_ha_state(force_refresh), self.hass.loop
AttributeError: 'NoneType' object has no attribute 'loop'
Looks like this is a simple fix, I’ll send out instructions later tonight or tomorrow on how you can make this change now for those of you having the problem.
Nice thanks.
@w1ll1am23 sorry i have not done much reading here.
i got the following error today followed by no state changes
17-01-18 02:49:55 pubnub: Exception in subscribe loop: Connection Error: ('Connection aborted.', BadStatusLine("''",))
17-01-18 02:49:55 pubnub: reconnection policy is disabled, please handle reconnection manually.
17-01-18 03:40:34 homeassistant.core: Error doing job: Future exception was never retrieved
Traceback (most recent call last):
File "/usr/lib/python3.4/concurrent/futures/thread.py", line 54, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/local/lib/python3.4/dist-packages/homeassistant/core.py", line 1059, in execute_service
service_handler.func(service_call)
File "/usr/local/lib/python3.4/dist-packages/homeassistant/components/wink.py", line 100, in force_update
entity.update_ha_state(True)
File "/usr/local/lib/python3.4/dist-packages/homeassistant/helpers/entity.py", line 192, in update_ha_state
).result()
File "/usr/lib/python3.4/concurrent/futures/_base.py", line 402, in result
return self.__get_result()
File "/usr/lib/python3.4/concurrent/futures/_base.py", line 354, in __get_result
raise self._exception
File "/usr/lib/python3.4/asyncio/tasks.py", line 237, in _step
result = next(coro)
File "/usr/local/lib/python3.4/dist-packages/homeassistant/helpers/entity.py", line 220, in async_update_ha_state
state = self.state
File "/usr/local/lib/python3.4/dist-packages/homeassistant/components/binary_sensor/__init__.py", line 66, in state
return STATE_ON if self.is_on else STATE_OFF
File "/usr/local/lib/python3.4/dist-packages/homeassistant/components/binary_sensor/wink.py", line 105, in is_on
return self.wink.state()
File "/root/.homeassistant/deps/pywink/devices/sensors.py", line 350, in state
return self._last_reading.get('connection', False)
File "/root/.homeassistant/deps/pywink/devices/base.py", line 41, in _last_reading
return self.json_state.get('last_reading') or {}
AttributeError: 'NoneType' object has no attribute 'get'
Just opened a PR to fix this and the NoneType errors reported above. This error you are seeing is because the pubnub API doc says the reconnection_policy should be set when it fact it should be the reconnect_policy. This is updated in pubnubsub-handler==1.0.0