Doubts about calling actions from OH 3.0 rules

you don’t even need an explicit Java.type in this case with Nashorn (you might prefer including it for clarity though), so this works:.

var logger = org.slf4j.LoggerFactory.getLogger("org.openhab.model.script.Rules");
logger.info("hey!");

For debugging (temporary!) purposes you can also simply use something like print(actions);, this will output something in the console (not in the log) like:

org.openhab.core.automation.module.script.internal.defaultscope.ScriptThingActions@638aa36

Looking at the code of this class in openhab-core’s code, we can gather it has indeed a get method requiring a scope and a thingUID - that’s how I figure out what’s accessible in the default scope:

1 Like