Delay on Rules

Good evening everyone, I’m trying to set up an automatic irrigation system but I can’t get the right watering time to go for each zone.
You know how it is possible to create a delay between one operation and another and especially if this is the shortest way to accomplish what I am trying to do.

Thanks in advance for the help.

(openHAB 3)

First of all, please click on that “Code” tab and paste the code using code fences.

```
code goes here
```

Screen shots are next to useless.

There are a number of irrigation examples on the forum.

It’s all but impossible to read the screenshot on my phone but that looks like you are sending a command to an Item then executing a script to insert a delay. If you have to use a Script Action anyway, just put it all into a single Script Action?

But even if you do that this is probably not the best way to implement something like this because there is no way to stop it. Every time it runs it will run from start to end and there is nothing you can do about ti beyond stopping openHAB and manually closing the last valve. So please look at some of these other approaches above for approaches that use Timers and are cancelable.

The part of the code is very simple, (also because I was not able to implement it) it would be enough for me to wait two minutes and then move on to the next command

expire="2m,command=OFF"

This is the code

triggers:
  - id: "1"
    configuration:
      itemName: ciclolungo
      command: ON
    type: core.ItemCommandTrigger
conditions: []
actions:
  - inputs: {}
    id: "2"
    configuration:
      itemName: IrrigazioneGiardino_CH1
      command: ON
    type: core.ItemCommandAction
  - inputs: {}
    id: "3"
    label: 4minuti
    configuration:
      type: application/javascript
      script: expire="0h 4m 0s"
    type: script.ScriptAction
  - inputs: {}
    id: "4"
    configuration:
      itemName: IrrigazioneGiardino_CH1
      command: OFF
    type: core.ItemCommandAction
  - inputs: {}
    id: "5"
    configuration:
      itemName: IrrigazioneGiardino_GirandoleGrandi
      command: ON
    type: core.ItemCommandAction
  - inputs: {}
    id: "6"
    label: 8minuti
    configuration:
      type: application/javascript
      script: expire="0h 8m 0s"
    type: script.ScriptAction
  - inputs: {}
    id: "7"
    configuration:
      itemName: IrrigazioneGiardino_GirandoleGrandi
      command: OFF
    type: core.ItemCommandAction
  - inputs: {}
    id: "8"
    configuration:
      itemName: IrrigazioneGiardino_Argute
      command: ON
    type: core.ItemCommandAction
  - inputs: {}
    id: "8"
    label: 8minuti
    configuration:
      type: application/javascript
      script: expire="0h 8m 0s"
    type: script.ScriptAction
  - inputs: {}
    id: "9"
    configuration:
      itemName: IrrigazioneGiardino_Argute
      command: OFF
    type: core.ItemCommandAction
  - inputs: {}
    id: "10"
    configuration:
      itemName: ciclolungo
      command: DOWN
    type: core.ItemCommandAction

This is not a useful javascript action. Well, I suppose it is valid, but all it does is set a variable named “expire” to some string. Then the script exits and the variable is discarded.