openHAB 3.0 Milestone 1 discussion

I still don’t understand the new equipment, too. I was under the impression it’s just items that have been tagged with a certain kind of tag name.
But now we have Things, Items and Equipment that is somehow available. Isn’t Equipment and a Thing the same?

1 Like

Hi MIchael,

the sematic model is based on the Brick scheme https://brickschema.org/ . It is more then just a group structure that many of us used in earlier OB versions.

As far as i see there are some errors in the UI and some shortcoming in the scheme. Like you defined a view on the technical side i defined a view on different zones like internet oder plantsensors. These concepts are not really supported.

I am waiting for a documentation on this, because in the locations tab you shoudl see your locations and i bet you see nothing.

I suggest not to put to much effort in that area yet

Cheers Thomas

1 Like

I thought openHAB3 is on the road to become more user friendly.
The more I see and play in openHAB3 I think it is getting even more complicated.

7 Likes

ah for the log i found ! this seems to work :slight_smile:
var logger = Java.type("org.slf4j.LoggerFactory").getLogger("org.eclipse.smarthome.automation.module.script.rulesupport.internal.shared.SimpleRule");
logger.error(message);

What loglevel is set for „jsr223.javascript“?

I guess it‘s warn. So debug/info is not logged.

@sihui At the moment it looks like that. But keep in mind that things are not ready. Example: Not persitence scheme editing in UI, not transformation editing in UI, Basic UI does not support Valuecoloe, labelcolor and visibily; Main Ui aloowes netes frames and the Android app is not able to display them, The analyse feature only works with rrd4j, a lot of documentation is missing, Locations, Equipment and Properties are not display in the desired tabs, … And we will find a dozen of other things that are not in place yet

I do not expect to just copy over my current setup to oh3 without massive changes to meet the new, currently unkown concepts Keep in mind development is developer driven and developers usually think a little different the the common end user

So i would suggest: Stay tuned and wait for more information

To quote some of the docs which I linked in the 3rd post of this thread…

Equipment’s are often mapped to Things but not always. You can represent a single Equipment with several Things - for instance a computer might have points to switch it on (send a wake-on-lan packet), off (shell command), determining if it’s online (network polling), how much power it consumes (Z-Wave wall plug). All these multiple Things from different bindings can be combined to model a single piece of Equipment.

In this example the Computer is the equipment and it could be located in the room called the study location. The computer is made up of multiple Things, some of which are not physical devices.

A front door can have points to determine if it’s open or closed (with a sensor) or locked (with a smart lock), and a camera/motion detector.

5 Likes

You’re trying to add equipment or point items to multiple locations, that’s not possible. Your Technik and KNX groups are not really locations and shouldn’t be part of the semantic model. If you check “Show non-semantic” at the bottom you’ll be able to see and add non-semantic groups & items.

There’s no need to include everything in the model at all costs, because it has shortcomings, that’s a rather obscure feature from OH2 which is only given a lot more spotlight… and obviously is not ready to handle every case under the sun yet.

One of the goals with this semantic model stuff is to try to identify some common relationships between items in a predictable way, for instance if you have a thermostat (represented by a group with an Equipment class) it would be valuable to identify with certainty and without manual mapping, which of the members of that group is the setpoint, the current temperature sensor, or the mode - regardless of the binding you’re using. Same thing for a media player - which items represent the track, artist, volume, album, mute, power, input source, album image and so on. For a sensor device you might have a battery level indicator, tamper alarm…

When we’re there you could for instance have a complete control in the UI for your thermostat or media player by simply pointing it to the Equipment group and it would find the rest automatically.

A strength of openHAB is that it gives you a lot of leeway when it comes to how you want to organize your functional layer (the items), and you can have it completely decoupled from your physical layer (the things), but then piecing information together reliably without manual intervention is a challenge. Organizing (part of) your items in a predictable semantic model is ultimately supposed to help you with that.

5 Likes

Hopefully the sematic model is not a dead end because of its short commings and complexity. I find it sometinge hard not to exchange a hieracicaly organised group structure with a semantic model. These are differnet. But concepts as zones or aeras are missing. For example a Heating Zone can cover the Livingroom, the kitchen and the dining room.

Just to mention that BasicUI is unchanged and of course valuecolor, labelcolor and visibility attributes from a sitemap are still applicable.

