I now have installed the DP of Rich and tested in several versions. As @rlkoshak said, the problem is not the map.
I found out, when I made changes(i.e the Label) in the Channel-linked items the values are lost. When waiting for the interval-time (i.e. interval=300) of the defined Astro-Thing they will be updated again. But only the “normal-ones”. The Scheduling will not work for those Things and channel-linked Items with Offset.
If the Rule starts (with Debug-Points) and if a value is not set, the Logger shows
2019-04-16 10:32:05.744 [INFO ] [e.smarthome.model.script.Time Of Day] - Calculating time of day...
2019-04-16 10:32:05.769 [INFO ] [e.smarthome.model.script.Time Of Day] - Calculating time of day...1
2019-04-16 10:32:05.788 [INFO ] [e.smarthome.model.script.Time Of Day] - Calculating time of day...2
2019-04-16 10:32:05.806 [INFO ] [e.smarthome.model.script.Time Of Day] - Calculating time of day...3
2019-04-16 10:32:05.814 [ERROR] [ntime.internal.engine.RuleEngineImpl] - Rule 'Calculate time of day state': Invalid format: "NULL"
when it comes to NULL-Value.
After a Restart of OH2 or Bundle-Restart all values are set. But one can see in the Logger what happens.
2019-04-16 11:01:38.536 [INFO ] [thome.binding.astro.internal.job.Job] - Scheduled Astro event-jobs for thing astro:sun:stowing1
2019-04-16 11:01:38.640 [INFO ] [thome.binding.astro.internal.job.Job] - Scheduled Astro event-jobs for thing astro:moon:local
2019-04-16 11:01:38.654 [INFO ] [ding.astro.handler.AstroThingHandler] - Scheduled Positional job astro:moon:local every 300 seconds
2019-04-16 11:01:38.799 [INFO ] [thome.binding.astro.internal.job.Job] - Scheduled Astro event-jobs for thing astro:moon:local
2019-04-16 11:01:38.820 [INFO ] [ding.astro.handler.AstroThingHandler] - Scheduled Positional job astro:moon:local every 300 seconds
2019-04-16 11:01:38.866 [INFO ] [thome.binding.astro.internal.job.Job] - Scheduled Astro event-jobs for thing astro:sun:local
2019-04-16 11:01:38.891 [INFO ] [ding.astro.handler.AstroThingHandler] - Scheduled Positional job astro:sun:local every 300 seconds
2019-04-16 11:01:38.979 [INFO ] [thome.binding.astro.internal.job.Job] - Scheduled Astro event-jobs for thing astro:sun:local
2019-04-16 11:01:39.037 [INFO ] [ding.astro.handler.AstroThingHandler] - Scheduled Positional job astro:sun:local every 300 seconds
2019-04-16 11:01:39.059 [INFO ] [thome.binding.astro.internal.job.Job] - Scheduled Astro event-jobs for thing astro:sun:minus90
2019-04-16 11:01:39.246 [INFO ] [thome.binding.astro.internal.job.Job] - Scheduled Astro event-jobs for thing astro:sun:stowing
2019-04-16 11:01:39.500 [INFO ] [thome.binding.astro.internal.job.Job] - Scheduled Astro event-jobs for thing astro:sun:stowing2
The Re-Scheduling will only work for for the “Normal-Tings”
I’m using the following Set-Up:
RPi 3B, OH2.5M1
rich_time.items:
Group gRichTime "Rich's Daytime"
//String vTimeOfDay "Current Time of Day [MAP(weather.map):%s]" <time> (gRichTime)
String vTimeOfDay "Current Time of Day [%s]" <time> (gRichTime) // Testversion without transformation
DateTime vMorning_Time "Morning [%1$tH:%1$tM]" <sunrise> (gRichTime)
DateTime vSunrise_Time "Day Test1 [%1$tH:%1$tM]" <sun> (gRichTime) {channel="astro:sun:local:rise#start"}
DateTime vSunset_Time "Evening Test1 [%1$tH:%1$tM]" <sunset> (gRichTime) {channel="astro:sun:local:set#start"}
DateTime vNight_Time "Night [%1$tH:%1$tM]" <moon> (gRichTime)
DateTime vBed_Time "Bed [%1$tH:%1$tM]" <bedroom_blue> (gRichTime)
DateTime vEvening_Time "Late Afternoon Test1 [ %1$tH:%1$tM]" <sunset> (gRichTime) {channel="astro:sun:minus90:set#start"}
rich_time.rules:
val logName = "Time Of Day"
rule "Calculate time of day state"
when
Item Dummy4 changed to ON or
System started or // run at system start in case the time changed when OH was offline
Channel 'astro:sun:local:rise#event' triggered START or
Channel 'astro:sun:local:set#event' triggered START or
Channel 'astro:sun:minus90:set#event' triggered START or
Time cron "0 1 0 * * ? *" or // one minute after midnight so give Astro time to calculate the new day's times
Time cron "0 0 6 * * ? *" or
Time cron "0 0 23 * * ? *"
then
logInfo(logName, "Calculating time of day...")
// Calculate the times for the static tods and populate the associated Items
// Update when changing static times
// Jump to tomorrow and subtract to avoid problems at the change over to/from DST
val morning_start = now.withTimeAtStartOfDay.plusDays(1).minusHours(18)
vMorning_Time.postUpdate(morning_start.toString)
logInfo(logName, "Calculating time of day...1")
val night_start = now.withTimeAtStartOfDay.plusDays(1).minusHours(1)
vNight_Time.postUpdate(night_start.toString)
logInfo(logName, "Calculating time of day...2")
val bed_start = now.withTimeAtStartOfDay
vBed_Time.postUpdate(bed_start.toString)
logInfo(logName, "Calculating time of day...3")
// Convert the Astro Items to Joda DateTime
val day_start = new DateTime(vSunrise_Time.state.toString)
logInfo(logName, "Calculating time of day...4")
val evening_start = new DateTime(vSunset_Time.state.toString)
logInfo(logName, "Calculating time of day...5")
val afternoon_start = new DateTime(vEvening_Time.state.toString)
logInfo(logName, "Calculating time of day...6")
// Calculate the current time of day
var curr = "UNKNOWN"
switch now {
case now.isAfter(morning_start) && now.isBefore(day_start): curr = "MORNING"
case now.isAfter(day_start) && now.isBefore(afternoon_start): curr = "DAY"
case now.isAfter(afternoon_start) && now.isBefore(evening_start): curr = "AFTERNOON"
case now.isAfter(evening_start) && now.isBefore(night_start): curr = "EVENING"
case now.isAfter(night_start): curr = "NIGHT"
case now.isAfter(bed_start) && now.isBefore(morning_start): curr = "BED"
}
// Publish the current state
logInfo(logName, "Calculated time of day is " + curr)
vTimeOfDay.sendCommand(curr)
end
astro.things:
// Astro - Binding Geo-Position geolocation="xx.xxxxxx,y.yyyyyy,zzz"
Thing astro:sun:local "Sonnen Daten" [geolocation="xx.xxxxxx,y.yyyyyy,zzz", interval=300]
Thing astro:moon:local "Mond Daten" [geolocation="xx.xxxxxx,y.yyyyyy,zzz", interval=300]
Thing astro:sun:minus90 "Offset -90" [geolocation="xx.xxxxxx,y.yyyyyy,zzz", interval=300]{
Channels:
Type rangeEvent : set#event [
offset=-90
]
Type start : set#start [
offset=-90
]
Type end : set#end [
offset=-90
]
}
Thing astro:sun:stowing "Offset -180" [geolocation="xx.xxxxxx,y.yyyyyy,zzz", interval=300]{
Channels:
Type rangeEvent : set#event [
offset=-180,
earliest="19:40"
]
}
Thing astro:sun:stowing1 "Offset 200" [geolocation="xx.xxxxxx,y.yyyyyy,zzz", interval=300]{
Channels:
Type rangeEvent : noon#event [
offset=200,
earliest="13:00"
]
Type rangeEvent : set#event [
offset=90,
earliest="20:10"
]
Type start : rise#start [
offset=90,
earliest="09:00"
]
Type end : rise#end [
offset=90
]
Type start : set#start [
// offset=90,
earliest="23:50"
]
Type end : set#end [
offset=90
// latest="21:50"
]
}
Thing astro:sun:stowing2 "Offset -90" [geolocation="xx.xxxxxx,y.yyyyyy,zzz", interval=300]{
Channels:
Type rangeEvent : set#event [
offset=-90
]
Type start : set#start [
offset=-90
]
Type end : set#end [
offset=-90
]
}
So one can see, even if the interval is set in the Thing (minus90) it will not work. For me this looks like a bug in the binding 
Cheers,
Peter
Btw: Is there an icon for <tod>
. Didn’t find one.