I finally found pause(milliseconds) worked. Well, I mean it worked in the groovy language but I quickly ran into another barrier. I have a loop and I paused for just 12 seconds. However after the 4th run through the loop I got this error:
12:53:52 PM: error java.util.concurrent.TimeoutException: Execution timed out after 40 units. Start time: Thu Jul 03 16:53:02 UTC 2014 @ line 72
I finally ended up getting around the issue by being able to combine my variables and send it all in one http request. Here’s the details of my saga:
So, while pause should work as far as the groovy language is concerned, I think you might run into the same time out issue.
That looks too complex. Why runIn(60, scheduledRun)? Why not just call the function directly there? Also, if your SmartApp skips a bit (as it happens sometimes) it will stop working until you update it. I’d use cron to fire the app every five minutes, call the function directly and voila (unless you have something else more complex going on in your app).
I was having trouble with creating a seudo loop that didnt crash the IDE. This is the last point that I left off before code cleaning.
I’m not familiar with running cronjob on groovy, do you have a code example? I wouldn’t mind having you look over my full code since you seem to be better at DRY coding then me
Im trying to implement hue’s right now, but I dont own any and the virtuals dont seem to work.