It could be. But it doesn’t have to be. For example, let’s say I have a Shelly 1 integrated with MQTT (which I do). I might have a Status Point driven by the Network Binding to show if the device is pingable combined with Channels from the MQTT Thing to see it’s current state and control it. (NOTE: This is admittedly a contrived example as one would probably rely on the LWT for this instead).

The semantic model is to some degree optional. Right now I think it is only used by two features:

  • to automatically populate Pages with default cells and widgets for Items; for example you can build a page for a given room and just import that room and all the Items that are in that room (according to the model) will populate the page.

  • HABot which is a way to interact with your openHAB system via a dynamic chat based interface. It’s almost magical and it is kind of similar to interacting with a smart assistant where you can ask it stuff like “are the lights on in Nate’s bedroom?” The semantic model is what gives it the information necessary to know what Items are lights and which of those are in Nate’s bedroom.

Yes, that works but that’s grabbing the logger directly. We should be able to access the logInfo/logDebug/et. al. openHAB Actions too. It looks like we can’t access any of the core Actions from JavaScript at this time.

It appears to be Info. But the problem was I would get a “class not found” exception when I try to type the LogAction or ExecUtil or Exec or ScriptExecution.

    var Exec = Java.type('org.openhab.core.model.script.actions.Exec');
    var LogAction = Java.type('org.openhab.core.model.script.actions.LogAction');
    var ScriptExecution = Java.type('org.openhab.core.model.script.actions.ScriptExecution');

These all generate no class found exceptions. The interesting thing is when the rule is triggered by an Item I just get a generic error.

2020-10-26 08:56:20.748 [ERROR] [e.automation.internal.RuleEngineImpl] - Failed to execute rule 'experiment': Fail to execute action: 1

When I run it by pressing play in the UI I get an actual stack trace.

2020-10-26 08:53:35.681 [WARN ] [e.automation.internal.RuleEngineImpl] - Fail to execute action: 1
java.lang.RuntimeException: java.lang.ClassNotFoundException: org.openhab.core.model.script.actions.Exec cannot be found by org.apache.aries.jax.rs.whiteboard_1.0.9
	at jdk.nashorn.internal.runtime.ScriptRuntime.apply(ScriptRuntime.java:531) ~[jdk.scripting.nashorn:?]
	at jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:456) ~[jdk.scripting.nashorn:?]
	at jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:413) ~[jdk.scripting.nashorn:?]
	at jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:409) ~[jdk.scripting.nashorn:?]
	at jdk.nashorn.api.scripting.NashornScriptEngine.eval(NashornScriptEngine.java:162) ~[jdk.scripting.nashorn:?]
	at javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:264) ~[java.scripting:?]
	at org.openhab.core.automation.module.script.internal.handler.ScriptActionHandler.lambda$0(ScriptActionHandler.java:62) ~[?:?]
	at java.util.Optional.ifPresent(Optional.java:183) ~[?:?]
	at org.openhab.core.automation.module.script.internal.handler.ScriptActionHandler.execute(ScriptActionHandler.java:59) ~[?:?]
	at org.openhab.core.automation.internal.RuleEngineImpl.executeActions(RuleEngineImpl.java:1179) [bundleFile:?]
	at org.openhab.core.automation.internal.RuleEngineImpl.runNow(RuleEngineImpl.java:1031) [bundleFile:?]
	at org.openhab.core.automation.internal.RuleEngineImpl.runNow(RuleEngineImpl.java:1047) [bundleFile:?]
	at org.openhab.core.automation.rest.internal.RuleResource.runNow(RuleResource.java:305) [bundleFile:?]
	at jdk.internal.reflect.GeneratedMethodAccessor124.invoke(Unknown Source) ~[?:?]
	at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
	at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
	at org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:179) [bundleFile:1.0.9]
	at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:96) [bundleFile:1.0.9]
	at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:201) [bundleFile:1.0.9]
	at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:104) [bundleFile:1.0.9]
	at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:59) [bundleFile:1.0.9]
	at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:96) [bundleFile:1.0.9]
	at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308) [bundleFile:1.0.9]
	at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121) [bundleFile:1.0.9]
	at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:267) [bundleFile:1.0.9]
	at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:234) [bundleFile:1.0.9]
	at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:208) [bundleFile:1.0.9]
	at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:160) [bundleFile:1.0.9]
	at org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:216) [bundleFile:1.0.9]
	at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:301) [bundleFile:1.0.9]
	at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:220) [bundleFile:1.0.9]
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:707) [bundleFile:3.1.0]
	at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:276) [bundleFile:1.0.9]
	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:852) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:544) [bundleFile:9.4.20.v20190813]
	at org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.doHandle(HttpServiceServletHandler.java:71) [bundleFile:?]
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:536) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:235) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1581) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1307) [bundleFile:9.4.20.v20190813]
	at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle(HttpServiceContext.java:293) [bundleFile:?]
	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:482) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1549) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1204) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) [bundleFile:9.4.20.v20190813]
	at org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:80) [bundleFile:?]
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.server.Server.handle(Server.java:494) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:374) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:268) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:117) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:336) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:313) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:171) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:129) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:367) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:782) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:918) [bundleFile:9.4.20.v20190813]
	at java.lang.Thread.run(Thread.java:834) [?:?]
