is it possible to have openHAB check two conditions in a rule with OR? As far as I understood they are checked with AND per standard, but I don’t see a way to change that. Shouldn’t an option to switch between AND and OR be very benificial to many rules? I guess there are workarounds though…
I believe that the developers kept the base rules simple, under the theory that it’s better to use scripts for complex conditions. This preserves the simple, beginner-friendly interface while enabling power users to do whatever they want with conditions.
As far as I’m aware, anything you can put between the then and end of a DSL rule can go into a script. OH just treats it like DSL. If you think it’s better, try it and find out. Worst-case scenario is that you revert back to this code.
I’m not much of a programmer, so I try to keep my if conditions short and easy for me to comprehend in the future. As such, I generally use unbound items as conditional checks. In your case, I would have an item with cron-trigger rules that turn it on and off at the prescribed times, and then I’d just check if the proxy item is ON.
I use this in most of my rules, which start by checking if my “System mode” proxy item is set to home/away/sleeping/etc. to determine if they should take action.