Script not executed
Posted: Monday 05 March 2018 21:27
Hello community,
On this forum I've found a (doorbell) BASH-script that will capture an image from my camera and send it through Telegram to our mobiles.
I've made a doorbell (a WeMos D1 running TASMOTA with relay-board that will turn on or off the power supply of the doorbell) and created the device in Domoticz. Whenever the doorbell is triggered it will show up in the Domoticz and device logs as respectively 2018-03-05 21:10:05.900 MQTT: Topic: domoticz/in, Message: {"idx":3,"nvalue":1,"svalue":""} and 2018-03-05 21:10:05 On. On the same time Domoticz retrieves an OFF-notification.
I've created a blocky-event that should run the script Whenever I press the doorbell button in Domoticz, the script will run and the doorbell will ring. Whenever I use the doorbell the script isn't run and the doorbell will ring like expected. All devices are running the latest stable versions. When am I doing wrong or have I forgotten to set?
It has worked like I wanted it, but after a crash all settings where lost since I haven't made notes or backups
On this forum I've found a (doorbell) BASH-script that will capture an image from my camera and send it through Telegram to our mobiles.
Code: Select all
#!/bin/sh
SnapFile="/var/tmp/camsnapshot.jpg"
# Get snapshot via Domoticz server
wget -O $SnapFile "http://**IP_ADDRESS_DOMOTICZ**:**PORT**/camsnapshot.jpg?idx=1"
# Send Telegram message with image
curl -s -X POST "https://api.telegram.org/bot**TOKEN**/sendPhoto" -F chat_id=-**CHATID** -F photo="@$SnapFile" -F caption="Er staat iemand aan de deur!"
# Remove Image
/bin/rm $SnapFile
I've created a blocky-event that should run the script Whenever I press the doorbell button in Domoticz, the script will run and the doorbell will ring. Whenever I use the doorbell the script isn't run and the doorbell will ring like expected. All devices are running the latest stable versions. When am I doing wrong or have I forgotten to set?
It has worked like I wanted it, but after a crash all settings where lost since I haven't made notes or backups