Caused by: java.lang.ClassNotFoundException: org.openhab.core.model.script.actions.Exec cannot be found by org.apache.aries.jax.rs.whiteboard_1.0.9
	at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:484) ~[org.eclipse.osgi-3.12.100.jar:?]
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:395) ~[org.eclipse.osgi-3.12.100.jar:?]
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:387) ~[org.eclipse.osgi-3.12.100.jar:?]
	at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:150) ~[org.eclipse.osgi-3.12.100.jar:?]
	at java.lang.ClassLoader.loadClass(ClassLoader.java:522) ~[?:?]
	at org.eclipse.osgi.internal.framework.EquinoxBundle.loadClass(EquinoxBundle.java:564) ~[org.eclipse.osgi-3.12.100.jar:?]
	at org.ops4j.pax.swissbox.core.BundleClassLoader.findClass(BundleClassLoader.java:176) ~[bundleFile:?]
	at java.lang.ClassLoader.loadClass(ClassLoader.java:589) ~[?:?]
	at org.ops4j.pax.swissbox.core.BundleClassLoader.loadClass(BundleClassLoader.java:192) ~[bundleFile:?]
	at java.lang.ClassLoader.loadClass(ClassLoader.java:522) ~[?:?]
	at java.lang.Class.forName0(Native Method) ~[?:?]
	at java.lang.Class.forName(Class.java:398) ~[?:?]
	at jdk.nashorn.internal.runtime.Context.findClass(Context.java:1180) ~[jdk.scripting.nashorn:?]
	at jdk.nashorn.internal.objects.NativeJava.simpleType(NativeJava.java:546) ~[jdk.scripting.nashorn:?]
	at jdk.nashorn.internal.objects.NativeJava.type(NativeJava.java:326) ~[jdk.scripting.nashorn:?]
	at jdk.nashorn.internal.objects.NativeJava.type(NativeJava.java:318) ~[jdk.scripting.nashorn:?]
	at jdk.nashorn.internal.objects.NativeJava.type(NativeJava.java:314) ~[jdk.scripting.nashorn:?]
	at jdk.nashorn.internal.scripts.Script$Recompilation$557$\^eval\_.:program(<eval>:11) ~[?:?]
	at jdk.nashorn.internal.runtime.ScriptFunctionData.invoke(ScriptFunctionData.java:655) ~[jdk.scripting.nashorn:?]
	at jdk.nashorn.internal.runtime.ScriptFunction.invoke(ScriptFunction.java:513) ~[jdk.scripting.nashorn:?]
	at jdk.nashorn.internal.runtime.ScriptRuntime.apply(ScriptRuntime.java:527) ~[jdk.scripting.nashorn:?]

When I import the logger from slf4j it works and will log out anything Info or above when I use org.model.script.Rules as the base for the logger.

var logger = Java.type("org.slf4j.LoggerFactory").getLogger("org.openhab.model.script.Rules.Experiments");
logger.error("This is an error log");
logger.warn("This is a warning log");
logger.info("This is an info log");
logger.debug("This is a debug log");
logger.trace("This is a trace log");

Everything up to logger.info in the above shows up in the logs. I still don;t know it it’s just something I’m doing wrong yet so I’ve not files an issue. But I hope to work on it more this week to figure out if it’s my problem or if something isn’t working properly.

