Page 1 of 1

Problems with taking snapshots and sending notifications.

Posted: Friday 21 July 2017 9:45
by Vzet
Dear all,

I’m new to this forum and Domoticz.

I already read a lot on this forum, but I still have got some issues/questions.
I setup the notification using NMA and email setting correctly.

I want to send a push notification with a snapshot of a camera, by using Blockly (because I’m not familiar with Lua yet)

1. When I use the (Blockly) command “Send Notification” , I do receive a push notification on my phone, but there is no snapshot included.
2. When I use the (Blockly) command “Send camera snapshot”, I receive an email, with attachment (which is an incorrect format). This attachment is only 480 Bytes, so it seems the snapshot taken, was not ready, when it was already send.

Can someone help me, by telling what is wrong. (Or what I am doing wrong :D )
And is it even possible to send a push notification to a phone, including a snapshot ?

Thanks in advance for the answers.

Re: Problems with taking snapshots and sending notifications.

Posted: Friday 28 July 2017 15:33
by jvmaanen
I have the same issue. There is small icon (placeholder) included in the email, but the picture itself is not included. Maybe this is also a permission issue like the issue described in viewtopic.php?f=6&t=18437&hilit=camera+snapshot.

Re: Problems with taking snapshots and sending notifications.

Posted: Friday 28 July 2017 15:58
by Ineedyourhelp
I am a new user and wondering that what language you are using for this program below

#!/bin/sh
#SendMsgTo=$1
SendMsgTo=$TelegramChatId
today=`/bin/date '+%d-%m-%Y__%H-%M-%S'`;
TempFileDir=/home/pi/Pictures/
#################################################################
IP="ip" # IP address Camera
##########################################################
SnapFile=$TempFileDir"$today-snapshot.jpg"
if ping -c 1 $IP > /dev/null ; then # if IPCAM is online then:
wget -O - http://ip/camsnapshot.jpg?idx=2 > $SnapFile
sleep 2
curl -s -X POST "https://api.telegram.org/bot"$TelegramB ... /sendPhoto" -F chat_id=$SendMsgTo -F caption="Beweging gedetecteerd in huiskamer" -F photo="@$SnapFile"
else
curl --data 'chat_id='$SendMsgTo --data-urlencode 'text=IP-cam niet beschikbaar.' 'https://api.telegram.org/bot'$TelegramB ... endMessage'
fi

Re: Problems with taking snapshots and sending notifications.

Posted: Thursday 05 October 2017 13:56
by Vzet
Nobody any answers to the question(s) in the first post???

Re: Problems with taking snapshots and sending notifications.

Posted: Friday 17 November 2017 14:38
by dervogt
Hello,

I am also using the camera snapshop blockly, but the delayed one. So my first action in the event is to open the API URL on the camera to move it into the proper position to take the snapshot with an "Open URL" action, then I am using the "Send Camera Snapshot XXXXX with subject BLA after N seconds" and it is working perfectly fine.

Re: Problems with taking snapshots and sending notifications.

Posted: Friday 01 December 2023 22:22
by ssk17051980
dervogt wrote: Friday 17 November 2017 14:38 Hello,

I am also using the camera snapshop blockly, but the delayed one. So my first action in the event is to open the API URL on the camera to move it into the proper position to take the snapshot with an "Open URL" action, then I am using the "Send Camera Snapshot XXXXX with subject BLA after N seconds" and it is working perfectly fine.
can you give us your example of blockly ?
thx