Code to email a picture when door is unlocked?

I would like to have a picture emailed to me from my webcam whenever a door is unlocked.
My camera will save the current snapshot using

 wget --output-document="snapshot.gif" "http://<camera.ip.address>/img/snapshot.cgi"

Any idea how to do this using lua code?

Waiting for also an answer…


I am here: http://tapatalk.com/map.php?zetq3e

I’ve found an easy way to do it through pushingbox.com.

  1. Add an email service in pushingbox with your email address
  2. Add an email scenario in pushingbox. In picture URL enter the URL for your webcam image. In my case: http://XX.XX.XX.XX:1024/img/snapshot.cgi

now all you need to do is have vera send a notification to pushingbox whenever you want the picture emailed to you

luup.inet.wget("http://api.pushingbox.com/pushingbox?devid=[ID OF THE NOTIFICATION]")

The problem with this method is that you need to open your webcam port, and have a fixed IP address (or dynamic dns) for it.

Still looking for a way to do it internally without using pushingbox.

Another update: using pushingbox without a static IP address or dyndns.
Using this script vera can tell pushingbox its current IP address:

local status, data = luup.inet.wget("http://automation.whatismyip.com/n09230945.asp", 10) luup.inet.wget("http://api.pushingbox.com/pushingbox?devid=xxxxxxxxxxxxxxxxx&ipadd=" .. data .." " )

In pushingbox, use the following code for Picture URL:

http://$ipadd$:1024/img/snapshot.cgi

[quote=“drag0n, post:3, topic:171786”]I’ve found an easy way to do it through pushingbox.com.

  1. Add an email service in pushingbox with your email address
  2. Add an email scenario in pushingbox. In picture URL enter the URL for your webcam image. In my case: http://XX.XX.XX.XX:1024/img/snapshot.cgi

now all you need to do is have vera send a notification to pushingbox whenever you want the picture emailed to you

luup.inet.wget("http://api.pushingbox.com/pushingbox?devid=[ID OF THE NOTIFICATION]")

The problem with this method is that you need to open your webcam port, and have a fixed IP address (or dynamic dns) for it.

Still looking for a way to do it internally without using pushingbox.[/quote]

But how can you access in this way to the IP camera? It is needed a username and password to let pushigbox access to your camera. I believe that is not enough to forward the port to a fixed IP. This can work internally of your network, but from outside, how can pushing box access to your camera without an username and password?

It s working for you?

Thank you
Matteo

Hi, this can be the way with username and password

For snapshot
http://XXXXXXXX.dyndns.org:XXXX/snapshot.cgi?user=username&pwd=password

For video
http://XXXXXXXX.dyndns.org:XXXX/videostream.cgi?user=username&pwd=password

Ciao
Matteo

@ Matteo
Yes you are right. My initial testing was without any password. I have now added password protection.
For my camera (wvc210), the modified code for pushingbox is:

http://<username>:<password>@$ipadd$:<port>/img/snapshot.cgi