I’ve only done a some basic stuff with the semantic model, but in that case wouldn’t you create a location to represent the zone and put the three rooms into that location. And then the heating zone equipment would live in the new zone location instead of in each of the three rooms.

@Lolodomo That is alittle bit right and a little bit wrong.

I assume that valuecolor rtc are working if you create a sitemap based on a textfile but if you use the mainUI to create a sitemap these options are not available.

I think this sould and will be changed during the development cycle otherwise i see big problems if text configuration offers more options that ui configuration. On the above statet Problem is an issue open.

I have not yet found where you can build sitemap in the main UI.

@Lolodomo Thats simple and i like the function. In settings you will find the option pages. Click on it. In the lower right you now should see a plus sign. Click on it. The last option shown is to create a sitemap (for basicUI). Click on it. A new sitemap is created and the Ui Editor is opend. Just try it.

2 Likes

The class Name is Not org.openhab.core.model.script.actions.LogAction .

It‘s org.openhab.core.model.script.actions.Log

1 Like

Edit: I figured it out. In the end it was a combination of messing up how to use Duration and having the wrong paths to the classes. The following JavaScript shows how to:

  • import and use the native logger
  • import and use the openHAB Logger Actions
  • import and use Exec to call executeCommandLine
  • comparing a quantity type to a constant quantity type and a way to convert a quantity type to a primitive

NOTE: The core actions only appear to work when the rule is triggered by an Item. They do not work when triggered by pressing the play button. I don’t know if there is a similar limitation with cron triggered rules. I’ve written the above as JSONDB rules. The full rule, exported as YAML is

triggers:
  - id: "2"
    configuration:
      itemName: aTestSwitch
    type: core.ItemCommandTrigger
conditions: []
actions:
  - inputs: {}
    id: "1"
    configuration:
      type: application/javascript
      script: >
        var logger =
        Java.type("org.slf4j.LoggerFactory").getLogger("org.openhab.model.script.Rules.Experiments");

        logger.error("This is an error log");

        logger.warn("This is a warning log");

        logger.info("This is an info log");

        logger.debug("This is a debug log");

        logger.trace("This is a trace log");


        //var HTTP      = Java.type("org.openhab.core.model.script.actions.HTTP");

        //var ExecUtil = Java.type(org.openhab.core.model.script.actions)

        //var Exec = Java.type('org.openhab.core.model.script.actions.Exec')


        var Log = Java.type("org.openhab.core.model.script.actions.Log");

        Log.logError("Experiments", "This is an OH error log");

        Log.logWarn("Experiments", "This is an OH warn log");

        Log.logInfo("Experiments", "This is an OH info log");

        Log.logDebug("Experiments", "This is an OH debug log");

        // There is no trace


        logger.info("About to type Exec")

        var Exec = Java.type("org.openhab.core.model.script.actions.Exec");

        logger.info("About to type Duration");

        var Duration = Java.type("java.time.Duration");

        logger.info("About to executeCommandLine");

        var results = Exec.executeCommandLine(Duration.ofSeconds(1), "echo", "hello");

        logger.info("results = " + results);


        logger.info("Cloudiness = {}", items["vCloudiness"]); logger.info("Coudiness without QuantityType = {}", 
                    parseFloat(items["vCloudiness"].toString().split(' ')[0]));
        logger.info("New QuantityType = {}",
                    new QuantityType("50.0 %"));
        logger.info("Comparison to QuantityType = {}", 
                    items["vCloudiness"] > new QuantityType("50.0 %"));
    type: script.ScriptAction
  - inputs: {}
    id: "3"
    configuration:
      type: application/vnd.openhab.dsl.rule
      script: >-
        logInfo("Experiments", "Info log")


        val results  = executeCommandLine(java.time.Duration.ofSeconds(1), "echo", "'hello world")

        logInfo("Experiments", results)
    type: script.ScriptAction

Below is no longer applicable, I leave it here for context.


I’ve tried that one too…

The code:

var logger = Java.type("org.slf4j.LoggerFactory").getLogger("org.openhab.model.script.Rules.Experiments");
logger.error("This is an error log");
logger.warn("This is a warning log");
logger.info("This is an info log");
logger.debug("This is a debug log");
logger.trace("This is a trace log");

//var HTTP      = Java.type("org.openhab.core.model.script.actions.HTTP");
//var ExecUtil = Java.type(org.openhab.core.model.script.actions)
//var Exec = Java.type('org.openhab.core.model.script.actions.Exec')

