I have the following set-up:
- Domoticz running on a Pi
- Security camera software (Shinobi) on a dedicated server
- On motion detection, Shinobi calls a url to set a virtual switch in Domoticz to ON:
Code: Select all
http://192.168.178.60:8080/json.htm?type=command¶m=udevice&idx=785&nvalue=1
- In Domoticz, the switch is set to run a script when the status changes to ON. The script looks like this:
Code: Select all
#!/bin/bash
SnapFile="/var/tmp/camsnapshot.jpg"
# Get snapshot via Domoticz server
wget -O $SnapFile "http://192.168.178.60:8080/camsnapshot.jpg?idx=1"
curl -s -X POST "https://api.telegram.org/botxxxxxxx/sendPhoto" -F chat_id=-xxxxx -F photo="@$SnapFile"
# Remove Image
/bin/rm $SnapFile
The permissions of the script are set to 777.
What am I doing wrong here?