Author Topic: HOW TO: Turn on light(s) when arriving home  (Read 1758 times)

John Hughes

  • Administrator
  • Hero Member
  • *****
  • Posts: 2851
    • View Profile
    • Codecore Technologies
HOW TO: Turn on light(s) when arriving home
« on: April 21, 2010, 09:41:09 pm »
The following rule demonstrates how to turn on a light when an an Elk M1 security system is set to Away Mode and a specific door is opened.

This rule assumes you have an Elk M1 device named "elkm1" and a ZWave device named "lighting". Similar rules can be used with the HAI Omni Pro and other lighting devices.

The following report was automatically created by the Rule Report toolbar button in the Rules window.

Code: [Select]
Rule Name: Welcome Home
Group Name:
Description: Turn on the kitchen light when returning home.
Enabled: Yes
Log: No

Event:
  Device Name: Elk M1  (elkm1)
  Event Name: Zone Status Change

Whenever Filters:
  ZoneID: 18
  Status: Violated (2)

Action List:
1.  Run the following indented actions if the arm status for  Elk M1  area # House (1) is the same as  1 .
2.     Run the following indented actions if the arm up state for  Elk M1  area # House (1)  is the same as  4 .
3.        Turn on  Z-Wave (ViziaRF RZC0P)  light # Laundry (3) .
4.     End of conditional list of actions.
5.  End of conditional list of actions.

Auto-Generated Script:
if ( elkm1.AreaArmStatuses[1] == 1 )
{
if ( elkm1.AreaArmUpStates[1] == 4 )
{
lighting.TurnOnLight(3);
}
}
John Hughes
Codecore Technologies