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:
- Navigate to Settings â Rules â +, fill in the UID, label, and description
- 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.
- Add am action (under Then) and choose âItem Actionâ. Select your valve Item and ON for the command.
- Save
<ctrl>-s
or click âCreateâ at the upper right.
- Repeat 1
- Repeat 2 but set it to the time you want the first valve to turn OFF and the second one to turn ON.
- Repeat 3 only set the command to send to the Item to OFF.
- Repeat 3 again, this time selecting the second valveâs Item and ON for the command.
- Repeat 4 to save the rule
- Repeat 5-9 to create a rule to turn on/off each valve
- Repeat 1
- Repeat 2 but set the time you want the last valve to turn OFF.
- Repeat 2 only set the command to send to the Item to OFF.
- Repeat 4
There really are only about four steps, but you need to repeat them over and over. But the steps are basically
- create a new rule
- set the trigger for the time you want valves to turn on/off
- send OFF to the valve thatâs ON and ON to the next valve in the sequence
- 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.