The Missing Link to simple UI-configurable Scheduling

The over all concept presented here is the same as the standard alarm clock examples that go back to OH 1.6.

  • put the hour and minute on your Sitemap/HABPanel with a slider, setpoint, dial, whatever.
  • trigger a rule one or minute (that’s all the NTP binding is doing for you here, you could also use the Astro binding or a cron triggered rule to achieve the same thing and the cron triggered rule is the one that doesn’t have external dependencies)
  • once a minute check if we’ve just passed the hour and minute by checking the items against getHourOfDay and getMinuteOfHour and trigger the alarm.

There are other approaches too, like setting. A Timer based on the values of the two Items rather than triggering a rule one a minute. I personally prefer the Timer approaches.

And as Scott indicates, this approach is possible using the NGRE unchanged.

The root cause of the problems with both of these approaches are:

  1. there is no Time Item type in OH, only a DateTime which includes the date so we have to deal with handling the date even on a recurring alarm
  2. there is no way to enter a Time or DateTime on any of the UIs; we have to break it apart into separate Items and then rebuild the time from the parts in the Rule

1 isn’t really that big of a deal as it’s not hard to manage and we can provide libraries to manage it in NGRE. But 2 is there root problem. And that is going to take effort in openhab-core, openhab-uis, and both phone app repos to solve, which is probably why it’s never been solved.