rule "TV"
when
Item TV changed
then
if(TV.state == ON){
exexuteCommandLine("/path/tvon.sh")
}else{
executeCommandLine("/path/tvoff.sh")
}
end
But when i click the switch, its not turning on
i did chmod +x on scripts and its still not working.
When i run it on normal command line it works. How to fix that?
If you look at other posts about having trouble with executeCommandLine(), you will see it is useful to look in your openhab.log and see if any errors are reported at run time.
If that does not help enough, checking the results can go further
var xresults = executeCommandLine((Duration.ofSeconds(10), "/path/tvoff.sh")
logInfo("test", "results " + xresults)
I think you’ll have to give the full path, though.