Since you are discussing rules and not OH development, I’ve moved your topic to a more appropriate category.
In regards to OH, a more suitable term is scripted automation.
The old rule engine and the rules DSL are two separate things. The old rule engine has been removed in OH 3.0. Why anyone would choose to use a very limited and clunky proprietary DSL for writing their automations is a mystery to me, but the rules DSL has been grafted onto the new rule engine. Whether it works or not and what changes will be required to existing rules is a ticking time bomb that you are welcome to poke at! ![]()
Having a background in JS, it makes sense that you would gravitate towards Nashorn for scripted automation. However, you may want to consider:
- For now, you are stuck with ECMAScript 5.1.
- The JS helper libraries are very useful, but they can never be on par with the Jython HLs with ES5.1.
- With JS, you will need to use a lot of the raw automation API, which has very little documentation, so you will need to read through a lot of OHC code. The helper libraries provide a layer of abstraction from the automation API to make things easier and to help protect from breaking changes, like are coming in OH 3.0. Using the JS HLs will help a tiny bit, but the coverage is very small, particularly in the creation of rules and triggers. The Jython HLs are a near complete solution where you do not need to come into direct contact with the raw API, so they should prevent any breaks in functionality. If any gaps show up, I will do my best to fill them in before OH 3.0 is released.
- Would you write tax software in JS? Would you write code to control a spaceship in JS? Would you write an email server in JS? Of course not… you’d select a tool that suits the job
! JS is great for websites, but Jython is much more suited for automation. - There is much more information available in the forum and documentation about using Jython and the helper libraries.
To simplify the installation, I have made Jython and helper library add-ons.