Run Rule only every minute does not work

I am using on a Win11 the OH4.1.1

Here I am using following rule with a cronExpression:

configuration: {}
triggers:
  - id: "3"
    configuration:
      cronExpression: "* 0/1 * * * ? *"
    type: timer.GenericCronTrigger
conditions:
  - inputs: {}
    id: "1"
    configuration:
      itemName: SqueezeBox_Player_Control
      state: PAUSE
      operator: =
    type: core.ItemStateCondition
actions:

I would like to run this rule every minute to check if the conditions are met or not. When I check the eventlog I see that the rule runs every second. How it comes when my cronExpression looks like this:

* 0/1 * * * ? *

Is this wrong? How can I setup the rule that it starts every minute?

Thank you

Yes, this is not quite correct. The very first wildcard (the *) in the cron expression means run when the second matches any number. That means it will run every second. For it to run only once a minute you have to choose one specific second within that minute for it to run. Often this would just be 0, but you could choose any other second if you wanted to (e.g. 35).

The second element in your expression works, It says starting at minute 0 run every minute. But you can do this more easily with the wildcard like you saw in the first element. So in this place * means run when the minute matches any number.

Put that together and your expression for run every minute should be:

0 * * * * ? *

As a hint, when you are using the UI cron expression builder, it does a pretty good job of rendering the current expression into words, so read what it says as you build the expression and make sure that it matches what you are thinking:

image

Thanks a lot for your input! I was somehow confused about the wildcard * although I noticed the UI cron showed me “every second”. Somehow I beleived it is still correct - it was not… :wink:

Many thanks and now it works as expected!!!

:slight_smile: