today I upgraded from OH2.5 to OH3 and all went fine so far. Now I am testing all my different rules and commands. At one point I getting stucked on an error I cannot explain:
Failed to execute commandLine ‘[node /etc/openhab/scripts/node_modules/njstuya/njstuya.js]’
The command is whitelisted, the ownership is set to openhab und the rights on the file are 777
Sorry to interrupt: There is always this syntax used:
-> Duration.fromSeconds(timeout)
But for me it only works (DSL-Rule) with:
Duration.ofSeconds(timeout)
@NorbertHD @Confectrician
Good idea but it is not the problem. The if conditions are simply skipped. Its offline, because my start condition is Offline. Both ifs are not active. When i uncomment: //test=“ON” the rules are working again.
Here is my script:
#!/bin/bash
ping -c1 $1 > /dev/null
if [ $? -ne 0 ]; then
echo “OFF”
else
echo “ON”
fi
log:
21:51:25.541 [INFO ] [openhab.event.ItemCommandEvent ] - Item ‘Debug_Button’ received command ON
21:51:25.554 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item ‘Debug_Button’ changed from OFF to ON
21:51:25.837 [ERROR] [org.openhab.core.model.script.test ] - ON
executeCommandLine was rewritten in OH 3. Frankly, the current way it behaves is more correct. echo outputs the message followed by a newline. If OH 2 didn’t include the newline it wasn’t returning the full output of your script which is wrong.
While you are at it, the paths to the users.properties files in the Console page describing how to change the password are still openhab2. I’ve got a sticky note on my monitor but if you’re already making a PR…