User enhancements

Previously, all automation in OH was scripted using the rules DSL. There is now a new rule engine, where there are more options, including using the REST API, which can be used by a UI to generate rules. This is an abstracted way of building JSON resource bundles, which are ugly and complicated and nobody will want to write them by hand. So how to do scripting? JSR223 to the rescue. Pick a supported language, Jython, Javascript and Groovy are popular, and you can write scripts. There are also language specific helper libraries that remove much of the complexity of interacting directly with the Automation API, just as the DSL did for the old rule engine. These helper libraries are providing functionality that will be absorbed into OH by migrating them into a new scripting API and ModuleTypes, so that all JSR223 languages have access to them.

JSR223 allows you to write scripts that create rules, or it can be used inside rules, but it can do MUCH more. In the new rule engine, there are Modules (Triggers, Conditions and Actions), which are further broken down into ModuleTypes. I am wrapping up ModuleTypes that will allow a script made with any JSR223 language to be used in a Condition or Action. I am also working on bundles to ease the installation of Jython, Groovy, and the helper libraries. After those, I plan to address the scripting API and creating more ModuleTypes (aka, more options in the dropdowns when building a rule in Paper UI).

Layers of abstraction… these are being built so that you can drag/drop, point/click, etc. your rules in a graphical interface, or so that you can do complex things in a script with simple commands. The rules DSL provided abstraction for the old rule engine. For the new rule engine, there are ModuleTypes (mostly for use in the graphical interface), a scripting API, ScriptExtensions, and language specific helper libraries for areas where the API has not yet been built out.

The Jython/Python libraries are a LOT more capable. We will need JDK9 support, which includes ECMAScript 6, in order to built out the same functionality into the Javascript libraries. If the other maintainers agree on it, I plan to rename the https://github.com/OH-Jython-Scripters organization to OH Scripters, and include repos for all of the languages, so that there is a single place to go for helper libraries, scripts, examples, rule templates, etc.