Control Home Via Email or SMS for Dummies
Posted: Fri Mar 07, 2008 12:12 am
I want to first thank all on the forum that helped me to get this feature to work. Especially Mr. Olser. I can now send my home SMS messages via my cell phone or email and have my home execute selected tasks and give me status request back to my cell phone, and verifies me after the tasks are complete. Really cool to me. Below are the steps I used to get my system to work and it has been working seamlessly for a week now.
1. Set up an email account that you are strictly going to use for your HB server and nothing else. ( Made a Comcast account)
2. Download OstroSoft Pop Component 2.4.2 (Component Zip and Exe) and Download OstroSoft SMTP Component 6.4.5 (Component Zip and Exe) from the OstroSoft.com Website.
(Pop is the Incoming Messages & SMTP is Outgoing Messages)
3. Extract both Zip files for Pop and SMTP component
4. Put OSPOP3.dll and OSSMTP.dll in the windows/system directory
5. ClickStartRun “regsvr32 OSPOP3.dll”
6. ClickStartRun “regsvr32 OSSMTP.dll”
7. Execute both Pop3_Component.exe and SMTP_Component.exe
8. Take the POP script Below:
'VBScript sample for OstroSoft POP3 Component
'written by Igor Ostrovsky (OstroSoft)
'
'this script establishes POP3 session, retrieves mailbox stats
'and save them to the file, retrieves messages and save them in
'.EML format, then closes the session
'
'Permanent URL for this project is
'http://www.ostrosoft.com/pop3_component ... script.zip
'
'For more information about OstroSoft POP3 Component go to
'http://www.ostrosoft.com/pop3_component.asp
'
'OstroSoft POP3 Component is available for download at
'http://www.ostrosoft.com/download/pop3_component.zip
'
'Questions, suggestions, comments - email to [email protected]
'or submit a form at http://www.ostrosoft.com/contact.asp
Option Explicit
Dim oPOP3 'As OSPOP3.Session
Set oPOP3 = CreateObject("OSPOP3.Session")
oPOP3.RaiseError = True
If oPOP3.OpenPOP3("pop.comcast.net", 110, "[email protected]", "Password") Then
Dim oMessageList 'As New Collection
Dim oMLE 'As MessageListEntry
Dim oMessage 'As Message
Set oMessageList = oPOP3.GetMessageList
For Each oMLE In oMessageList
Set oMessage = oPOP3.GetMessage(oMLE.ID)
Call SetPropertyValue("EMAIL POP.RetrievedEmailSubject", oMessage.Subject) 'Put the email subject into a property
Set oMessage = Nothing
Call oPOP3.DeleteMessage(oMLE.ID)
Sleep(250)
Next
Set oMessageList = Nothing
oPOP3.ClosePOP3
End If
Set oPOP3 = Nothing
9. And save it as EmailPOP.vbs
(Of course fill in your POP server for your ISP, their port number, the email address you set up for your HB server, and your Password)
10. Take the SMTP script Below:
'VBScript sample for OstroSoft SMTP Component
'written by Igor Ostrovsky (OstroSoft)
'
'Permanent URL for this project is
'http://www.ostrosoft.com/smtp_component ... script.asp
'
'For more information about OstroSoft SMTP Component go to
'http://www.ostrosoft.com/smtp_component.asp
'
'OstroSoft SMTP Component is available for download at
'http://www.ostrosoft.com/download/smtp_component.zip
'
'Questions, suggestions, comments - email to [email protected]
'or submit a form at http://www.ostrosoft.com/contact.asp
Option Explicit
Dim oSMTP 'As OSSMTP.SMTPSession
Set oSMTP = CreateObject("OSSMTP.SMTPSession")
oSMTP.Server = "smtp.comcast.net" 'SMTP server name or IP address
oSMTP.Port = 25
oSMTP.MailFrom = "[email protected]" 'sender e-mail address
oSMTP.SendTo = GetPropertyValue("EMAIL VERIFICATION.Mail Destination") 'recipient e-mail address
oSMTP.AuthenticationType = 2 '0 = AuthNone, 1 = AuthPOP, 2 = AuthLogin, 3 = AuthPlain
oSMTP.Username = "xxxxxxxx" 'name for mailserver authentication
oSMTP.Password= "xxxxxxx" 'password for mailserver authentication
oSMTP.MessageSubject = GetPropertyValue("EMAIL VERIFICATION.MySubject") 'message subject or use GetPropertyValue(".MySubject") to retrieve a property from HB
oSMTP.MessageText = GetPropertyValue("EMAIL VERIFICATION.MyText") 'message text or use GetPropertyValue(".MyText") to retrieve a property from HB
oSMTP.RaiseError = True
oSMTP.SendEmail
Set oSMTP = Nothing
11. And save it as EmailSMTPSender.vbs
(Of course fill in your SMTP server for your ISP, their port number, the Username, and your Password)
12. In HB create 2 New Script devices
(Call One "EMAIL POP" and the Other "EMAIL VERIFICATION")
13. Associate the correct script to the correct device.
(EMAIL POP with EmailPOP.vbs and EMAIL VERIFICATION with EmailSMTPSender.vbs)
14. Right click on the EMAIL POP deviceAdd propertyUser Definable Alpha Property
(Description must be called “RetrievedEmailSubject”) (This triggers whatever task you want it to execute in HB)
15. Right click on EMAIL VERIFICATIONAdd propertyAlpha 1, Alpha 2, Alpha 3 or whatever
(Alpha 1 is called “Mail Destination”, Alpha 2 is called “MySubject”, Alpha 3 is called “MyText”)
16. Now you can have a HB task read the subject on the "EMAIL POP.RetrievedEmailSubject" execute a task such as Outside lights ON then have the SMTP send a message to your Cell phone Such as Outside light are on and so on.
For those that want a shortcut and want to be lazy ;-p and that do not want to do the HB part of this procedure I have an export for HB that can be imported. I send messages from my job to my HB server to give me status of different things in my house. I also have it send verification to my work email, too. I am try to incorporate my alarm system into the equation too. But that is another story. You also want to turn "EMAIL POP.State" to Running at startup. The task in the export file check email every 3 minutes. “Happy Tinkering”
1. Set up an email account that you are strictly going to use for your HB server and nothing else. ( Made a Comcast account)
2. Download OstroSoft Pop Component 2.4.2 (Component Zip and Exe) and Download OstroSoft SMTP Component 6.4.5 (Component Zip and Exe) from the OstroSoft.com Website.
(Pop is the Incoming Messages & SMTP is Outgoing Messages)
3. Extract both Zip files for Pop and SMTP component
4. Put OSPOP3.dll and OSSMTP.dll in the windows/system directory
5. ClickStartRun “regsvr32 OSPOP3.dll”
6. ClickStartRun “regsvr32 OSSMTP.dll”
7. Execute both Pop3_Component.exe and SMTP_Component.exe
8. Take the POP script Below:
'VBScript sample for OstroSoft POP3 Component
'written by Igor Ostrovsky (OstroSoft)
'
'this script establishes POP3 session, retrieves mailbox stats
'and save them to the file, retrieves messages and save them in
'.EML format, then closes the session
'
'Permanent URL for this project is
'http://www.ostrosoft.com/pop3_component ... script.zip
'
'For more information about OstroSoft POP3 Component go to
'http://www.ostrosoft.com/pop3_component.asp
'
'OstroSoft POP3 Component is available for download at
'http://www.ostrosoft.com/download/pop3_component.zip
'
'Questions, suggestions, comments - email to [email protected]
'or submit a form at http://www.ostrosoft.com/contact.asp
Option Explicit
Dim oPOP3 'As OSPOP3.Session
Set oPOP3 = CreateObject("OSPOP3.Session")
oPOP3.RaiseError = True
If oPOP3.OpenPOP3("pop.comcast.net", 110, "[email protected]", "Password") Then
Dim oMessageList 'As New Collection
Dim oMLE 'As MessageListEntry
Dim oMessage 'As Message
Set oMessageList = oPOP3.GetMessageList
For Each oMLE In oMessageList
Set oMessage = oPOP3.GetMessage(oMLE.ID)
Call SetPropertyValue("EMAIL POP.RetrievedEmailSubject", oMessage.Subject) 'Put the email subject into a property
Set oMessage = Nothing
Call oPOP3.DeleteMessage(oMLE.ID)
Sleep(250)
Next
Set oMessageList = Nothing
oPOP3.ClosePOP3
End If
Set oPOP3 = Nothing
9. And save it as EmailPOP.vbs
(Of course fill in your POP server for your ISP, their port number, the email address you set up for your HB server, and your Password)
10. Take the SMTP script Below:
'VBScript sample for OstroSoft SMTP Component
'written by Igor Ostrovsky (OstroSoft)
'
'Permanent URL for this project is
'http://www.ostrosoft.com/smtp_component ... script.asp
'
'For more information about OstroSoft SMTP Component go to
'http://www.ostrosoft.com/smtp_component.asp
'
'OstroSoft SMTP Component is available for download at
'http://www.ostrosoft.com/download/smtp_component.zip
'
'Questions, suggestions, comments - email to [email protected]
'or submit a form at http://www.ostrosoft.com/contact.asp
Option Explicit
Dim oSMTP 'As OSSMTP.SMTPSession
Set oSMTP = CreateObject("OSSMTP.SMTPSession")
oSMTP.Server = "smtp.comcast.net" 'SMTP server name or IP address
oSMTP.Port = 25
oSMTP.MailFrom = "[email protected]" 'sender e-mail address
oSMTP.SendTo = GetPropertyValue("EMAIL VERIFICATION.Mail Destination") 'recipient e-mail address
oSMTP.AuthenticationType = 2 '0 = AuthNone, 1 = AuthPOP, 2 = AuthLogin, 3 = AuthPlain
oSMTP.Username = "xxxxxxxx" 'name for mailserver authentication
oSMTP.Password= "xxxxxxx" 'password for mailserver authentication
oSMTP.MessageSubject = GetPropertyValue("EMAIL VERIFICATION.MySubject") 'message subject or use GetPropertyValue(".MySubject") to retrieve a property from HB
oSMTP.MessageText = GetPropertyValue("EMAIL VERIFICATION.MyText") 'message text or use GetPropertyValue(".MyText") to retrieve a property from HB
oSMTP.RaiseError = True
oSMTP.SendEmail
Set oSMTP = Nothing
11. And save it as EmailSMTPSender.vbs
(Of course fill in your SMTP server for your ISP, their port number, the Username, and your Password)
12. In HB create 2 New Script devices
(Call One "EMAIL POP" and the Other "EMAIL VERIFICATION")
13. Associate the correct script to the correct device.
(EMAIL POP with EmailPOP.vbs and EMAIL VERIFICATION with EmailSMTPSender.vbs)
14. Right click on the EMAIL POP deviceAdd propertyUser Definable Alpha Property
(Description must be called “RetrievedEmailSubject”) (This triggers whatever task you want it to execute in HB)
15. Right click on EMAIL VERIFICATIONAdd propertyAlpha 1, Alpha 2, Alpha 3 or whatever
(Alpha 1 is called “Mail Destination”, Alpha 2 is called “MySubject”, Alpha 3 is called “MyText”)
16. Now you can have a HB task read the subject on the "EMAIL POP.RetrievedEmailSubject" execute a task such as Outside lights ON then have the SMTP send a message to your Cell phone Such as Outside light are on and so on.
For those that want a shortcut and want to be lazy ;-p and that do not want to do the HB part of this procedure I have an export for HB that can be imported. I send messages from my job to my HB server to give me status of different things in my house. I also have it send verification to my work email, too. I am try to incorporate my alarm system into the equation too. But that is another story. You also want to turn "EMAIL POP.State" to Running at startup. The task in the export file check email every 3 minutes. “Happy Tinkering”