var Log = Java.type("org.openhab.core.model.script.actions.Log");
Log.logError("Experiments", "This is an OH error log");
Log.logWarn("Experiments", "This is an OH warn log");
Log.logInfo("Experiments", "This is an OH info log");
Log.logDebug("Experiments", "This is an OH debug log");
// There is no trace

var Exec = Java.type("org.openhab.core.model.script.actions.Exec");
var results = Exec.executeCommandLine(java.time.Duration().ofSeconds(1), "echo", "hello");
logger.info("results = " + results);

logger.info("Cloudiness = {}", items["vCloudiness"]); logger.info("Coudiness without QuantityType = {}", 
            parseFloat(items["vCloudiness"].toString().split(' ')[0]));
logger.info("New QuantityType = {}",
            new QuantityType("50.0 %"));
logger.info("Comparison to QuantityType = {}", 
            items["vCloudiness"] > new QuantityType("50.0 %"));

Logs when I run it using the play button:

2020-10-26 12:33:08.419 [ERROR] [enhab.model.script.Rules.Experiments] - This is an error log
2020-10-26 12:33:08.426 [WARN ] [enhab.model.script.Rules.Experiments] - This is a warning log
2020-10-26 12:33:08.429 [INFO ] [enhab.model.script.Rules.Experiments] - This is an info log
2020-10-26 12:33:08.446 [WARN ] [e.automation.internal.RuleEngineImpl] - Fail to execute action: 1
java.lang.RuntimeException: java.lang.ClassNotFoundException: org.openhab.core.model.script.actions.Log cannot be found by org.apache.aries.jax.rs.whiteboard_1.0.9
	at jdk.nashorn.internal.runtime.ScriptRuntime.apply(ScriptRuntime.java:531) ~[jdk.scripting.nashorn:?]
	at jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:456) ~[jdk.scripting.nashorn:?]
	at jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:413) ~[jdk.scripting.nashorn:?]
	at jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:409) ~[jdk.scripting.nashorn:?]
	at jdk.nashorn.api.scripting.NashornScriptEngine.eval(NashornScriptEngine.java:162) ~[jdk.scripting.nashorn:?]
	at javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:264) ~[java.scripting:?]
	at org.openhab.core.automation.module.script.internal.handler.ScriptActionHandler.lambda$0(ScriptActionHandler.java:62) ~[?:?]
	at java.util.Optional.ifPresent(Optional.java:183) ~[?:?]
	at org.openhab.core.automation.module.script.internal.handler.ScriptActionHandler.execute(ScriptActionHandler.java:59) ~[?:?]
	at org.openhab.core.automation.internal.RuleEngineImpl.executeActions(RuleEngineImpl.java:1179) [bundleFile:?]
	at org.openhab.core.automation.internal.RuleEngineImpl.runNow(RuleEngineImpl.java:1031) [bundleFile:?]
	at org.openhab.core.automation.internal.RuleEngineImpl.runNow(RuleEngineImpl.java:1047) [bundleFile:?]
	at org.openhab.core.automation.rest.internal.RuleResource.runNow(RuleResource.java:305) [bundleFile:?]
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
	at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
	at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
	at org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:179) [bundleFile:1.0.9]
	at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:96) [bundleFile:1.0.9]
	at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:201) [bundleFile:1.0.9]
	at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:104) [bundleFile:1.0.9]
	at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:59) [bundleFile:1.0.9]
	at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:96) [bundleFile:1.0.9]
	at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308) [bundleFile:1.0.9]
	at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121) [bundleFile:1.0.9]
	at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:267) [bundleFile:1.0.9]
	at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:234) [bundleFile:1.0.9]
	at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:208) [bundleFile:1.0.9]
	at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:160) [bundleFile:1.0.9]
	at org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:216) [bundleFile:1.0.9]
	at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:301) [bundleFile:1.0.9]
	at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:220) [bundleFile:1.0.9]
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:707) [bundleFile:3.1.0]
	at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:276) [bundleFile:1.0.9]
	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:852) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:544) [bundleFile:9.4.20.v20190813]
	at org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.doHandle(HttpServiceServletHandler.java:71) [bundleFile:?]
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:536) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:235) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1581) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1307) [bundleFile:9.4.20.v20190813]
	at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle(HttpServiceContext.java:293) [bundleFile:?]
	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:482) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1549) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1204) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) [bundleFile:9.4.20.v20190813]
	at org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:80) [bundleFile:?]
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.server.Server.handle(Server.java:494) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:374) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:268) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:117) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:336) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:313) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:171) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:129) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:367) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:782) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:918) [bundleFile:9.4.20.v20190813]
	at java.lang.Thread.run(Thread.java:834) [?:?]
