HA stops reporting Wink state changes

I’ll rename that service when I open the PR for the pubnub version update. Thanks!

Dev is now using the newest version of pubnubsub-handler which is using the newest version of pubnub. Give that a shot and let me know how it works.

Where do I find it? Is it with the latest update of HA?

It is currently in development branch of HA you will have to run a dev copy to test it.

Updating my dev now. I will let you know the results in about 6 hours or so.

That did not solve the issue. Still cut off after 6 hours.I’ll look through the logs and see if anything stands out there, but at first glance, everything appears the same.

:frowning: that’s too bad, that would have been too easy. Its always good to test out the latest code though, before reaching out to pubnub.

I am getting some strange results running dev. Originally it stopped working after 6 hours but then it randomly started working again. Timeline is below:

  • 9:53 am - Started dev environment for first time with new pubnub version
  • 4:00 pm - stopped receiving notification that light was on
  • 4:25 pm - restarted home assistant
  • 11:00 pm - still receiving notification that light was on. Went into home assistant and saw that the light was “stuck” on. “Refreshed state from wink”, to change state to off, but toggling switch on webpage did not change state.
  • 6:00 am next day, state started updating correctly.

Below is a screenshot from home assistant.

Need more time to test what is going on.

That is strange, check for any tracebacks and post them if you have any.

I left everything alone and kept HA running from yesterday. Again it stopped at 12pm and started working again at 6am.

Seems to only work from 6am to 12pm. Not sure what to make of that.

I see the approach from @shire210 but it seems a little drastic to restart HA every 60 minutes.
Is there an option to simply refresh the state from wink every 2 hours or so automatically?
It seems to do the trick when I do it manually through the dev-service area.

Does anybodty have an idea how to automate that?

This doesn’t seem to work:

  - alias: ReConnect Wink
    trigger:
      platform: time
      hours: '/2'
      minutes: 00
      seconds: 00
    action:
      - service: wink.refresh_state_from_wink

Calling the wink refresh service from a script would need at the moment a modification of the wink.py file.
On my system the file is located under /usr/local/lib/python3.4/dist-packages/homeassistant/components

Just replace in line 119 hass.services.register(DOMAIN, ‘Refresh state from Wink’, force_update)
with hass.services.register(DOMAIN, ‘Refresh_state_from_Wink’, force_update).

Restart HA and after that you should be able to call the refresh service from an automation or script.
w1ll1am23 will have this fixed in the next version.

Works well for me.

Thanks @rainerilgen

I have changed the line in my wink.py file - let’s see, if the automation works.

For others who are looking:

  1. My wink.py file is at /srv/homeassistant/lib/python3.4/site-packages/homeassistant/components probably because I installed HA in virtual environment.

  2. And it’s in line 119.

Line 119 is correct.
I had it wrong in my post.
I have updated the Line number in my post.

Thanks guys. I just finished setting this up. Will see if it still works in the morning. :slight_smile:

So does this script work after the changes to the file? Im kinda new @ writing scripts.

Thanks

Having a new issue with mine now and wanted to see if others are experiencing it or just me. It will work fine when HA starts for the first 6 hours (seems to be what others are seeing as well) and then stop updating the state. The new development is that after that happens, it will start working again from 6am to 12pm EST every day.

Can anyone else confirm this?

Seems to work better than without this - not sure if it’s actually the automation that causes it, though.

There is an entry in the logbook that the automation has been triggered, I just don’t know if it does what it’s supposed to do yet.

Will need to play around with it a little more.

The refresh_state_from_wink service only updates the current state of the items in wink. It does not reset the connection. When your automation runs every 2 hours, it is grabbing the current state of the lights. At least that’s how I understand it from my experience.

W1ll1am has a ticket open with pubnub and they are investigating the issue. Will report back when more is known.

Bummer - looking at the graph, that’s what it seems to do exactly :frowning:

I used the manual method on via the dev-state and that seemed to fix it for a while, though.
Guess that triggered something else that the automation does not.

Thanks for the explanation!