For Rules DSL, copy and paste and edit is your only option.
The NGRE has the option for rule templates but no good way to create and distribute them yet. But that is in work.
JSR223 has a helper library that is getting off the ground that is starting to build up a library of reusable rules and modules. There are a hand full there already and I’ve around 10 more awaiting review, but none of them address your use case.
So you will either have to build this role from scratch it pice it together with piece part rules examples from the forum. For example:
- Design Pattern: Manual Trigger Detection
- [Deprecated] Design Pattern: Time Of Day (I have a reusable version of this in Python I’ve not yet submitted to the helper library if you go that route)
- [Deprecated] Design Pattern: Motion Sensor Timer