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?