i have an issue with the exec binding. I was following this example here: https://tutorials-raspberrypi.de/raspberry-pi-openhab-relais-steuern-rollladen-lichter/
There’s a switch which should call a python script but in the log it just says relais1Switch changed from ON to OFF but the command to call the script does not show up here.
My assumption is, that the script isn’t called at all so that’s why it’s also not running.
I’m totally a beginner here but was trying to debug as far as i could but now i got stock since i don’t know how can i debug that this script is not called…
I apologize, maybe try in: /usr/share/openhab2/runtime/bin$
It could be because of permission issues and this folder has all the permissions for the openhab user.
yes tried that as well. the error does not show up but also the file in the directory.
I really don’t know what these *bin directories are but whenever I copy sth into it, the file does not show up there…
btw. just managed to implement the same functionality with the GPIO binding successfully.
But would still be nice to find out why the python script isn’t working… :-/
Using those two articles you should have learned how to create the file and set its permissions so the openhab user can execute it. It doesn’t matter where you put the python script so long as you use the full path to it in your exec binding Thing.
Test you can run it as root and it will work: sudo relais.py.
Test you can run it as openhab and it will work: sudo -u openhab relais.py
Test you can run it using the executeCommandLine in a Rule triggered by a proxy Item.
rule "Testing python script"
when
Item TestItem received command
then
val results = executeCommandLine("path to script and arguments")
logInfo("Test", results)
end
If there are errors from the script you will see them in openhab.log.
If you got everything to work up to this point, now configure the exec binding.