hy guys!
i have a problem with a rule that uses shell-execute. i want to shutdown a windows pc with a buttondevice. the command for shutting down the pc works without problems from terminal on my raspberry. if i want to execute the script with a rule in pimatic there are some errors.
- error [pimatic-shell-execute]: [ShellActionHandler] Error: Command execution failed with exit code 1 (Error: Command failed: sudo: /home/pi/shutdown_pc.sh: Kommando nicht gefunden)
- error [pimatic]: rule pc-ausschalten error executing an action: undefined
- error [pimatic]: Error on evaluation of rule condition of rule pc-ausschalten: undefined
i will show you my scripts and lines and hope you can help me
the shutdown script shutdown_pc.sh
#!/bin/bash
sudo net rpc shutdown -f -I 192.168.0.20 -U kev%1234
the device in pimatic
{
"id": "PC",
"name": "PC ausschalten",
"class": "ButtonsDevice",
"buttons": [
{
"id": "ausschalten",
"text": "ausschalten"
}
]
},
the rule to execute the script
{
"id": "pc-ausschalten",
"name": "PC ausschalten",
"rule": "if ausschalten is pressed then execute \"sudo /home/pi/shutdown_pc.sh\"",
"active": true,
"logging": true
},
thanks for help!