Page 1 of 1

run switch script from another pi ?

Posted: Friday 19 October 2018 18:32
by adeibiza
i have 4 pi's doing different stuff and want to run just one dashboard on pi 1

sending data (temp/hum) from the others to pi 1 should be no problem i just change the ip address in the script running on the others but how would i go about running a script in pi 1 domo to open & close a switch on pi 2,3,4 ? (i want to avoid using mqqt at the moment if i can until i get my head around it)

ie instead of this on pi 1 (192.168.8.30)

Code: Select all

script:///home/pi/domoticz/scripts/on1.sh
can i simply do something like this in pi 1 domo dashboard

Code: Select all

http://192.168.8.31/scripts/on1.sh
not sure what the url structure would be ?

Re: run switch script from another pi ?

Posted: Friday 19 October 2018 19:52
by snellejellep
you could do something like this:

make a virtual push on button using dummy hardware: https://www.domoticz.com/wiki/Hardware_ ... y_Hardware

edit that switch and put in the on action: script:///home/pi/domoticz/scripts/on1.sh

then use the following http command: http://username:password@yourdomoticzip:yourdomoticzport/json.htm?type=command&param=switchlight&idx=200&switchcmd=On

in the bolded idx fill in the idx of the just created virtual push button

Re: run switch script from another pi ?

Posted: Friday 19 October 2018 20:13
by adeibiza
hmmm yeah, but that would mean having to set up a mirror of pi 1 domo switches on the install of pi 2 domo ? as on1.sh/off1.sh, runs a python script that changes the gpio pins from high to low and vice versa (piot relay)

alternatively is it possible to run a script on pi 2 from pi 1 (i realise that this is outside of the domoticz platform)

Re: run switch script from another pi ?

Posted: Saturday 20 October 2018 7:46
by snellejellep
If you have domoticz on both pi's you can just use the remote server hardware

Re: run switch script from another pi ?

Posted: Saturday 20 October 2018 13:38
by adeibiza
aaaah - thanks :)