I am still showing the updates stop after 6 hours with this new wink file. No errors that I can see. Wait and see what others are reporting before making final judgement. Very strange that setting it up in an automation works, but it refuses to work properly this way.
I bought a Monoprice Mini Select based on the reviews. It’s a small printer, but as I am just starting out and most of what I want to do initially is build enclosures for Ben’s sensors and a few other things, the 4.7x4.7x4.7 print volume should do fine for me.
I am definitely going to look into connecting it to Octoprint though and may even buy a dedicated pi with a camera hat for it.
@balloob Can you please see if you can figure out what is causing this to not work? If you see @shire210 comment above what he is indicating, is that when executing the same code via a manual call to the same code as a service, it fixes the problem users are having. However, when using the current code here https://github.com/home-assistant/home-assistant/pull/7051 to call the same code via an async_track_time_interval call, the commands don’t seem to be executed, or if they are, they are failing for some reason and not resulting in a Traceback in the logs.
You are not in an async context, hence you should use track_time_interval instead of async_track_time_interval. Or, after creating the task, you should enqueue it for execution: hass.add_job(async_track_time_interval(…)).
I originally used the non-async version. That is what @shire210 tested with first. Still had the same results, the call to _LOGGER was present in the logs, but the response from the calls to pywink were not output to a temporary log we setup and there were no tracebacks.
In fact using the current code with the async call the call to logging is showing up in the logs?
So… @shire210 and I have been working on this some more. It looks like the call that is made to Wink every hour has to come from a different token in order of the updates to keep working. Doesn’t make any sense… but I have managed to figure out how to come up with a way to get a new token and “poll” the API.
Can everyone that is still seeing this issue, or is using one of the previously working workarounds please test out this new file. https://hastebin.com/cakuzeyudo.py
This method will only work for client_id/client_secret setups and username/password setups. That means if you are just using an access token in your config this will not work.
Basically this fetches a new Wink token every 2 hours and after getting the new token it calls out to the Wink API /users/me endpoint and /users/me/wink_devices endpoint just to hit the API. @shire210 test this with oauth and with the email/password combo for almost an entire day for each without problems.
Lets hope this ends up working and we can finally get this fixed!
If we can get this fixed, I have some additional Wink features I would like to start putting some time in on.
Cheers to @w1ll1am23! Also found out the other day that he is responsible for a couple of other platforms including OctoPrint support. A great dev who always seems personally vested in everyone’s experience and is quick to respond to issues.
People like @w1ll1am23 make HA a great place and I just wanted to take this opportunity to thank him for all of his hard work and super friendly demeanor!