Cron within rules - OH 1.8/9,x


i am trying to run a rule 15 minutes from mon-fri between 9-AM and 6PM.

My cron expression ooks like:

rule "Aircon DG - Temperatur"
		Time cron "*/15 9-17 * * MON-FRI" // Mo-Fr 9-18h alle 15 minuten

while loading the rule the log file points out:

2017-06-23 12:14:31.239 [INFO ] [c.internal.ModelRepositoryImpl] - Loading model 'aircon.rules'
2017-06-23 12:14:31.907 [ERROR] [.r.i.engine.RuleTriggerManager] - Cannot create timer for rule 'Aircon DG - Temperatur': CronExpression '*/15 9-17 * * MON-FRI' is invalid,.

Any idea / assistance here?


In classic cron I think day of week is a number, 0-6 or 1-7. This may follow that standard

openHAB uses the quartz Scheduler, unlike Gnu/Linux cron this allows to set the Seconds. Your Time cron expression has to be like

Time cron "0 */15 9-17 ? * MON-FRI" 
      0: at the full minute
   */15: every 15 minutes
   9-17: 9 am to 5 pm (including, so last start will be 05:45 pm)
      ?: Day of month does not matter. You will have to use ? as you set the weekdays
      *: Month does not matter
MON-FRI: from Monday to Friday

See for reference.

Danke. Will try.