Mail camera snapshot when switch activated

Topics (not sure which fora)
when not sure where to post, post here and mods will move it to right forum.

Moderators: leecollings, remb0

Post Reply
Anap
Posts: 5
Joined: Monday 07 October 2013 16:33
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Mail camera snapshot when switch activated

Post 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.
vincenttor
Posts: 9
Joined: Saturday 04 January 2014 14:37
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Netherlands
Contact:

Re: Mail camera snapshot when switch activated

Post by vincenttor »

Hi Albert,

this is how i have my setting and it seems to be working oke.

Image

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
Anap
Posts: 5
Joined: Monday 07 October 2013 16:33
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Mail camera snapshot when switch activated

Post 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
vincenttor
Posts: 9
Joined: Saturday 04 January 2014 14:37
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Netherlands
Contact:

Re: Mail camera snapshot when switch activated

Post 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
Anap
Posts: 5
Joined: Monday 07 October 2013 16:33
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Mail camera snapshot when switch activated

Post 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 :x

@vincenttor, thanks for your help. Appreicate it very much.
vincenttor
Posts: 9
Joined: Saturday 04 January 2014 14:37
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Netherlands
Contact:

Re: Mail camera snapshot when switch activated

Post by vincenttor »

no problem , glad you found out otherwise you had been guessing until who knows.
micksel
Posts: 50
Joined: Wednesday 28 January 2015 17:58
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Mail camera snapshot when switch activated

Post 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?
micha_pr
Posts: 82
Joined: Friday 24 October 2014 12:26
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Germany, near Berlin
Contact:

Re: Mail camera snapshot when switch activated

Post by micha_pr »

Try to change the setting in setup:
domoticz_email.JPG
domoticz_email.JPG (40.66 KiB) Viewed 12222 times
Maybe it will help.
Michael Pruefer
----------------------------
http://www.zwave-review.com (German only)
http://www.SmartHome.Work (German only)
micksel
Posts: 50
Joined: Wednesday 28 January 2015 17:58
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Mail camera snapshot when switch activated

Post by micksel »

no, doesn't work :(
micksel
Posts: 50
Joined: Wednesday 28 January 2015 17:58
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Mail camera snapshot when switch activated

Post by micksel »

any suggestions ?
Polygontrauma
Posts: 6
Joined: Sunday 28 August 2016 12:48
Target OS: -
Domoticz version:
Contact:

Re: Mail camera snapshot when switch activated

Post by Polygontrauma »

Same problem here, waiting for suggestions :(
User avatar
wboerhoop
Posts: 8
Joined: Friday 06 February 2015 12:41
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Contact:

Re: Mail camera snapshot when switch activated

Post by wboerhoop »

also here the same problem :(
RFXcom-433E last FW
Aeon Z-stick Gen5
Zigbee
Synology and Raspberry Pi4 last Beta
Malcolm
Posts: 7
Joined: Wednesday 18 January 2017 18:09
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.5877
Contact:

Re: Mail camera snapshot when switch activated

Post 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.
------------------------------------------
RasPi 3 - Zwave+ - RFXtrx433E
Domoticz 3.5877
Alexa & Harmony
Malcolm
Posts: 7
Joined: Wednesday 18 January 2017 18:09
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.5877
Contact:

Re: Mail camera snapshot when switch activated

Post 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...
------------------------------------------
RasPi 3 - Zwave+ - RFXtrx433E
Domoticz 3.5877
Alexa & Harmony
Malcolm
Posts: 7
Joined: Wednesday 18 January 2017 18:09
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.5877
Contact:

Re: Mail camera snapshot when switch activated

Post 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.
------------------------------------------
RasPi 3 - Zwave+ - RFXtrx433E
Domoticz 3.5877
Alexa & Harmony
micksel
Posts: 50
Joined: Wednesday 28 January 2015 17:58
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Mail camera snapshot when switch activated

Post by micksel »

anyone have a solution to this without switching mailservice?
Malcolm
Posts: 7
Joined: Wednesday 18 January 2017 18:09
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.5877
Contact:

Re: Mail camera snapshot when switch activated

Post 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.
------------------------------------------
RasPi 3 - Zwave+ - RFXtrx433E
Domoticz 3.5877
Alexa & Harmony
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest