Making Decisions Based on Time of Day

Joda is still available so all the old 1.x Joda code examples should work just fine. Only OH does the imports for you so you no longer need to import from org.joda to have access to the Joda classes. But that doesn’t make them unavailable.

That is actually illustrated in the Time of Day DP I linked to above. It has some times defined by cron triggers and others based on events, Astro events in this case. One could easily add additional events and criteria if needed.

Timers and/or Design Pattern: Expire Binding Based Timers is a better approach to this over a cron triggered polling rule.

A couple of examples:

One reason why I came up with the Time of Day Design Pattern is because it lets me centralize all of those Time cron triggers and if(now.isBefore tests and make them into events to drive the rest of the automation.