Rules and sitemap elements to support Agile electricity tariff from Octopus in UK

You can see many examples in the Marketplace, and a tutorial Creating Capabilities with Rule Templates: Time of Day (it’s OH 3 but still relevant) and for what you can do with properties see [Do not install] Rule Template Parameters Experiments and Examples.

One thing that I find to be particularly useful when writing rule templates is to make it smart enough to do different things based on how it’s triggered. For example when Debounce [4.0.0.0;4.9.9.9] is manually triggered it checks to make sure the rule and associated Items are configured correctly and generates meaningful and actionable errors if not. When triggered by an Item event it debounces it. This can be a powerful way to combine rules where it makes sense (e.g. MQTT Event Bus [4.0.0.0;4.9.9.9] is able to combine publish and subscribe into one rule instead of two).

Unfortunately any one posting on the marketplace is limited to a single rule template making it challenging to publish a suite of templates that work together (not impossible, you can always have more than one posting).

And of course, ask if you run into trouble. I’m a big advocate of rule templates because OH is better for everyone when users can install/configure instead of needing to touch code for everything.