I started the migration of openHAB2 to 3 very slowly.
I did a fresh install of openHAB3.2 on a new machine.
I imported a rule from my working openHAB 2 setup.
This rule executes an external command on the openHAB console.
I saw many examples but why on earth does this not work on my setup
This is my simplified command:
var ScriptResponse = executeCommandLine(Duration.ofSeconds(10),"ssh") logInfo("DEBUGSCRIPT", ScriptResponse )
Why is this not working? VSCode says “The method ofSeconds(int) is undefined for the type Class(org.eclipse.xtext.diagnostics.Diagnostic.Linking)”
It is just as the official documentation suggests:
// When you need the output in your further rule processing var ScriptResponse = executeCommandLine(Duration.ofSeconds(60), "path/to/my/script.sh", itemState1, itemState2);
I would expect a fresh install could run this example.
I read somewhere I have to import “var Duration = Java.type(“java.time.Duration”);”. This did not help.
Why is it not recognized?
Do I have to install additional addons to make Example Rules working in openHAB3?
Any help highly appreciated.