Caused by: java.lang.ClassNotFoundException: org.openhab.core.model.script.actions.Log cannot be found by org.apache.aries.jax.rs.whiteboard_1.0.9
	at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:484) ~[org.eclipse.osgi-3.12.100.jar:?]
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:395) ~[org.eclipse.osgi-3.12.100.jar:?]
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:387) ~[org.eclipse.osgi-3.12.100.jar:?]
	at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:150) ~[org.eclipse.osgi-3.12.100.jar:?]
	at java.lang.ClassLoader.loadClass(ClassLoader.java:522) ~[?:?]
	at org.eclipse.osgi.internal.framework.EquinoxBundle.loadClass(EquinoxBundle.java:564) ~[org.eclipse.osgi-3.12.100.jar:?]
	at org.ops4j.pax.swissbox.core.BundleClassLoader.findClass(BundleClassLoader.java:176) ~[bundleFile:?]
	at java.lang.ClassLoader.loadClass(ClassLoader.java:589) ~[?:?]
	at org.ops4j.pax.swissbox.core.BundleClassLoader.loadClass(BundleClassLoader.java:192) ~[bundleFile:?]
	at java.lang.ClassLoader.loadClass(ClassLoader.java:522) ~[?:?]
	at java.lang.Class.forName0(Native Method) ~[?:?]
	at java.lang.Class.forName(Class.java:398) ~[?:?]
	at jdk.nashorn.internal.runtime.Context.findClass(Context.java:1180) ~[jdk.scripting.nashorn:?]
	at jdk.nashorn.internal.objects.NativeJava.simpleType(NativeJava.java:546) ~[jdk.scripting.nashorn:?]
	at jdk.nashorn.internal.objects.NativeJava.type(NativeJava.java:326) ~[jdk.scripting.nashorn:?]
	at jdk.nashorn.internal.objects.NativeJava.type(NativeJava.java:318) ~[jdk.scripting.nashorn:?]
	at jdk.nashorn.internal.objects.NativeJava.type(NativeJava.java:314) ~[jdk.scripting.nashorn:?]
	at jdk.nashorn.internal.scripts.Script$Recompilation$82$\^eval\_$cu1$restOf.:program(<eval>:12) ~[?:?]
	at jdk.nashorn.internal.runtime.ScriptFunctionData.invoke(ScriptFunctionData.java:655) ~[jdk.scripting.nashorn:?]
	at jdk.nashorn.internal.runtime.ScriptFunction.invoke(ScriptFunction.java:513) ~[jdk.scripting.nashorn:?]
	at jdk.nashorn.internal.runtime.ScriptRuntime.apply(ScriptRuntime.java:527) ~[jdk.scripting.nashorn:?]
	... 66 more

Logs when I trigger it by an Item.

2020-10-26 12:37:52.504 [ERROR] [enhab.model.script.Rules.Experiments] - This is an error log
2020-10-26 12:37:52.509 [WARN ] [enhab.model.script.Rules.Experiments] - This is a warning log
2020-10-26 12:37:52.521 [INFO ] [enhab.model.script.Rules.Experiments] - This is an info log
2020-10-26 12:37:52.526 [ERROR] [e.automation.internal.RuleEngineImpl] - Failed to execute rule 'experiment': Fail to execute action: 1

EDIT: Doh! I forgot the logger name. The code above (once corrected) does in fact work when triggered by an Item. It does not work when pressing the Play button.

executeCommandLine doesn’t work in either case.

1 Like

Liking OH3 so thank-you to all the contributers. Does anyone know if WOL will ever return? Has it been dropped because of the new permissions problem in the exec binding?

Bw

S

It’s been integrated into the Network binding. Scroll to the bottom of the binding docs for an example!

1 Like

Is the system MQTT Broker not working?

Do you mean the embedded moquette broker? It got removed, use mosquito as your broker.