Is it possible to have multiple cron expressions as a rule trigger? I want a rule that’s triggered every minute between 0645 and 0715, but I don’t think this will work:
when
Time cron "0 0-15 7 * * ?" or
Time cron "0 45-59 6 * * ?"
then
To be clear, the actual test I’m doing (so I don’t have to wait for tomorrow morning) is:
when
Time cron "0/15 * * * * ?" or
Time cron "0/20 * * * * ?"
then
in the above, it runs only every 15 seconds, not on 20 and 40 seconds. If I reverse the order, the rule triggers at 20, 40 and 60, but not the 15’s.
If I have to turn it into a single expression, can anyone advise how I do that? Just “0 0-15,45-59 6,7 * * ?” won’t work, because that will trigger at 0600-0615, 0645-0659, 0700-0715 and 0745-0759, which is not what I want.
It is supposed to be but there is currently a bug which is preventing them from working. Only the first expression triggers the rules.
I’m not sure of the status of the fix for this.
To work around it you can create a proxy Item and separate rules which call the proxy Item to trigger the rules. It’s not pretty but it will work for now.
If you are currently suffering from this bug, your options are (1) reduce your rule to one cron condition, (2) wait for the openHAB 2.1 stable release or (3) switch to the unstable branch and use the latest snapshot.
If you did one of the above and still encounter problems, they are probably unrelated to the bug discussed here. Please search the forum for similar cases or create a new thread.