Page 1 of 1
Execute Batch file on remote PC
Posted: Wednesday 18 November 2015 19:05
by Thomasdc
Hi everybody!
I run Domoticz on a Raspberry pi
I wondered if it was possible to execute a Batch file on a windows 10 pc with domoticz on the Raspberry pi
(i saw that it was possible to shut down a pc remotly, so i was hoping that maybe executing a batch file on a remote pc would also be possible)
the way i see it there are 2 "scenario's"
1) The code is in a batch file on the pc and the Rpi with domoticz on it send a command to the pc to execute the batch file
2) The code is sent from the Rpi to the Remote PC (some kind of SSH connection? )
I don't know if any of those 2 are possible, but it would help me a lot!
Thanks!
Re: Execute Batch file on remote PC
Posted: Wednesday 18 November 2015 19:45
by Raspberry Piet
Hi Thomas,
That would be possible by using scenario nr 1.
I use
Evenghost with
AutoRemote plugin to achieve this.
But i'm sure there is also another plugin for Eventghost that could do the same.
Re: Execute Batch file on remote PC
Posted: Wednesday 18 November 2015 20:08
by bizziebis
You can also install Domoticz on your Windows PC and connect both Domoticz to each other

Re: Execute Batch file on remote PC
Posted: Wednesday 18 November 2015 20:25
by Thomasdc
Raspberry Piet wrote:Hi Thomas,
That would be possible by using scenario nr 1.
I use
Evenghost with
AutoRemote plugin to achieve this.
But i'm sure there is also another plugin for Eventghost that could do the same.
Thanks!
has anyone experience with this but with Domoticz instead of tasker?
bizziebis wrote:You can also install Domoticz on your Windows PC and connect both Domoticz to each other

i thought of this also but i rather not instal domoticz for something simple like executing some code once maybe twice a day.
mostly i would like a "scenario 2" manner to do this, this way i can program all the code on 1 place (the RPI) and if i ever replace my computers it all keeps working with little modification (permissions settings or something )
Re: Execute Batch file on remote PC
Posted: Wednesday 18 November 2015 20:46
by Raspberry Piet
Thomasdc wrote:Raspberry Piet wrote:Hi Thomas,
That would be possible by using scenario nr 1.
I use
Evenghost with
AutoRemote plugin to achieve this.
But i'm sure there is also another plugin for Eventghost that could do the same.
Thanks!
has anyone experience with this but with Domoticz instead of tasker?
I use it with the AutoRemote plugin like this:
RPI CLI:
Code: Select all
curl -m 1 "http://192.168.1.10:1817/?message=ARPAR=:=ARCOMM"
Evenghost:
Then add macro:

Re: Execute Batch file on remote PC
Posted: Friday 20 November 2015 19:48
by Thomasdc
This works great!!! so easy to use! the possibilities are amazing!
Big thanks for this suggestion Raspberry Piet!
Re: Execute Batch file on remote PC
Posted: Friday 20 November 2015 20:47
by Raspberry Piet
Thomasdc wrote:This works great!!! so easy to use! the possibilities are amazing!
Big thanks for this suggestion Raspberry Piet!
Yes, Eventghost is amazing. (it's like a sort of Tasker for Windows)

Many useful
plugins available also!
AutoRemote is my favorite. Works with EventGhost, Tasker and
Linux here.
Here is my simple AutoRemote bash script i use to send messages to EventGhost and my android smartphone:
- Spoiler: show
Code: Select all
#!/bin/sh
ARPAR=$1 # %arpar(): array with all the parameters at the left of =:=
ARCOMM=$2 # %arcomm: all the words at the right of =:= (if only one =:= is present)
TTL=$3 # Time in seconds AutoRemote will try to deliver the message for before giving up
################################################
# Settings
KEY="xxxxxx" #SMARTPHONE
EG_IP="192.168.1.10"
EG_PORT="1817"
################################################
# SEND AUTOREMOTE MESSAGE TO SMARTPHONE (WAN)
string="https://autoremotejoaomgcd.appspot.com/sendmessage?key=$KEY&message=$ARPAR=:=$ARCOMM&ttl=$TTL"
string2=$( printf "%s\n" "$string" | sed 's/ /%20/g' )
echo $string2
curl "$string2"
#################################################
# SEND AUTOREMOTE MESSAGE TO EVENTGHOST (LAN)
string="http://$EG_IP:$EG_PORT/?message=$ARPAR=:=$ARCOMM"
string2=$( printf "%s\n" "$string" | sed 's/ /%20/g' )
echo $string2
curl -m 1 "$string2"
Example:
Code: Select all
/home/pi/domoticz/scripts/bash/AutoRemote.sh "CMD" "DOORBELL" "10"
Sends this message to EvenGhost (which executes VLC opening ipcam stream), ...
endless possibilities!
