I tried to familiarize myself with the javascript rules but already having difficulties with the first steps.
The problem is that these rules seems not to be triggered. I see a log entry that rule is enqued after copying into Automation/js directory (or saving saving changes to the file) but nothing happens after this.
I would expect āHello World!ā logs to appear every 10seconds in the log but it is not the case. No related log, no related warning, no related error.
The basic openhab javascript scripting automation is installed:
Use console logging (e.g. console.log or console.info) instead. When manually creating a logger, you also have to ensure that its logger name is handled and itās log output is written to the openHAB log file. When using console logging, all of this is handled for you.
I wonder if the logging section of the JS Scripting readme should same more about that. As it currently reads, it doesnāt mention this potential problem and makes it seem creating a logger and useing console is equivalent.
Iām still working on composing something for the file locations. Hopefully Iāll remember to come back to this. But if someone gets to it first that would be great too.
Yeah, Iāve also thought about how to improve this situation. Actually, I think documenting the log namespace in the README might not be a great idea, because I donāt think there is any real reason to use log over console logging. Console logging also allows adjusting the logger name. The log namespace is mainly used by openhab-js internally, openhab-js has a different use case for logging though than most scripts. The log namespace will still be documented in JSDoc, but not listing it in the README will create less confusion.
So, the polyglot class is not found for some reason by the openhab environment. As I see the polyglot kar file is in the path ā./var/lib/openhab/tmp/kar/openhab-addons-5.1.0ā. Shouldnāt it be declared in the CLASSPATH?
Ok, so: Iāve missed a log entry in the first place that explains this issue. CPU architecture is not supported (ARM). I am running openhab on a raspberry pi 4 with ARM 32bit.
Do you know if it is possible to have JS scripting for this CPU?
Just FYI openHAB 5.0.0 and newer officially isnāt supported to run on 32 bit OS. Either donāt use JS Scripting (and anything else GraalVM-based) or backup your system and reinstall it to a 64-bit openHABian version. 64-bit also brings a massive speed improvement to JS Scripting compared to running openHAB 4.3.x on 32-bit.
Alternatively use openHAB 4.3.x until you find the time to reinstall openHABian.