Page 1 of 1
Mail camera snapshot when switch activated
Posted: Wednesday 29 January 2014 14:29
by Anap
Hello all,
I've been searching the forum but did not find an answer to the above question. Look like kind of straight forward, but apparently I'm not able to cope with it
What I like to establish: Have a snapshot from my domoticz enabled camera being sent to my in domoticz settings configured email adrress when a switch/sensor is activated.
What I did: Setup the camera in Domoticz, it takes snapshots and streams video. Setup o.k. Setup a dummy switch in the "active devices" section under the camera section.
Set up the dummy device to do a notification when activated. When I activate the switch I do get a mail, but no snapshot of the associated camera.
What am I doing wrong or did I forget something?
Any help will be appreciated.
Albert.
Re: Mail camera snapshot when switch activated
Posted: Wednesday 29 January 2014 15:07
by vincenttor
Hi Albert,
this is how i have my setting and it seems to be working oke.
for a larger image click
http://www.mijnalbum.nl/Grotefoto-OHITS4CM.jpg
this is what works for me, can't help you any further hope this solves it
Re: Mail camera snapshot when switch activated
Posted: Wednesday 29 January 2014 18:48
by Anap
@vincenttor
Thanks.
Seems exactly the way I configured it. When the switch is activated I do get a mail but no picture included.
Camera is a Foscam 8901.
Strange. Anybody else? Maybe the cam?
Albert
Re: Mail camera snapshot when switch activated
Posted: Wednesday 29 January 2014 18:55
by vincenttor
what is the string that you use to grab the image from the camera,
do you get a camera image when you go to the camera tab ?
I guess its probably something to be wrong in that direction.
maybe this is something to play with:
Code: Select all
http://000.000.000.000/snapshot.cgi?user=gebruiker&pwd=wachtwoord&next_url=ab
Re: Mail camera snapshot when switch activated
Posted: Thursday 30 January 2014 16:25
by Anap
Yes, I get the camera image.
And I found the cause of the problem

