Would like to know if the javascript example posted on the wiki here: openHab JSR223 script engine script wiki is still valid/working for OH2-beta3 ?
I’m trying to find some good javascript rule examples to build on, and not having much luck. I followed @lewie instructions from this post: port-jsr223-bundle-to-openhab-2 to get the engine installed into OH2-beta3; setup a rule definition in the paper-ui; and tried to add my javascript file in the …/conf/scripts directory; but I just get this error when I stimulate the item to change state:
[ERROR] [internal.handler.ScriptActionHandler] - Script execution failed: sun.org.mozilla.javascript.internal.EvaluatorException: illegal character (#1) in at line number 1
Could someone please provide either a link or a nice javascript example of something relatively simple to get started with?