I’m using a Shell Command to run Python image inference and it should be working in accordance to a particular sensor state. If sensor is ON, my shell command gets launched:
shell_command:
camdetect_start: sshpass -p 'pass' ssh -tt [email protected] 'echo pass| sudo -S -s /bin/bash -c "python3 /home/max/camdetect.py"'
In case sensor is OFF, then this process gets killed by another shell command:
sshpass -p 'pass' ssh -tt [email protected] 'echo pass| sudo -S -s /bin/bash -c "pkill -9 -f camdetect.py"
When I launch the 1st command, the Python process works for some time and then suddenly gets killed. It’s strange because if I launch the same bash command from within Ubuntu terminal, it stays in memory unless I manually kill it. Why does it happen like that?
Is there any special way of launching shell script I need to use from HA?
Same thing happens when I launch the command from Node Red.