Pistons have stopped working! [daylight savings time issues]

fixed

#284

I have a piston that is supposed to run every 10 min. But it did not make the transition to DST. When I look at the logs, the next time to run is 1 hr and 10 min away from the last time it ran. I also just tried to kick-start it by doing an Edit, then Save. The new time is again 1 hr and 10 min from now.


#285

FYI or Fun Fact for everyone…
DST stands for Daylight Saving Time not Daylight Savings Time. :slight_smile:


#286

Sorry guys, got DST issues again? I thought they were fixed?! :frowning:


#287

Yeah, some of my pistons fired an hour later … but they’re non-critical pistons. Some of the DST issues seem to be correcting itself this morning, though, so I’m going to wait a bit more to see what happens before I start griping and whining :wink:


#288

Just to add info, but not complaining, I have a non-critical piston that checks that my front door is locked (reports status actually) and the battery level of the lock. It’s designed to execute at 8:30 pm and has worked perfectly. It fired last night with DST at 9:30pm. I have other pistons that use motion sensing triggering lights but those are too involved to eailty check.
~update~
Worked as expected the next night. Fine now.


#289

Yeah, we noticed a delay in execution here on pistons tied to Sunrise, but everything caught up pretty quickly after that. Just seems to me the timers are being set the day before the change and don’t anticipate or adapt to DST.


#290

FWIW, I added a routine to my sunrise/sunset piston the runs 1 hour before I actually need it to fire. All the routine does is a short wait, which is enough to force to piston to recalculate the correct sunrise or sunset time.


#291

@siwilson

I do similar, for any pistons I have that rely on a time scheduled on a previous day(s)…I place this at the top:

every 1 days at 00:01
DO
(Blank)
end do
end every

This is to compensate for small daily changes in sunrise / sunset.

Thinking out loud though, if I change it to 03:01 then it will also compensate for DST.


#292

I debated over creating a new thread or adding here but as this is time related, I decided to add this observation here.

I am a relatively new Webcore user. Since the system variables do not have dawn or dusk, I am running a piston after midnight to reach out to api.usno.navy.mil and obtain the sunrise data for my location. This gets me the twilight times; Begin Civil Twilight and End Civil Twilight. I use begin and end as dusk and dawn respectively to turn on my porch light ahead of sunrise and after sunset.

http://aa.usno.navy.mil/data/docs/api.php

Note: the data from this API doesn’t parse as JSON. I will share my solution later.

Among other replies, this API will provide sun and moon data for a specific location when provided the coordinates and timezone offset, or location. As my community is not in the database I had to calculate the timezone offset from UTC to get the data from the API. It would be nice if a variable was added to reflect the current offset and maybe that would help. As EDT occurs at a known time, I’m thinking of coding that allowance in my housekeeping piston.

While doing this, I saw a potential issue with the $utc variable. I assumed this would be the Universal time however the time displayed is my current time. Looking at the variable localNow, the time is displayed in my time zone is 4 hours off the wrong way from UTC.

If $now is 7:31:26 A.M. EDT, -4 hours away from UTC. I would have expected $localNow to match and $utc to display the correct UTC however $utc is being displayed as my time and $localNow is 4 hours the wrong way as, 03:31:26 A.M. EDT. In EDT, UTC should be 11:31:26 A.M. EDT.

Thus is great stuff and has added a great feature that was lacking to ST.

Thanks