It's my phone! There is some weird problem with pictures. When I opened Gmail via PC all the snapshots were attached to the mails.
So problem solved. (not the pnone one yet
@vincenttor, thanks for your help. Appreicate it very much.
Re: Mail camera snapshot when switch activated
Posted: Saturday 01 February 2014 12:52
by vincenttor
no problem , glad you found out otherwise you had been guessing until who knows.
Re: Mail camera snapshot when switch activated
Posted: Tuesday 31 May 2016 11:04
by micksel
Hi, I have an smilar problem,
I do receive a mail when I activate the dummy switch but no attact file, nether on my phone or mailclient?
Or is this a function that's only supported with gmail?
Re: Mail camera snapshot when switch activated
Posted: Tuesday 31 May 2016 15:11
by micha_pr
Try to change the setting in setup:

- domoticz_email.JPG (40.66 KiB) Viewed 12230 times
Maybe it will help.
Re: Mail camera snapshot when switch activated
Posted: Wednesday 01 June 2016 7:51
by micksel
no, doesn't work

Re: Mail camera snapshot when switch activated
Posted: Tuesday 02 August 2016 7:56
by micksel
any suggestions ?
Re: Mail camera snapshot when switch activated
Posted: Friday 14 October 2016 17:18
by Polygontrauma
Same problem here, waiting for suggestions

Re: Mail camera snapshot when switch activated
Posted: Monday 12 December 2016 20:48
by wboerhoop
also here the same problem

Re: Mail camera snapshot when switch activated
Posted: Wednesday 18 January 2017 18:47
by Malcolm
I too am interested in this topic as I am failing to get images sent in notification emails.
I have "Send Camera snapshots as Attachment (Gmail)" ticked in Setup>Settings>Email (- why does gmail get a specific mention?)
I have two cameras set up in Setup>More options>Cameras
Both show images in the preview area of this camera list.
Both show live streams when I press the video icons on the camera list
Both download jpeg images to the browser when I press the camera icons on the camera list
In both cases the ImageURL is simply set to Snapshot.jpg
I then link a camera to a switch by selecting the camera and Adding a switch to the Active Device list.
In this configuration, when the switch is triggered, no email is forthcoming at all.
I have found that if I change the ImageURL to almost anything else, I do get an email when the switch is triggered but the attached snapshot is empty.
I have tried creating the "correct" URL from ispyconnect.com and often this results in the email being sent but still no snapshot AND the preview images disappear from the camera list?!
Perhaps someone who has implemented this set-up can document some background on how it works and what it being used/where. For example, when I change the ImageURL text, the video stream stops working... why should this be?
Anyhow, having tried crawling all over the forums I have not yet cracked this and some help would be most useful.
Re: Mail camera snapshot when switch activated
Posted: Friday 20 January 2017 14:40
by Malcolm
I have carried out further tests and I am beginning to suspect two problems.
1) getting authorisation credentials through to the camera seems limited. My cameras seems to require http:Username:
[email protected]/snapshot.jpg rather than the usual snapshot.jpg?user=Username&pswd=Password and I cannot see how to get Domoticz to accept this as it seems to build the URL rather than just use what is placed in ImageURL box. To overcome this I tried setting "Allow anonymous access" on the camera. This should allow all to work with simply ImageURL set as snapshot.jpg ... but no email arrives.
2) OK so now I have camera that should be accepting anonymous calls and all the test functions in Domoticz seems to work fine for streaming and snapshot, but no emails coming from Domoticz when associated switch is triggered.
When trying ImageURL: snapshot.jpg or snapshot.jpg?user=MyUsername&pwd=MyPassword
NO email is issued on triggering associated switch.
Try ImageURL: /snapshot.jpg ie an extra "/" in front of name, then Email is generated but attached file contains:
<html><head><title>Document Error: Page not found</title></head>
<body><h2>Access Error: Page not found</h2>
when trying to obtain <b>/snapshot.jpg</b><br><p>Cannot open URL <b>/snapshot.jpg</b></p></body></html>
Try ImageURL:
http://192.168.1.141/snapshot.jpg?user= ... MyPassword
Email is generated but attached file contains:
<html><head><title>Document Error: Unauthorized</title></head>
<body><h2>Access Error: Unauthorized</h2>
when trying to obtain <b>/http:/192.168.1.141/snapshot.jpg?user=MyUsername&pwd=MyPassword</b><br><p>Access to this document requires a User ID</p></body></html>
I note that using VNC onto the RaPi3 and using
http://192.168.1.141/snapshot.jpg or
http://192.168.1.141/snapshot.jpg?user= ... MyPassword
both work and show the correct snapshot image.
So it seems that if I put in an ImageURL that is incorrect in some way I get an email message with an attachment that contains some debug pointers but when the ImageURL is correct I get no email!
Are these bugs? Seems odd as it is obviously working for other people...
Re: Mail camera snapshot when switch activated
Posted: Tuesday 24 January 2017 12:04
by Malcolm
OK, having played some more with the system I eventually moved to a different SMTP service. Not sure why as emails clearly were getting through on some occasions... But anyhow, it now works!
So if you are getting
"2017-01-21 16:57:24.159 Error: SMTP Mailer: Error sending Email to: !"
in your logs I suggest trying a different SMTP path.
Re: Mail camera snapshot when switch activated
Posted: Wednesday 25 January 2017 9:02
by micksel
anyone have a solution to this without switching mailservice?
Re: Mail camera snapshot when switch activated
Posted: Wednesday 25 January 2017 10:43
by Malcolm
I guess it is not a big deal as one is only setting up a different SMTP (outbox) you can still use whatever SMTP server you like for any other email applications. Also, you can still send the email from Domoticz to any existing email address, it just needs to be sent via a compliant SMTP server. In my case I created a new gmail account with a new email address that will only ever be used by Domoticz and as someone else on the forum mentioned, it is now clear when mail is being received from Domoticz! Seems a small price (if any) to pay for this finally working as advertised.