The latest release of openLuup (v18.3.14) includes a built-in SMTP server to handle email messages, and a special implementation file for cameras which use this to trigger an associated motion detector device.
SMTP (Simple Mail Transfer Protocol) server:
This is a minimal implementation of an RFC 5321 compliant server (essentially, an original RFC 821 implementation) without authentication or Transport Layer Security. It only handles messages within the LAN sent to a specific TCP port (2525 by default) and does not relay them further, except to pass them to internal handlers, each of which may be registered to receive emails from a specific email address.
I_openLuupCamera1.xml implementation file:
A camera device created with this implementation file will create an associated child Motion Sensor device which is triggered when the camera’s own motion detection algorithm sends an email.
Configuration:
Out of the box, openLuup will start the SMTP server on port 2525. This can be changed in Lua Startup code with the following line:
luup.attr_set ("openLuup.SMTP.Port", 1234) -- use port 1234 instead
The camera’s device implementation file may be set on the openLuup device’s Attributes page, followed by a Luup reload. The only other significant parameters are the usual: [tt]ip[/tt] attribute, and the [tt]URL[/tt] and [tt]DirectStreamingURL[/tt] device variables.
Camera configuration is obviously device-specific. For my Foscam camera (thanks to @Spanners) the important parameters are:
[ul][li]Enable - ticked[/li]
[li]SMTP Server - the IP address of openLuup on your LAN eg. 172.16.42.156[/li]
[li]SMTP Port - 2525, or whatever other port number you configured in openLuup startup[/li]
[li]Need Authentication - No[/li]
[li]SMTP Username / Password - not used[/li]
[li]Sender Email - must include the form [tt]xxx@yyy[/tt], for example [tt]Foscam@Study.local[/tt][/li]
[li]First Receiver - [tt]openLuup@openLuup.local[/tt][/li][/ul]
My camera (FI9831P) also sends three snapshots as email attachments. These are currently ignored, but could easily be written to a folder accessible from openLuup.
The Motion Sensor device will remain triggered for 30 seconds (or longer if the camera is re-triggered within that time.) In keeping with the latest security sensor service file, in addition to the [tt]Tripped[/tt] variable, there is also an [tt]ArmedTripped[/tt] variable which is only set/reset when the device is armed. This makes AltUI device watch triggers easy to write when wanting only to respond when the device is actually armed.