Haiku HaikuHelper Email Notifications

almen74

New Member
Hi
How do I setup email notifications for alarms and troubles from my Omni iie controller. I have HaikuHelper and Haiku. I am getting push notifications already but would like to get email as well.
I would appreciate any sample scripting code for this .
Thanks.
 
Its quite easy:

Code:
function onTrouble(trouble) {
	helper.sendMail(controller, '[email protected]', 'Trouble: ' + trouble, 'Trouble Reported for Controller: ' + controller.name + ': ' + trouble);
}
 
function onAreaAlarm(area) {
	helper.sendMail(controller, '[email protected]', 'Alarm: ' + area.alarmsDescription + ' in ' + area.bestDescription, 'Alarm Reported for Controller: ' + controller.name + ': ' + area.alarmsDescription + ' in ' + area.bestDescription);
}
 
Is there a way to have HaikuHelper send the emails to multiple addresses? If not, I'll just setup a distribution group when that is needed.
 
Either that or multiple sendMail lines would work. Create the subject and message as a string and reuse the string for each command. But a distribution group would be the best way to do it.
 
Thanks. Multiple sendMail lines works great for me.
I have one more question. Is there any way to include zone that tripped alarm in same email message.
Thanks.
 
hmm , yes provided the zone is marked as Tripped on the controller or not ready. You could loop through the zones and check for the ones that have a not ready status and include them in the report like so just before the sendMail and then include the report in the e-mail string:

Code:
var report = "\nZones Not Ready:\n\n";
 
var zones = controller.zones;
for(i in zones) {
    var zone = zones[i];
    if(zone.isNotReady) report += zone.bestDescription + "\n";
}
 
I too am trying to configure email notification on alarm.
I've copied the above script and modified the destination email address, however the logs show the following when the alarm is tripped:


May 14/12 6:16 PM: Home: Sending e-mail notification to "[email protected]": Home: Alarm: Burglary in House (Alarm Reported for Controller: Home: Burglary in House)
May 14/12 6:16 PM: Error: Could not send e-mail message: -2: Unsupported login mechanism.

I've tried using both my exchange server and ISP's SMTP server with and without authentication details, however both receive the same error.

Any help would be really appreciated
 
Ah, nevermind! Ran a telnet test against the SMTP server and found the anti virus was scanning outbound email.
Disabled that and working fine!
 
Back
Top