nadler Super User
Joined: February 25 2006 Location: United States
Online Status: Offline Posts: 354
|
Posted: December 21 2006 at 22:29 | IP Logged
|
|
|
I use this macro to send me an email when a wireless x-10 sensor is triggered in my garage. The macro polls the insteon switches in the house for their status and then sends an email indicating that there has been movement in the garage, the date and time and which lights are on in the house.
If you use this macro you would change the email information as well as the names of the various insteon devices. The help file explanation of the ph_sendsmtpmail function is included at the bottom of this message.
The macro is 1 line which is just a big formula.
insert into macroheader values ('SEND EMAIL','EMAIL STATUS TO NOEL',0,0,1);
insert into macrodetail values ('SEND EMAIL',1,38,'',NULL,'ph_sendsmtpemail("mail.optonline.net",2 5,"noel@geezeremail.com","noel@geezernetwork.com","Garage Movement","Noel, I am reporting from home. There has been movement in the garage."+today()+". The following devices are on: "+if (ph_getinsteonstat( "COMPUTER LIGHT1")=2,"The computer light is on. "," ")+if (ph_getinsteonstat( "GUEST ROOM")=2,"The Guest Room Light is on. "," ")+if (ph_getinsteonstat( "ADAMS ROOM")=2,"Adam''s Room light is on. "," ")+if (ph_getinsteonstat( "BATHROOM UPSTAIRS")=2,"The upstairs bathroom light is on "," ")+if (ph_getinsteonstat( "FRONT OUTSIDE")=2,"The front outside light is on. "," ")+if (ph_getinsteonstat( "GARAGE OUTSIDE SLAVE")=2,"The Garage Outside light is on. "," ")+if (ph_getinsteonstat( "MASTERBEDROOM")=2,"The Master Bedroom light is on. "," ")+if (ph_getinsteonstat( "KITCHEN CABINETS")=2,"The KITCHEN CABINET light is on. "," ")+if (ph_getinsteonstat( "JORDANS ROOM")=2,"JORDAN''S ROOM light is on. "," ") )',0,'');
To help with the syntax of the ph_sendsmtpmail function here is the help file information for that function:
Description
Sends an email message using SMTP.
Syntax
ph_sendsmtpemail ( s, n, s, s, s, s )
Argument Description
s The IP or DSN of the SMTP server.
n The port of the SMTP server. This is typically port 25.
s The email address you are sending the email from. Most SMTP servers require you to enter a valid email address registered on the SMTP server. You may optionally enter a userid and password if your SMTP server requires authentication.
s The email addresses you wish to send a message to. Separate multiple email addresses with commas.
s The subject of the email.
s The text of the email message.
Return value
Integer. Returns 0 if successful. Any other value signifies an error occurred. You can specify multiple recipients by separating the email addresses with commas.
Usage
Use this function to send email using raw SMTP rather than the MAPI interface that the ph_sendemail function uses. If an error occurs while sending using SMTP, the PowerHome system will not hang like it does when sending using MAPI.
If your SMTP server requires authentication, then supply the userid and password in the third parameter after the "From" email address. Separate the "from" email address, userid, and password with commas (do not add spaces).
|