Astro sunset event triggered to early

Hi all,

I’ve a rule that is triggered at sunset ending and also at system started.
Normally everything goes fine and the rule is executed within the first second after the sunset event occured.
But sometimes (it happend 2 times in one month time) the rule is triggered about 400ms too early which causes my rule logic to fail:

2017-11-12 17:00:59.622 [INFO ] [arthome.model.script.FrontDoorLights] - Front door lights are already off.

The rule is triggered 378ms to early which causes my check “now.isAfter(sunset)” to fail.
A simple solution is to add a sleep of 1 second before executing the rule.
I’m wondering if it is a bug or normal expeced behavior that an event is triggered before the actual event time.

rule "Front door lights"
when
	Channel 'astro:sun:local:set#event' triggered END or
	System started or
	Item Sunset_End_Time changed
then
	if (Sunset_End_Time.state == NULL){
		return;
	}
	var DateTime sunset = new DateTime((Sunset_End_Time.state as DateTimeType).calendar.timeInMillis)
	if (now.isAfter(sunset)){
		if (Light_Front_Door.state == OFF){
			sendCommand(Light_Front_Door, ON)
			logInfo("FrontDoorLights", "Turning on front door lights.")
		} else{
			logInfo("FrontDoorLights", "Front door lights are already on.")
		}
	} else {
		if (Light_Front_Door.state != OFF){
			sendCommand(Light_Front_Door, OFF)
			logInfo("FrontDoorLights", "Turning off front door lights.")
		} else {
			logInfo("FrontDoorLights", "Front door lights are already off.")
		}
	}
end

Greetings,
Frederic