JRule - OpenHAB Rules using Java

I’ve just built a BETA12 release. This release includes a major refactoring of items and how to send commands to items by Seime.

Major refactoring by seime #42

  • Replaces the templating mechanism with Freemarker, mainly to allow more advanced constructs such as loops - and to avoid all the repetitive code in the template files
  • Generates a new file Items.java which looks a bit like public class Items { public static MySwitchItem SwitchItem = JRuleItemRegistry.get(“MySwitchItem”, MySwitchItem.class); public static MyStringItem StringItem = JRuleItemRegistry.get(“MyStringItem”, MyStringItem.class); }
  • Adds a skeleton support for LocationItem (which was missing)
  • Adds a new field LABEL (item label)
  • Adds a few convenience methods such as getLabel() and getName()
  • Adds more typing of Group items

You will likely have to refactor your rules to use these new way of accessing items.
See example 30 in the documentation on github.

3 Likes

Found some issues with groups. Will build a new release shortly.

Best regards s