Scheduled events not firing?

I am testing out some scheduled events, but they do not seem to run. I don’t think there are any general problems/outages with scheduled events right now, so I guess I must be doing something wrong in the code. The first problem I see, is an error in the documentation here http://docs.smartthings.com/en/latest/smartapp-developers-guide/scheduling.html. On that page, there is this example:

def someEventHandler(evt) {
// call handlerMethod every day at 3:36 PM CST
schedule(“2015-01-09T15:36:32-06:00”, handlerMethod)
}

If I try to use that syntax for my date, then I get this error:

9:19:15 AM EST: error java.text.ParseException: Unparseable date: “2015-01-28T09:20:09-05:00” @ line 243

If I use the other syntax mentioned in that article, “yyyy-MM-dd’T’HH:mm:ss.SSSZ”, then there is no parsing error, but the schedule never seems to run. Is anyone able to get their schedules to run like this? Or do I just need to try using one of the other format options for the time parameter?

Hey @obycode, I’m looking into this.

1 Like

Oh, I see a mistake I had, so it is triggering now using the “yyyy-MM-dd’T’HH:mm:ss.SSSZ” format, but the doc does still need an update.

For the record, I thought I could specify the handler by name as a string. Ex schedule(time, “myHandler”), instead it is supposed to be schedule(time, myHandler).

@obycode the docs should be updated now with the correct format, as you discovered. Sorry for the confusion!

1 Like

Thanks Jim! Update looks good.