Best logic for presence

What is the best logic to use for rules which run daily?
I have several rules flipping switches to ON in the morning and OFF at night.
If i am on vacation (presence switch OFF) i don’t want those rules to work.
So what is the best option for this one? Rewrite all the rules to check if the presence switch is ON or OFF at the time of the execution? Or maybe there is something better preventing the rules from running if presence switch is OFF?

I haven’t implemented this yet.
But I am thinking about defining switch items for every rule.


rule "rule01"
if ( rule01active == ON ) {

This gives me the ability to de-/activate each rule.

And I can define scenes like:
When I am not at home, don’t execute rule01, rule02, rule35, …

You can also use this to lock a rule while it is being executed.
In case there is a rule that takes some time to be executet you don’t want to trigger at again before the first run finishes.
With this method you can set the “rule switch” to OFF in the begining and to ON when everything is done.

I think what you are seeing with the examples provided thus far, and which I have similarly done, is to put the if presence switch is not OFF into those rules you only want to work when presence is ON. There really isn’t any other way.