I adapted it and after the usual 4 hours of hair pulling, it worked!
I have no idea why you have to put …
+ " "
…after the variable.
I guess it is just one of the many “precious” little tests that OpenHAB likes to put us through, to abandon everything we have learned from nearly every other language
rule "Ivona TTS"
when
Item Speak_Ivona changed
then
{
var String command
var String commandFull
logDebug("Ivona_TTS", "String " + Speak_Ivona.state + " ")
command = "python3@@/opt/openhab/configurations/scripts/ivona_brian.py@@"
commandFull = executeCommandLine(command + Speak_Ivona.state + " ")
}
end
So I can now just update the item with what I want it to say
I tried use this syntax in a rule executeCommandLine("python@@./home/pi/drive.py ") or
executeCommandLine(“python@@/home/pi/drive.py “) or
executeCommandLine(”/usr/bin/python /home/pi/drive.py”) etc…
the log response is always positive (for exemple: "executed commandLine ‘python drive.py’ ")
but the script doesn’t work as it does when I launch it normally from the terminal
I’m running on a rasp jessie
what should I write? thanks
I am not sure, I appear to be struggling a little with it this week. What once worked, now doesn’t.
I think my issues are permission related due to removing my manual install and reinstalling via apt-get (I’m on Wheezy on a Pi). I.e. having to make sure script and rule files were now owned by user “openhab” rather than “pi”. I also had to add openhab to the group “audio”.
Not sure my experience is relevant but it might point you in the right direction
If you haven’t already may be worth temporarily running openhab as root, just to see if that fixes things. If it does then definitely a permissions issue.