Hi,
I’m trying to start a python script with exec command.
I have openhabian on my raspberry pi 3 and Version 2.5.10 running.
I installed the Exec-Binding via Paper UI
First I added a things in a new *.things file:
Thing exec:command:intertechnoB1 [command="/usr/bin/python /etc/openhab2/services/senditgw433.py B 1 %2$s", interval=0, timeout=5, autorun=true]
And I added a item:
String Deckenlampe "Deckenlampe" <light> {channel="exec:command:intertechnoB1:input", autoupdate="true"}
sitemap:
Switch item=Wohnzimmer_Deckenlampe mappings=[ON="ON", OFF="OFF"]
When I tried to start it I got en error with the whitelist and I added the command to the whitelist.
Tried to execute '/usr/bin/python /etc/openhab2/services/senditgw433.py B 1 %2$s', but it is not contained in whitelist.
Then I got en error with RegEx Transformation an I added the RegEx to my addons.
Now I have no error but nothing happens.
I testet the command as openhabian@openhab and it worked:
/usr/bin/python /etc/openhab2/services/senditgw433.py B 1 on
So adding the user openhab to the sudoers with no password should help.
sudo visudo -f /etc/sudoers.d/010_pi-nopasswd
Adding following lines
openhab ALL=(ALL) NOPASSWD: ALL
Then I tested as openhab@openhab:
sudo su - openhab -s /bin/bash
also this works in the shell.
Now I have no Idea. Any other ideas?