🖥️ActiveHome Pro > User-Designed Working Macros

[TIP] Alternate Email Method If MyHouseOnline Email Won't Work For You

(1/4) > >>

RebHawk:
This seemed like the best place to put this.  If not, feel free to move it to the correct place.

Narrative:
Despite the help of those here, I have never been able to get email from MyHouseOnline or any other AHP email to work.  I tried to get it working for some time, but finally gave up and decided to send my email using VBScripts run by batch files which are in turn run by using a PC Command from AHP in my AHP macro.  An example would be my Den Door macro.  If I have my "ARMED AWAY" flag set and the den door DS10A is tripped, the macro sounds my power horns and emails me at my home account, office account, and cell phone.  My powerhorns are triggered by a powerflash module that is in turn triggered by a universal module.

Trigger Conditions:
ARMED AWAY Flag set (NOTE: NOT the same as OnAlert ARMED AWAY.  I use one of the 16 AHP Flags for this function)
Den Door DS10A tripped


Actions:
Powerhorns ON
Delay 2 seconds
Execute Windows Program:
     c:\wtmp\X10\email\Den-Door.bat

This batch file simply contains the line:
     c:\wtmp\X10\email\Den-Door.vbs

This batch file runs the following VBScript, which actually sends the email:

Set objEmail = CreateObject("CDO.Message")
objEmail.From = "xxx@xxx.com"
objEmail.To = "xxx@xxx.com, yyy@yyy.edu, ##########@vtext.com"
objEmail.Subject = "ALERT ALERT ALERT Den Door Open"
objEmail.Textbody = "DEN DOOR OPENED!!!"
objEmail.Send

The above VBScript is saved with a name like "Den-Door.vbs" as indicated above.

You can cut and paste the above macro, replacing xxx, yyy, and #### as necessary for your particular email addresses and/or cell phone text message addresses.  Then build a library of bat/vbs files, one pair for each particular email alert you wish to send.  The advantage of this method is that it doesn't rely at all on AHP, except for running the batch file, which AHP seems to have no problem doing.

One caveat, make CERTAIN you have word wrap turned OFF in your text editor when writing these vbs files.  The line most likely to get word-wrapped is the "objEmail.To =" line, so if you get an error when trying to run the scripts, make sure you don't have a word wrap problem.

Another advantage to this method is that you can do all your testing outside of AHP.  Simply go to the directory you have these files stored in and double-click the batch file.  Edit and repeat until you get it working (which shouldn't take long!).

To me this method is much more robust than the AHP methods. 

Regards,
--Lee

EDIT: Fixed typo in trigger command name (should be Den-Door.bat, not Den-Door.vbs)
EDIT: Clarified some details of the file names for the various scripts.

jtykal:
Lee -- I've been planning to do something like this when I had a few cycles to spare. Thanks for saving me the time with this very helpful script! Can't wait to try it out!

RebHawk:
Glad I could help.  Note the correction I made to the trigger command.  Should have referred to the .bat file, not the .vbs file.  Also, for those not familiar with VBScript, it is built-in to Windows.  No need for extra software :D

Cheers,
--Lee

KDR:
Nice tip RedHawk, a  good alternative to get that email sent out. Gets a helpful from me.

----------------KDR

chuck:
Thanks.  I've used this code before, but was so hell-bent on making AHP email work I forgot about using it.  I tried it out and even dug out some old code I had, but it appears my new ISP (Verizon FIOS) blocks this kind of traffic.

I googled  "CreateObject("CDO.Message")" and found a very helpful site <<http://www.paulsadowski.com/WSH/cdo.htm>>  Here they have code for dealing with using your ISP's mail server passing it a username and password.  You will need to know your outgoing mail server info (same info you need to setup a mail client.

I hope this helps others in my situation.  I also hope the AHP developers will update their software to allow for email server configuration.

Navigation

[0] Message Index

[#] Next page

Go to full version