Bash script calls Voordeur.sh This simple script just turn the light on
First attempt:
Code: Select all
#!/bin/sh
/usr/bin/curl "http://$192.XXX.X.XX:XXXX/json.htm?type=command¶m=switchlight&idx=54&switchcmd=On"Code: Select all
#!/bin/sh
Server=192.XXX.X.XX:XXXX
Port=XXXX
curl -s "http://$Server:$Port/json.htm?type=command¶m=switchlight&idx=54&switchcmd=On"
Code: Select all
commandArray = {}
if (devicechanged['Deurbel voordeur']=='On') then
os.execute('/home/pi/domoticz/scripts/Voordeur.sh')
os.execute('/home/pi/domoticz/scripts/SentSnapshot.sh')
os.execute('/home/pi/domoticz/scripts/SentSnapshot.sh')
os.execute('/home/pi/domoticz/scripts/SentSnapshot.sh')
os.execute('/home/pi/domoticz/scripts/SentSnapshot.sh')
print('Script Deurbel is ingedrukt')
end
return commandArray
The reason why os.execute('/home/pi/domoticz/scripts/SentSnapshot.sh') is repeat is because I want to take 4 snapshots. The repeating action works just fine.