I have a DSL rule that should send a mqtt message as soon as the sun rises. Unfortunately, the if-block is never executed and I don’t know why.
ps: outside the if block the mqtt message works
if ( now.isAfter((Sonnenaufgang_Start.state as DateTimeType).calendar.timeInMillis) ){
actions.publishMQTT("cmnd/tasmotas/EVENT", "PIR_OFF") //i.e.: set event alarm off
}
It’s OH2 code, where now is a Joda datetime object.
In OH3, now is a ZonedDateTime, with different methods.
Your openhab.log should be telling you something along these lines.