There are 2 pi in this setup:
- PI-domo: running domoticz
- PI-pump: controlling a pump with one GPIO
Those pi are far away, but can communicate through network. PI-domo has some passwordless ssh login setup to pi-pump, and contains three scripts:
- pump_on.sh: sends value to gpio with ssh to turn pump on and returns 1
`ssh pi@pi-pump -n "echo 0 > /sys/class/gpio/gpio18/value" && echo 1`
pump_off.sh: sends value to gpio with ssh to turn pump off and returns 0
ssh pi@pi-pump -n "echo 1 > /sys/class/gpio/gpio18/value" && echo 0
pump_status.sh: returns 1 if pump is on, 0 if pump is off.
All three scripts work as expected when launched in bash, but I can not find how to call them with domoticz. I created a virtual switch and set those as script:///.....[on off].sh but domoticz doesn't seem to be running any of them. nor could I find a place to read the status...
Any idea or link to a RECENT (working) tutorial would be welcome!
I know that this is a old thread and it is answered already, but I have stumbled on the same issue and found that online answers lacked detail. So, here it goes:
sudo su
to become rootssh-keygen -t rsa -b 4096 -C "nameofyourkey"
ssh-copy-id -i /root/.ssh/yourkey.pub pi@pi-pump
Note 1: Although logging in as root of PI-domo, it is critical that pump_off and pump_status.sh contain pi@pi-pump and not root@pi-pump or this approach will fail.
Note 2: Domoticz log indicates that the above process has some error by outputting
Error: Error executing script command (/home/pi/domoticz/scripts/pump_off.sh). returned: 65280
. Note the 65280 error in particular