biddster / node-red-contrib-schedex

Scheduler for node-red which allows you to enter on/off times as 24hr clock (e.g. 01:10) or suncalc events (e.g. goldenHour). It also allows you to offset times and randomise the time within the offset.
22 stars 17 forks source link

Initial scheduling after a power cut or downtime is wrong #11

Open biddster opened 8 years ago

biddster commented 8 years ago

I've noticed that after a power cut, schedex starts and schedules on/off prior to the system clock being corrected (presumably via ntp).

Consequently, the time skew is equal to the amount of time that schedex was turned off.

However, Schedex does recover once the first on/off triggers.

Need to 'listen' for host clock changes and adapt our schedule.

drmibell commented 6 years ago

A related problem, for which I didn't want to raise a new issue, is that schedex seems not to update the times of suncalc events at the transitions between Standard Time and Daylight Saving Time (Summer Time) until after the first occurrence of each event on the new time standard. Perhaps schedex could call suncalc once a day (for example at 0300) to stay in sync.

GoSpursGoNL commented 5 years ago

Indeed, I noticed the same thing as @drmibell . Last night Standard Time began, but this night the lights will be activated one hour too late.

tomSmartHome commented 4 years ago

I've noticed that after a power cut, schedex starts and schedules on/off prior to the system clock being corrected (presumably via ntp).

Consequently, the time skew is equal to the amount of time that schedex was turned off.

However, Schedex does recover once the first on/off triggers.

Need to 'listen' for host clock changes and adapt our schedule.

Any creative workarounds?

biddster commented 4 years ago

@drmibell @ GoSpursGoNL the daylight saving issue was fixed in 1.6.6.

@tomSmartHome - nothing springs to mind at the moment. Are you seeing the issue a lot?

razvanstanga commented 2 years ago

take a look here https://github.com/biddster/node-red-contrib-schedex/issues/93