[SOLVED] OpenSprinkler Irrigation and Cascading timers rule

:person_shrugging:

If Blockly is too much I have posted the JS version of the code above. That’s all text based.

If that’s too much, there really is no hope that you’d ever get this six-year-old version of a Rules DSL rule to work.

You can use Simple UI Rules, but that’s UI based too and just create two rules for each valve, one that turns it on at the right time and one that turns it off and turns on the next one at the right time. But you’ll have to schedule them based on clock times, not durations.

If you are unwilling to install any more add-ons or libraries to do this it’s about all I can offer, beyond helping to get the above code to work properly. But for that you’ll need to install the JS Scripting add-on, the OHRT library using npm from the command line, and the OHRT Block Library from the marketplace.

Using Simple Rules, at a high level, involves:

  1. Navigate to Settings → Rules → +, fill in the UID, label, and description
  2. Add a trigger (under When) and choose “Time Event”. Select “A fixed time of day”. and set the time you want the valve to turn on.
  3. Add am action (under Then) and choose “Item Action”. Select your valve Item and ON for the command.
  4. Save <ctrl>-s or click “Create” at the upper right.

  1. Repeat 1
  2. Repeat 2 but set it to the time you want the first valve to turn OFF and the second one to turn ON.
  3. Repeat 3 only set the command to send to the Item to OFF.
  4. Repeat 3 again, this time selecting the second valve’s Item and ON for the command.
  5. Repeat 4 to save the rule
  6. Repeat 5-9 to create a rule to turn on/off each valve

  1. Repeat 1
  2. Repeat 2 but set the time you want the last valve to turn OFF.
  3. Repeat 2 only set the command to send to the Item to OFF.
  4. Repeat 4

There really are only about four steps, but you need to repeat them over and over. But the steps are basically

  1. create a new rule
  2. set the trigger for the time you want valves to turn on/off
  3. send OFF to the valve that’s ON and ON to the next valve in the sequence
  4. save the rule.

That’s about as simple as this is ever going to get. If that’s too much, OH may not be the best platform for your home automation.

I swear I’ll try. I have today already spent about 10 hours in few ways 
 you are so kind that I feel in duty to follow your suggestions. I’ll manage tomorrow to install some kind of graphic. I tried today with browser to go into scripts but I could neither open it because of missing libraries.
I have a lot of devices working in OH4 and I would not like to dismiss them because of this stupid problem. Until now, since 8 years I started with OH2 and always I managed only text files and sitemaps, building my whole home with domotic, multimedia, alarm, solar panel, etc . Now it’s time to evolve, but it’s so difficult to find my right way in graphic interface. There are several, and every one is different

The only one you need look at for this is MainUI, which is the default UI that comes with OH.