HA stops reporting Wink state changes

As a point of reference too I am on 0.37.1. @geekoftheweek calls me a slacker at times… but wasn’t sure if I should update from the typo listed about.

Yeah, I am seeing the same error in my logs. Must be something related to pubnub. I’ll reach out to them sometime tomorrow and see if they can explain what is going on. Might have to add something into the code to alert to something like this in the future and not just break without warning.

Seems to trigger for me on a push event. My pantry door opens and sends the door open (wireless door sensor) and then the error shows up.

Seems I cannot use the door sensors for triggers at the moment.

Found the problem… looks like some new fields were added to the API out of nowhere. Unfortunately one of those fields contains the text that pubnubsub-handler is looking for in order to determine as error has occur. Go figure. So this make pubnubsub-handler blow up. Working on the fix now.

1 Like

Excellent find. Its great when people change their API without versioning or communication. :slight_smile:

Yeah I noticed a follow up error that seemed to imply the data has changed to what it was expecting.
17-02-14 00:35:20 pubnub: take message interrupted: ‘str’ object has no attribute ‘get’
17-02-14 00:36:10 homeassistant.core: Unable to find service binary_sensor/turn_off

Watch you will fix it and then they will roll it back. If you get it committed and need me to test on a GitHub version let me know. Willing to test.

Here is the fix. https://github.com/w1ll1am23/pubnubsub-handler/blob/better_check_for_data/pubnubsubhandler.py

The change is pretty simple, and should work even if they do roll back. As soon as someone else is able to verify this is working I will open the HA PR.

Just overwrite your [CONFIG DIR]/deps/pubnubsubhadndler.py with the one from above and restart. Then toggle a wink device and make sure the states are correct in HA and you don’t see the error in the log anymore.

2 Likes

Testing it now. Just replaced the one file and restarting. I can do a simple pantry door check while watching the logs to see if it works or does not work.

works for me.

Works for me too. Thanks!

Just for the record, I never got around to upgrading the firmware and I just saw that message in my logs. Seems to come around the time my mailbox sensor went off. I’ll have to test this too.

Add one more affirmative to the group. Thanks for the rapid response, @w1ll1am23!

BTW, now that I’ve manually edited pubnubsubhandler.py to incorporate the fix, will it still update to the latest version when you officially push the change?

Yeah, HA still thinks it is using version 1.0.0 when the official update comes out it will be 1.0.1 and it will get overwritten again.

I’m good here!

my fix was flawed. It will work for anyone not using locks with binary sensor keys. Sorry about that. If someone could try this one https://github.com/w1ll1am23/pubnubsub-handler/blob/better_check_for_data/pubnubsubhandler.py just to be sure. I changed the check to a try/except block and not a if string test.

D/l’ed and restarting now…

EDIT: It’s working fine as far as I can see; states are current and no errors.

1 Like

PR opened. If anyone wants to give there blessing. https://github.com/home-assistant/home-assistant/pull/5980

Thanks for the timely fix. Just applied the new file and good to go!

Seems ok on my end so far.

I just upgraded to 0.38.2 and my wink/HA connection is worse than ever. No matter whether I turn a light on or off, HA updates for a second and then goes back to the other state. For example, My den fan lights currently show on and they are on. If I click to turn them off in HA, the lights themselves turn off, but ha goes back to showing them on. No matter how many times then that I click HA, it keeps saying it’s turning them off but the user interface always goes back to on. Very Very frustrating.

You’ll need to follow @w1ll1am23 fix (above) for the time being. Pubnub changed their API so all versions will have this issue right now even if you roll back.