I have rules, that trigger in the morning, based on several conditions. Now I would like to disable some of those rules based on a virtual switch, which I created.
Scenario would be as follows (example):
Usually, my rollershutters open up in the morning (latest 8AM in almost all rooms - except bedroom). Now if guests are present, I would like to pause/disable this rule, as the guestroom should also remain dark to not wake up the guests.
Now I understand, i could put this virtual switch as further condition for the rule. but as there are many rules to be affected, I would like to simply deactivate a few rules (like 10-15) based on only the virtual switch (Guest_Present) being switched “ON”.
Can someone let me know how this can be done?
openHAB 3 is in use
All rules and items are created in the backend (Visual Studio Code)
This is pretty easy via the gui rule editor in OH3.
Just create a new rule. As the “Then action” select show all and then “enable or disable rules”. There you can select all the effected rules which should be enabled or disabled.
Here is the start of a DSL rule used for my kitchen ventilation
rule "Kitchen ventilation control"
when
Item rule_kitchenVentilation changed
or
Time cron "/30 * * * * ?"
or
Item VentilationMode_Kitchen changed
then
if (rule_kitchenVentilation.state == ON) {
postUpdate(rule_kitchenVentilation_TimeStamp, new DateTimeType())
var Number counter
counter = rule_kitchenVentilation_Counter.state as DecimalType
counter = counter + 1
postUpdate(rule_kitchenVentilation_Counter,counter)
// your code after this line
rule_kitchenVentilation - turns the rule execution on/ off rule_kitchenVentilation_Counter - counts how many times the rule was triggered rule_kitchenVentilation_TimeStamp - shows the last time the rule was executed