The link for the camera snapshot is http://XXX.XXX.XXX.XXX/jpg/1/image.jpg
Unfortunally i can't get this type of camera added in domoticz. Therefor i was hoping to get 1 scripts for DZvents.
What i have is this. But i got stuck how i can temporally save a snapshot by dzvents.
Googled some and found some, but those scripts are way over my head to get the idea how they exactly work
Code: Select all
local camera1 = http://XXX.XXX.XXX.XXX/jpg/1/image.jpg
return {
on = {
devices = {'Backlight Dashboard'},
},
execute = function(domoticz, device)
if(device.state == 'On') then
--os.execute('/home/pi/domoticz/scripts/snapshot.sh')
domoticz.log('Foto gemaakt en verstuurd', domoticz.LOG_INFO)
domoticz.notify('snapshot', camera1, domoticz.PRIORITY_HIGH)
end
end
}
But was hoping everything could be run by dzvents and not 2 scripts
Code: Select all
#!/bin/sh
SnapFile="/var/tmp/camsnapshot.jpg"
# Krijg snapshot van camera.
# Voer IP-adres in op XXX.XXX.XXX.XXX (houd rekening met user/password, dat script ook snapshot kan maken)
wget -O $SnapFile "http://XXX.XXX.XXX.XXX/jpg/1/image.jpg"
# Send Telegram message with image
curl -s -X POST "https://api.telegram.org/bot"DEZE TEKST VERVANGEN VOOR TELEGRAM API SLEUTEL"/sendPhoto" -F chat_id=DEZE TEKST VERVANGEN VOOR CHAT_ID -F photo="@$SnapFile"
# Remove Image
/bin/rm $SnapFile