Parse.time(Z) - runonce(EDT) Time is off?


(Chuck ) #1

Hi - total n00b just getting started so please be gentle :wink: Have one smart light that works great, had it turning on/off at sunset/sunrise using the canned app.

Wanting to learn SmartApps and groovy, created a copy of this: http://docs.smartthings.com/en/latest/smartapp-developers-guide/sunset-and-sunrise.html basically verbatim - but it’s confusing UTC and EDT somehow? I know Time/Dates can be very difficult.

I have this from the guide:
def sunsetTime = Date.parse(“yyyy-MM-dd’T’HH:mm:ss.SSS’Z’”, sunsetString)

but have this for the device smartApp:
Scheduled Jobs Handler: turnOn Next Run Time: 2015-08-27 12:06:00 AM EDT <-- should be 2015-08-26 08:06 PM EDT, or 12:06AM UTC

Following the groovy docs, looks like Z isn’t zulu (UTC) time but RFC822, or:
“yyyy-MM-dd’T’HH:mm:ss.SSSZ” (example) 2001-07-04T12:08:56.235-0700

My time zone is correctly set for America/New_York


(Chuck ) #2

Even more bizarre - 2 days ago the same app worked correctly! From the log:

2015-08-24 8:09:01.088 PM EDT (2015-08-25T00:09:01.088Z)
My SmartApp sent on command to Hall Dimmer Switch

Where it looks like Z is specifying UTC - 9 minutes past midnight the following day, -vs- 9 minutes past 8PM 8/24 EDT.

Hmm, I’ll see what the logs shows tonight I guess. Is there an ongoing platform issue with ‘peak’ times? I see a few references to getting overloaded and dropping events at popular times like sunset?


(Chuck ) #3

Ok - just for giggles uninstalled the app, then re-installed it - now it’s showing the correct next scheduled event:

Scheduled Jobs
Handler Next Run Time
turnOn 2015-08-26 8:06:00 PM EDT

Ok, getting some experience now :smiley: Will see how it holds up next few days. Comments welcome.


(Brice; SmartRulesApp.com) #4

Not sure what happened there, but glad it seems to be back to normal. As you continue learning, there are lots of us here to help answer questions (even if we couldn’t answer this one :blush:), so keep the questions coming!