csuermann/node-red-contrib-suncron

Offset is time on previous day, event not fired

soenkegissel opened this issue · 2 comments

I setup nadir MINUS 2 hours.

With date and time this means:
02/1st/2021 @ 00:41h
minus 2 hours
01/31st/2021 @ 22:41h

There is a datechange and this is not triggered correctly.

Hi @soenkegissel,

I think you discovered an edge-case: The schedule for a day is created shortly after midnight of that day, therefore adjustments can only be reflected as long as they don't move the event to another day.

Still looking for a solution to this? I started reworking this contrib on my fork because I want to add something similar to the time-of-day contrib but with sun events and possible have the option for more splits than just 2.

Anyways, by also getting the times for tomorrow (and possibly yesterday), it would be pretty easy to solve the issue of large positive/negative offsets.