Creating Capabilities with Rule Templates: Time of Day

The easiest is to set the latest property on the Astro dawn channel you are using. That will prevent the Item from ever becoming anything later than that time.

You could set the latest to 06:59 and DAWN will occur no later than one minute before DAY. I worry if set it to 07:00 it will be a race condition to see whether DAWN or DAY happens first.

If you want to suppress DAWN entirely when it’s after 07:00, then add that check to the script that is called by the Alarm Clock Rule Template. You can add that as a condition in the but only if on the called script (i.e. don’t run the rule if TimeOfDay is already DAY) (assuming you have a separate rule that’s called per time of day) or you can add the logic to the Script Action of that rule to no do anything.

You wouldn’t be rewriting anything from the rule template. You’d be customizing the code called by the rule template, which is the whole intent.

Note, that I actually recommend using Time Based State Machine [3.2.0;3.4.9] to drive time of day for most users since it has built in the ability to have different times of day based on the type of day (e.g. weekends, holidays, etc.). In that case you’d still have this Alarm Clock rule template drive the DAWN state and use the condition to not do anything if TimeOfDay is already DAY.