-
Notifications
You must be signed in to change notification settings - Fork 2
Cam Mail Intercept Plugin
Attention: work in progress, software not yet uploaded
Plugin that can be used for integrating surveillance systems, webcams and domotics systems into hangoutsbot. These systems will typically generate email notifications. This plugin acts as a simple local smtp relay and intercepts messages in order to insert them (and their attached pictures) in the hangouts conversation.
#Functions:
- Notification: intercept notification emails (like motion detection mails with attached snapshot image) and insert the notification and snapshot image in the conversation.
- Grab snapshots from cameras: typing the name of the camera in the conversation will let the plugin grab a new snapshot and insert it into the conversation
- Trigger actions: when connected to a domotics system, the plugin can send http/https messages to trigger actions on the domotics system. Currently we only support the PUT method, we believe POST methods should also be supported in the future
- Mail relay: some devices like printers, cams, scanners and routers may want to send out mail messages. It is considered dangerous to enter your gmail or other provider's credentials in these 'untrusted' devices. The plugin acts as a mail relay on your local network. Your devices can deliver their mail to the plugin's smtp interface without requiring credentials. The mails are then forwarded over the internet using your bot's gmail credentials. We recommend to create an app-specific password (part of Google's 2-factor authentication scheme).
This plugin has been tested only with a Synology Surveillance station, together with Apexis J webcams. It should however work with any system that generates email notifications.
- Only the subject of an email is inserted in a conversation (besides the image attachmentà. The rationale for this is that the systems that send messages send these in an automatic way, so the body of the mail does not add much value in most cases.
/bot interceptCamMail
- Let the current conversation
<convid>
receive alarms from the surveillance system
/bot chatreset [<optional conv id>]
- Removes an API instance for a supplied
<conv id>
or the current conversation, if it exists - Effectively restarts a cleverbot conversation from a blank slate
SMTP communication credentials for forwarding to external provider on Internet. For Google, please consider the use of application-specific passwords (part of 2 factor authentication mechanism)
"extsmtpuser" : "name_of_mybot@gmail.com"
"extsmtppwd" : "botsmtppassword" # recommend to use an app password
"extsmtpserver" : "smtp.gmail.com" (optional default value gmail server)
"extsmtpport" : "587" (optional, default value 587)
Plugin's internal SMTP listener address and port. Use the real address or name of the system on which the bot is installed instead of the loopback address in case the service needs to be reached from another system on your lan.
"intsmtpaddress" : "127.0.0.1"
"intsmtpport" : "10025"
Conversation to which the plugin listens and to which notifications are sent
"cammailcid" : "Umyconversationid45dsseAQ"
Alarm (Domotics) system parameters. Alarmsysurl is the url that will be fetched to determine whether the alarm system is active or not. If the alarm system is not activated, alarm messages will not be inserted in the conversation. "alarmsysoffregexp" is the pattern that must be found in the reply in order to conclude that the alarm system is disabled. The "alarmsysusr" and "alarmsyspwd" credentials will be used in the GET request. These parameters are optional.
"alarmsysurl" : "http://10.10.10.32/AlarmLoadedFlag"
"alarmsysoffregexp" : "value=\"0\""
Format of the mail subject (regexp and index in the regexp where the camera/location name can be found). In the exaple regexp below, the second word represents the location/camera name.
"alarmsubjectformat": { "regexp": "(.*) (.*)( (.*))*", "locationindex": 2 }
Url and credentials for notifying the domotics or alarm system will be substituted by the camera (location) name
"alarmnoturl" : "http://10.10.10.32/%(location)s/pulse"
"alarmsysusr" : "camera",
"alarmsyspwd" : "mypassword",
Camera credentials for grabbing camera sapshots (assuming basic authentication)
"campwd" : "myCAMpassword"
"camusr" : "CAMdmin"
List of camera url's (also conversation keywords for grabbing live snapshots):
"camurls" : { 'backcam' : 'http://10.10.10.31:27116/snapshot.cgi',
'frontcam' : 'http://10.10.10.33:27118/snapshot.cgi'
}
Plugin List | Developer Reference: [ Intro | Plugins | Sinks | In-built Functionality | [Configuration] (Configuration) ]