PowerHome2 & Elk M1 Gold Manual
14
6. Line 10 evaluates the temporary variable 5 to see if it is equal to 1174. 1174
corresponds to “Area is Disarmed” and is received by temporary variable 5 when
the trigger you create below is fired.
7. If temporary variable 5 is equal to 1174 than the macro proceeds to the next line
(line 20) and executes line 20. If temporary variable 5 is not equal to 1174 then
the macro jumps to the 3
rd
line after the line it is on (i.e. line 40) and executes
line 40.
8. If temporary variable 5 is equal to 1174 than Line 20 is executed. Line 20 sends
a text message or email using PowerHome2’s ph_sendsmtpemail formula.
ph_sendsmtpemail ( s, n, s, s, s, s ) can be explained as follows:
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.
After the email or text message is sent line 30 is executed which jumps the execution of
the macro to line 999 which doesn’t exist and the macro is ended.
9. If temporary variable 5 does not equal 1174 then line 40 is executed which
sends and email or text message indicating the Elk is armed.
10. Both line 20 and line 40 include the formula today() which is the date and time
the email is sent. Also the formula ph_getvar_s(2,2 ) is included in each
message. This retrieves temporary variable 2 from the Trigger defined below.
Temporary variable 2 is the Elk User Number of the person who disarmed or
armed the Elk.
Next build a PowerHome2 Trigger (PowerHome Explorer/PowerHome/Triggers).
1. Give the Trigger a name and description.
2. Define the “Trigger Type” as “Generic Controller”.
3. “Trigger Id” as the ELK controller name you assigned to your Elk within
PowerHome2.
4. Define the “Trigger Id Number” as “Command 1”.
5. Define the “Trigger Value” as “Option1”
6. Leave the Boolean as 1.
These are the same settings as in example 4.2 above.
7. Define the “Action Type” in the Trigger as “Macro”.
8. The Action is the macro name. Pick “Elk Email” from the drop down list.
9. Make sure to save the trigger by pressing the F5 key.
10. Test the Trigger by arming and disarming your Elk. The PowerHome Event Log
will indicate whether the trigger has been fired, the macro executed and the text
or email sent.