Pushover notifications from JavaScript rules

Best practice is to create npm modules which will go in $OH_CONF/automation/js/node_modules. Once it’s an npm module, you can require the parts you need in your rule just like any third party library.

But the old style Nashorn load approach documented at OH 3 Examples: Writing and using JavaScript Libraries in MainUI created Rules will still work to inline your code into your rules.

You can also create a rule that gets called by other rules. You can pass data through a triggering Item, or call the rule directly and pass data to the rule as a map. You can also set data in the cache which gets shared between rules.

There are lots of options.

1 Like