Compare DateTime to Static DateTime

Usually, we have to code things the way the language supports regardless of what we want.

DateTimeType and DateTime objects are absolute. They are a specific time on a specific date. You cannot define a DateTime or DateTimeType for “06:00” because there is no date. It is called DateTime for a reason. You HAVE to have the date part.

Every time this Rule runs you will have to get the time for 06:00 for today.

See [Deprecated] Design Pattern: Time Of Day

   ...
    val long morning_start   = now.withTimeAtStartOfDay.plusHours(6).millis
    if((Sunrise_Time.state as DateTimeType).getZonedDateTime.toInstant.toEpochMilli > morning_start) {
    ...