HA stops reporting Wink state changes

You can just log wink I would think.

Just did a restart and noticed this. Its the IP of my wink hub.
17-02-15 16:22:49 ERROR (Thread-15) [netdisco.ssdp] Error fetching description at https://192.168.1.145:8888

It was good while it lasted.

Back to not updating. Can see updates in the Wink app. Can see HA continuing to change Wink items, just not when the actions are dependent on a sensor connected to Wink. And even though HA changes the status in Wink, the change is not reflected in the HA frontend.
Only errors in the log around the time that things stopped reporting:

17-02-15 17:28:56 ERROR (MainThread) [homeassistant.core] Error doing job: Fatal read error on socket transport
Traceback (most recent call last):
  File "/usr/lib/python3.4/asyncio/selector_events.py", line 582, in _read_ready
    data = self._sock.recv(self.max_size)
OSError: [Errno 113] No route to host
17-02-15 18:45:51 ERROR (MainThread) [homeassistant.core] Error doing job: Fatal read error on socket transport
Traceback (most recent call last):
  File "/usr/lib/python3.4/asyncio/selector_events.py", line 582, in _read_ready
    data = self._sock.recv(self.max_size)
OSError: [Errno 113] No route to host

I get that error every restart. I didnā€™t actually realize that it was the Wink hub, but now that you mention it, I think it is. But Iā€™ve always assumed it was an error from the nmap device tracking.

I think it has something to do with discovery. The Wink hub responds to a query made, but the response is invalid. It isnā€™t an error.

I believe every error we have seen related to this always logs something with ā€œtake messageā€ in it. Can you try searching your log for that?

1 Like

Iā€™m afraid i donā€™t remember exactly my upgrade history, but if i could find it i might be able to narrow it down. Is there a way to know what versions weā€™ve run in the past? I know suddenly thereā€™s lot of chatter but for me this was preexisting to .38 in .37 and Iā€™d like to confirm which version i was on previous because that was problem free, that might help point the finger a bit.

The No route to host would seem to indicate some type of network error. For some reason HA canā€™t find a path to the IP address itā€™s trying to get to. Can you tell me a little about your network configuration (routers, switches, is everything plugged into the same switch, are your devices static address or dhcp)

Secondly, does the not reporting always happen with the same device type? Iā€™ve noticed that when I try to turn off a dimmer switch that because the switch dims to turn out the light, that Iā€™ll usually end up with HA signifying that the light is on for a while when itā€™s actually already turned off. It may take up to a minute before HA gets the signal that the light has actually turned off.

You mean home-assistant.log? If so, then nothing with the word ā€œmessageā€ shows up. I donā€™t know if that error was Wink-related at all. I grabbed it because the time stamps were closest to when I seemed to stop getting Wink updates, but I actually have that error logged a number of times, even when Wink is reporting just fine, so it is likely something else.

Also, in every other case of HA failing to update Wink data, I eventually would solve it, temporarily, with a restart of HA. This time I decided to wait until I got home to deal with it, and by that time, it had self-corrected. Iā€™ve never seen HA go back to working properly with Wink without my intervention before, so maybe this was a fluke. I will keep an eye on it today and see what happens.

Donā€™t know what, if any, specific device might be triggering the issue. In yesterdayā€™s case, I wasnā€™t home, but my wife was. I only know generally when the freeze happened. Iā€™m use to a slight delay in the HA front end when I toggle a light or switch via Wink, but this freeze lasted about 4 hours.

Wow, 4 hours. Definitely not what I was experiencing.

Any other problems getting to the internet or anything during the freeze time?

Here is what I am seeingā€¦

17-02-15 17:01:27 DEBUG (EndpointThread-Heartbeat-0) [pubnub] GET https://ps.pndsn.com/v2/presence/sub-key/...
17-02-15 17:01:27 DEBUG (EndpointThread-Heartbeat-0) [pubnub] GOT {"status": 200, "message": "OK", "service": "Presence"}

Then I flip turn on a switch, the device turns on but HA is not updated.

17-02-15 17:08:31 INFO (MainThread) [homeassistant.core] Bus:Handling <Event call_service[L]: domain=homeassistant, service=turn_on, service_call_id=140348561987848-15, service_data=entity_id=switch.game_room>
17-02-15 17:08:31 INFO (MainThread) [homeassistant.core] Bus:Handling <Event call_service[L]: domain=switch, service=turn_on, service_call_id=140348561987848-16, service_data=entity_id=['switch.game_room']>
17-02-15 17:08:32 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_executed[L]: service_call_id=140348561987848-16>
17-02-15 17:08:32 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_executed[L]: service_call_id=140348561987848-15>

