I switched to openhab 3 a few days ago. Now I realize that my rules with excecuteCommandLine are not working anymore. I saw that the syntax changed and I corrected the syntax according to the documentation. The strange thing is that “standard shell command” like “ls” or “pwd” are excecuted fine and I see the returned result. If I call a python script, its not excetuted at all and I also don’t see an error in the log.
Here my symplified rule. Only with pythin version output:
val telegramAction = getActions("telegram","telegram:telegramBot:mybot")
// works fine!
var result = executeCommandLine(Duration.ofSeconds(50),"pwd")
telegramAction.sendTelegram("test: "+result)
//does not work!!:
result = executeCommandLine(Duration.ofSeconds(50),"/usr/bin/python", "-V")
telegramAction.sendTelegram("test2: "+result)
In telegram I see the following.
test: /var/lib/openhab
test2:
Python is not called! No errors in log.
Does anybody can give me a hint where I should continue searching. In the forum I saw similar issues with sudo commands but not with such standard thinks…
Update 14:50: Python3 works! Strange… What can be the difference?
val telegramAction = getActions("telegram","telegram:telegramBot:mybot")
//Python3 works also!!:
result = executeCommandLine(Duration.ofSeconds(50),"python3", "-V")
telegramAction.sendTelegram("test2: "+result)
In telegram I see the following.
test2: Python 3.7.3
gitHub issie create: