[SOLVED] Astro Offset not triggered in Rule

I’ve created earlier a post about the astro binding off-set here which maybe contained a bug and it was solved after an update.
But I think there is another bug in the astro-binding. First things first, my configuration:

  • Raspberry PI 3b+
  • Openhabian
  • Openhab 2.5M1

Items:

Group			Astro					"Astro"                                         (Home)
DateTime		Sunrise_Time			"Zonsopgang [%1$tH:%1$tM]"          <sunrise>   (Astro) { channel="astro:sun:local:rise#start" }
DateTime		Sunset_Time				"Zonsondergang [%1$tH:%1$tM]"       <sunset>    (Astro) { channel="astro:sun:local:set#start" }
DateTime		Sunrise_Offset_Time		"Zonsopgang (offset) [%1$tH:%1$tM]"          <sunrise>   (Astro) { channel="astro:sun:local-offset:rise#start" }
DateTime		Sunset_Offset_Time		"Zonsondergang (offset) [%1$tH:%1$tM]"       <sunset>    (Astro) { channel="astro:sun:local-offset:set#start" }

Group		TimeOfDay		"Moment van de dag"								(Home, RestoreOnStartup)
String		Current_TOD		"Huidige moment van de dag [MAP(tod.map):%s]"	<tod>		(TimeOfDay)
DateTime	Morning_Time	"Ochtend begint om [%1$tH:%1$tM]"			 	<sunrise>	(TimeOfDay)
DateTime	Day_Time		"Dag begint om [%1$tH:%1$tM]"					<sun>		(TimeOfDay)
DateTime	Evening_Time	"Avond begint om [%1$tH:%1$tM]"					<sunset>	(TimeOfDay)
DateTime	Night_Time		"Nacht begint om [%1$tH:%1$tM]"					<moon>		(TimeOfDay)

Rule:

rule "Time of Day"
when
	System started or
	Channel 'astro:sun:local-offset:rise#event' triggered START or
	Channel 'astro:sun:local-offset:set#event' triggered START or
	Time cron "0 30 0,6 ? * * *"
then
	Morning_Time.postUpdate(now.withTimeAtStartOfDay.plusDays(1).minusHours(17).minusMinutes(30).toString)
	Day_Time.postUpdate(Sunrise_Offset_Time.state.toString)
	Evening_Time.postUpdate(Sunset_Offset_Time.state.toString)
	Night_Time.postUpdate(now.withTimeAtStartOfDay.plusMinutes(30).toString)
	var curr = "UNKNOWN"
  	switch now {
	  	case now.isAfter(new DateTime(Morning_Time.state.toString)) && now.isBefore(new DateTime(Day_Time.state.toString)):       curr = "MORNING"
	  	case now.isAfter(new DateTime(Day_Time.state.toString)) && now.isBefore(new DateTime(Evening_Time.state.toString)):       curr = "DAY"
	  	case now.isAfter(new DateTime(Evening_Time.state.toString)) && now.isBefore(new DateTime(Night_Time.state.toString)):       curr = "EVENING"
	  	case now.isAfter(new DateTime(Night_Time.state.toString)) && now.isBefore(new DateTime(Morning_Time.state.toString)):       curr = "NIGHT"
  	}
	Current_TOD.postUpdate(curr)
end

Channel configuration (Paperui):


GUI:

What is the problem: as you can see, the time of the sunrise offset (Zonsopgang (Offset)) is set at 7:30, as it suppose to be. But the rule is trigger at 7:07 (the normal sunrise).

The trigger statement of the channel does not honor the early offset configured in PaperUI, the item created with this channel does.

Is this a bug or have I overlooked a mistake made by me?

My config is working, but I use only the thing file to configure it:

astro:sun:Weekend [ geolocation="xxx.yyy,xxx.yyy", altitude=300, interval=600 ]
{
	Channels:
		Type rangeEvent : rise#event [
            offset=-20,
            earliest="09:00"
        ]
        
		Type rangeEvent : set#event [
            offset=10, 
            latest="22:00"
        ]
}

Rule-Trigger:

Channel 'astro:sun:Weekend:set#event' triggered START
Channel 'astro:sun:Weekend:rise#event' triggered START

Only one bug in OH2.4 binding. On DLS the rise trigger on the first day after is the old time. Triggers at the time without DLS. At the next day it is solved.

Tnx @HomeAutomation, but before the DST it worked as configured. So that’s why I thought it maybe a bug related to my other post and what you’re saying.
And the item (Sunrise_Offset_Time) give the correct time, but the rule is not trigger at the correct time (Channel 'astro:sun:local-offset:rise#event' triggered START)

Hm, this problem does not happen in my setup. Maybe there is a link to the right settings in paper UI/configuration/system regarding timezone and lcoation?

I set this to the right values too because this was mentioned in other posts to have the right units of measure settings for items.

To which Channel you gave the Offset (earliest 7.30) ? To the Start-Channel or the Range Event-Channel ? It should be the Range-Event-Channel !


Another idea if your using the Range-Event-Channel:
As you can see in the example of @HomeAutomation the Time has a leading Zero (09:00). Have you tried it in the same way ?

When testing your options in this post I first run in the same problem, when defining the time in this way earliest=“9:00”, but it has to be earliest="09:00

Yes, thank you @fibu-freak! I think that’s the problem. I’ll correct it and we will see what happening tomorrow :wink:
The leading zero, I know, PaperUI gives an error if you type it without the leading zero.