I am trying to setup JSR223 scripting in Eclipse. I found https://github.com/eclipse-archived/smarthome/wiki/Scripted-Rule-Support, but I fear those pointers are for the old build style.
I have org.openhab.core.automation.module.script.rulesupport and org.openhab.core.automation.module.script in the Run Requirements - not sure if those are the right ones for the JSR223 engine?
For simplicity I started with Javascript as it doesn’t require any additional setup (though I am really looking to setup Jython scripting in the end).
I placed a sample file demo.js in conf/automation/jsr223:
Java.type(“org.slf4j.LoggerFactory”).getLogger(“org.openhab.core.automation.test”).debug(“HelloWorld”);
I see
21:38:14.242 [main] DEBUG o.o.c.a.m.s.i.ScriptEngineManagerImpl:77 - Initialized a generic ScriptEngineFactory for Oracle Nashorn (1.8.0_191): supports ECMAScript (ECMA - 262 Edition 5.1) with file extensions [js], names [nashorn, Nashorn, js, JS, JavaScript, javascript, ECMAScript, ecmascript], and mimetypes [application/javascript, application/ecmascript, text/javascript, text/ecmascript]
in the logs, but no indication that my demo.js ran. Any ideas where to look next? Thank you very much!
- Platform information:
- OS: Windows 10
- openHAB version: 2.5.4-SNAPSHOT
- Eclipse 2019-06