Page 1 of 1

Example: Send mail notification on motion detection

Posted: 11 Mar 2012 18:54
by PoltoS
 In this short topic I would like to show how to configure Z-Cloud to send E-Mail notifications on motion detection.We suppose you have gmail account or something similiar. For security reasons we suggest you to set up new account for these notification mails (not to type in Z-Cloud password from your mail account). You can then redirect messages from this account to any other mail address (or even many of them).First of all include your motion detector and configure the device.Then switch to Expert mode and create a new scene with a script:# Edit your gmail credentials and the message to be sent
gmail_user = ""
gmail_pwd = "xxxxxxxxx"
subj = "test"
text = """
Text message...
Long text message...

# Don't edit below
import smtplib
smtpserver = smtplib.SMTP("", 587)
smtpserver.login(gmail_user, gmail_pwd)
smtpserver.sendmail(gmail_user, gmail_user, "From: %s
To: %s
Subject: %s


" % (gmail_user, gmail_user, subj, text))
Then create new rule that will catch the event from the detector and activate the script above. Have fun!Here are screenshots of the config. Scene: Rule:


Posted: 11 Mar 2012 18:54
by eligv
As instructed him to send me an email manually triggering the routine. The detection do with the EZ-motion LED is activated when motion is detected but does not trigger a routine. It happens as with temperature decteccion for shooting scene heating. The EZmotion is updated every minute, but not active routines. How could verify that the system collects real-time data from the detector?
Any idea of possible failure?


Enable verbose or even debug

Posted: 11 Mar 2012 18:54
by PoltoS
Enable verbose or even debug logging. You will see that incoming events do not match the rule you have created. Otherwise it must work ;)


Posted: 11 Mar 2012 18:54
by eligv
Changing the instance 1 instance EZmotion and put the 0 in the rule condition. ;)

Thank you!