Hi,
@Havym
You wrote:
Maybe i should mention it before but domoticz is run by user pi and not by root.
I have been focused on the fact that Domoticz runs as root, which is the case by default.
That changes the way we have to think and you can forget all previous links and suggestions.
I overlooked also an important error message:
IOError: [Errno 2] No such file or directory: 'remotes/Overkapping.txt'
I see also: -rwsr-xr-x 1 root root 4516 Apr 13 16:03 controller.py
I advise you to remove the setuid permission, as the controller.py is owned by root. Having setuid permission on root owned files opens your system to intrusion.
And you can also change the ownership back to the pi user
Having done these things, have a look at:
https://www.domoticz.com/forum/viewtopic.php?t=7465
The answer is probably there.
You need an intermediate script.
Change the script in Domoticz for ON to: ///home/pi/domoticz/scripts/controllerON.sh
Create a script in the scripts directory, called controllerON.sh
Contents controllerON.sh:
Code: Select all
#!/bin/sh
python controller.py Overkapping open > /dev/null 2>&1 &
exit 0
And the same with the script for OFF: ///home/pi/domoticz/scripts/controllerOFF.sh
Contents of controllerOFF.sh:
Code: Select all
#!/bin/sh
python controller.py Overkapping close > /dev/null 2>&1 &
exit 0
I hope you have success, but at least I wish you a nice weekend.
Regards