When it is working this is what I am seeing.

17-02-15 10:39:12 INFO (MainThread) [homeassistant.components.http] Serving /api/services/homeassistant/turn_on to 192.168.1.83 (auth: True)
17-02-15 10:39:12 INFO (MainThread) [homeassistant.core] Bus:Handling <Event call_service[L]: domain=homeassistant, service=turn_on, service_call_id=140348561987848-1, service_data=entity_id=switch.game_room>
17-02-15 10:39:12 INFO (MainThread) [homeassistant.core] Bus:Handling <Event call_service[L]: domain=switch, service=turn_on, service_call_id=140348561987848-2, service_data=entity_id=['switch.game_room']>
17-02-15 10:39:12 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_executed[L]: service_call_id=140348561987848-2>
17-02-15 10:39:12 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_executed[L]: service_call_id=140348561987848-1>
17-02-15 10:39:12 DEBUG (EndpointThread-Subscribe-0) [pubnub] GOT {"t":{"t":"14871767527361367","r":1}....
17-02-15 10:39:12 DEBUG (EndpointThread-Subscribe-0) [pubnub] GET https://ps.pndsn.com/v2/subscribe/..
17-02-15 10:39:13 INFO (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: old_state=<state switch.game_room=off; friendly_name=Game Room @ 2017-02-15T10:38:46.247730-06:00>, entity_id=switch.game_room, new_state=<state switch.game_room=on; friendly_name=Game Room @ 2017-02-15T10:39:13.650540-06:00>>
17-02-15 10:39:13 DEBUG (MainThread) [homeassistant.components.websocket_api] WS 140347190143072: Sending {'type': 'event', 'event': {'data': {'old_state': <state switch.game_room=off; friendly_name=Game Room @ 2017-02-15T10:38:46.247730-06:00>, 'entity_id': 'switch.game_room', 'new_state': <state switch.game_room=on; friendly_name=Game Room @ 2017-02-15T10:39:13.650540-06:00>}, 'origin': 'LOCAL', 'event_type': 'state_changed', 'time_fired': datetime.datetime(2017, 2, 15, 16, 39, 13, 650558, tzinfo=<UTC>)}, 'id': 2}
17-02-15 10:39:13 INFO (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: old_state=<state group.upstairs_lights=off; entity_id=('switch.game_room', 'switch.upstairs_hallway'), order=13, friendly_name=Upstairs Lights @ 2017-02-15T10:38:46.245656-06:00>, entity_id=group.upstairs_lights, new_state=<state group.upstairs_lights=on; entity_id=('switch.game_room', 'switch.upstairs_hallway'), order=13, friendly_name=Upstairs Lights @ 2017-02-15T10:39:13.652938-06:00>>
17-02-15 10:39:13 DEBUG (MainThread) [homeassistant.components.websocket_api] WS 140347190143072: Sending {'type': 'event', 'event': {'data': {'old_state': <state group.upstairs_lights=off; entity_id=('switch.game_room', 'switch.upstairs_hallway'), order=13, friendly_name=Upstairs Lights @ 2017-02-15T10:38:46.245656-06:00>, 'entity_id': 'group.upstairs_lights', 'new_state': <state group.upstairs_lights=on; entity_id=('switch.game_room', 'switch.upstairs_hallway'), order=13, friendly_name=Upstairs Lights @ 2017-02-15T10:39:13.652938-06:00>}, 'origin': 'LOCAL', 'event_type': 'state_changed', 'time_fired': datetime.datetime(2017, 2, 15, 16, 39, 13, 652953, tzinfo=<UTC>)}, 'id': 2}

Well, I wasnā€™t home during that time, but my wife was in and out of the house and is pretty quick to say something if the internet isnā€™t working. Also I only discovered this situation by SSHing into my Pi, so clearly I wasnā€™t having a general outage.

If pubnub isnā€™t responding I would expect to see some sort of ā€œtake messageā€ error prior (maybe way prior) to the attempt to turn in the switch. If you arenā€™t seeing any errors it is going to be very difficult to figure out what is going on, and chances are it isnā€™t something in HA/python-wink/Punnubsub-handler

Hi w1ll1am23,

I have a similar or possible same issue Rob3E3 is having.
After HA was restarted Wink lights are reporting the state correctly. After a to me unknown time the state of my Wink lights isnā€™t reported in HA anymore.

I did some testing.
7 am HA restarted.
9 am HA is switching the lights off via script and HA is showing the correct status.
2 pm I switch on a Wink light via HA and the light comes on, but HA doesnā€™t show the correct state.

I checked the log file and Iā€™m unable to see any errors.
So I wonder if that might be more an error with the HA front end.

Here are some snippets of the log file:

17-02-16 14:33:53 DEBUG (MainThread) [homeassistant.components.websocket_api] WS 2664599984: Received {ā€˜typeā€™: ā€˜call_serviceā€™, ā€˜domainā€™: ā€˜homeassistantā€™, ā€˜serviceā€™: ā€˜turn_onā€™, ā€˜idā€™: 9, ā€˜service_dataā€™: {ā€˜entity_idā€™: ā€˜light.sofa_readingā€™}}
17-02-16 14:33:53 INFO (MainThread) [homeassistant.core] Bus:Handling <Event call_service[L]: domain=homeassistant, service=turn_on, service_call_id=3053725296-74, service_data=entity_id=light.sofa_reading>
17-02-16 14:33:53 INFO (MainThread) [homeassistant.core] Bus:Handling <Event call_service[L]: domain=light, service=turn_on, service_call_id=3053725296-75, service_data=entity_id=[ā€˜light.sofa_readingā€™]>
17-02-16 14:33:54 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_executed[L]: service_call_id=3053725296-75>
17-02-16 14:33:54 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_executed[L]: service_call_id=3053725296-74>
17-02-16 14:33:54 DEBUG (MainThread) [homeassistant.components.websocket_api] WS 2664599984: Sending {ā€˜typeā€™: ā€˜resultā€™, ā€˜successā€™: True, ā€˜idā€™: 9, ā€˜resultā€™: None}

The light on was triggered and websocker_api is sending a response. The Light came on, but HA is still showing it as off.

17-02-16 13:49:41 DEBUG (EndpointThread-Subscribe-0) [pubnub] GOT {ā€œtā€:{ā€œtā€:ā€œ14872602777691559ā€,ā€œrā€:2},ā€œmā€:}
17-02-16 13:49:41 DEBUG (EndpointThread-Subscribe-0) [pubnub] GET https://ps.pndsn.com/v2/subscribe/&tr=2&pnsdk=PubNub-Python%2F4.0.5&tt=14872602777691559

And here is a live sign from pubnub prior to my test. And I see similar log entries after my test.

netstat -anp --tcp | grep ā€™ 54.ā€™
tcp 0 0 192.168.178.12:38849 54.209.255.70:443 ESTABLISHED 32578/python3
tcp 0 0 192.168.178.12:38850 54.209.255.70:443 ESTABLISHED 32578/python3

And netcat shows that the connection to the pubnub server is live.

So could it be that we are chasing an error in the wrong spot?

Thank you for looking into this with us. Iā€™m more than happy to answer your questions and supply any logs or test results.

Did you edit your log in anyway? The [pubnub] GET response should have a list of all of the subscribed to channels in it.

Can someone who is having this problem start with a fresh restart of HA and go through every Wink device they own (while watching the HA frontend/logs) and trigger a state change?

It is also worth noting that in the event that pubnub gets disconnected it will attempt to reconnect, but will do so exponentially so maybe there is some sort of network issue going on and it corrects itself eventually? Kinda like what @Rob3E3 reported? Just a thought.

Yes, I removed some data from the GET request.
I restarted HA and switched my 3 Wink lights on and off via HA. Then I switched them on and off via the Wink App.
HA is reporting the state correct.

I noticed that the Websocket API Sending part is different.
I will send you the log file via PM.

It it was something with Websockets I would assume logging into another browser display the correct state. Also any automations based on Wink device states would still fire. Based on some above comments I donā€™t think that is the case. Could you try setting up some sort of automation based on a light state and see if it fires even if the state isnā€™t displaying correctly in the frontend?

Sure. I will setup a test environment with just the Wink lights.
An automation will switch on and off the light every hour based on the current state of the light.
This way I hope to get a log file without unrelated entries.
As soon I have the test done I will send the log file.

2 Likes