Schedule() starts at the next day?

I was using schedule for the first time in Hubitat (that I recall) and this post was a nice help on how it used cron format, but I just noticed/realized that my app schedule started the following day at midnight?

Is there any way to kick it off right away?

Here you can see I ran the refresh once on install, but then it only started running at midnight per this code:

if (enablePing) {
    //runEvery1Minute(refresh)  // Option 1: test it every minute.  Have a 10 second timeout on the requests.
    schedule("0 2/5 0 ? * * *", refresh) // every 5 min starting offset :02
  }

I also tried * for the two zeros but that didn't help. Is the issue here that crontab needs to restart? Is there a way to do that manually or does it require a hub restart?

If you're going to do it that fast why don't you use runin instead of schedule? I typically only use schedule for things that are too long or far out to use runin.

I'd also add... without any solution, this is likely a cron question, more so than a question about a driver/app.... that doesn't answer the question.... but might provide some guidance for a place to start looking..... while not discounting options that may be available in Groovy / HE....

Not sure how much that helps....

1 Like