Elk M1 Gold as a PowerHome Controller
You must first set the Elk up as a PowerHome controller. This can be done from the PowerHome Explorer under PowerHome|Setup|Controllers. You may connect to the Elk directly using a serial connection or via ethernet if you have an M1XEP.
After creating the Elk controller, click the "Settings" button to define the COM port (or IP address and Port) and the Analog Poll Interval. The Analog Poll Interval determines in seconds, how often PowerHome will query the Elk for the current value of any input points defined as analog inputs. You must also use the Elk RM utility to configure the Elk serial port for 115200 bps or properly configure the ethernet settings.
PowerHome provides support for all aspects of the Elk M1 Gold. The Elks lighting devices (X10, Insteon, etc.) are available as X10 devices in PowerHome. The digital (16 multiple-state) inputs on the Elk and external boards are available as Multi-State Inputs in the Analog I/O screen. Alternatively, if you're only interested in the open/close status of the multi-state inputs, you can define these points as Digital Inputs in the Digital I/O screen.  The Elk digital outputs are available within PowerHome as Digital Outputs in the Digital I/O screen. Inputs on the Elk setup as analog inputs are available within PowerHome as analog inputs in the Analog I/O screen. Elk temperature inputs can be declared as "Temperature" in the Analog I/O screen. The Elk digital inputs, if defined as Multi-State Inputs on the analog I/O screen, have a built in formula that will display appropriate values automatically. You can however override these built in formulas by declaring your own. All analog inputs, digital inputs, digital outputs, and lighting devices are automatically available within the PowerHome Device status screen. Manipulation and reading of these control points are also available using appropriate PowerHome functions and macro commands.  PowerHome also supports defining inputs (and triggers) for the Elk "Arm Status", "Arm State", and "Alarm State".  The definition for these points are all done in the Analog I/O screen.
When defining digital outputs, digital inputs, and analog inputs, the controller will be the ID of the Elk controller, the unit will be the board number from 1 to 13 (1 is used for the controls onboard the Elk), and the point will be the individual device number on the board from 1 to 16. Temperature inputs will have a unit of 1 for temperature probes, 2 for keypads, and 3 for thermostats. The point value for temperature inputs will be from 1 to 16 corresponding with the available units in each category.  There is also an alternative numbering scheme that is allowed that matches the Elk RM numbering scheme rather than the unit number / point number method.  Using this method, set the Unit to 0.  The Point will then be a value starting at 1.  For example, if you are declaring the 5th input on expansion board 3, you can use either Unit 3, Point 5 or Unit 0, Point 37.
In order for PowerHome to work properly with the above Elk controls, you MUST also use the Elk RM configuration software to setup each control appropriately. This cannot be done from within PowerHome since the protocol for this configuration is proprietary and is not made available to developers. This is less painless if using the ethernet interface since both PowerHome and the Elk RM software will be able to connect simultaneously rather than just one software at a time.
PowerHome also supports standard triggers for the above Elk control types. When a digital output changes state either from programming internal to the Elk or from PowerHome control, a digital output trigger will be fired. Similarly, when an Elk input changes state, a PowerHome Multi-State Input trigger or Digital Input trigger will automatically be fired. When an analog input changes, a PowerHome Analog Input trigger will be fired. For Elk Temperature devices (Temp Probe, Keypad, Thermostat), a Temperature trigger will be fired.  For lighting devices, the appropriate X10 In and X10 Out triggers will be fired.
The standard functions ph_getothervar, ph_setothervar, ph_getothertimer, and ph_setothertimer may be used to access and update the Elk Custom values. These values are numbered from 1 to 20. Use the ph_getothervar and ph_setothervar to access and update custom values that are either numbers or timers. Use ph_getothertimer and ph_setothertimer to access custom values that are configured as time of day. For time of day custom values, pass the data as an integer representing the time. For example, to pass 9:40 pm, the value should be set to 2140.
PowerHome also supports all of the additional control features within the Elk. In addition to the standard triggers defined above, PowerHome will also fire the Generic Controller Trigger for certain Elk specific functions. These are detailed below:
Support for the Elk specific control commands is available using the ph_ctlrcmd and ph_ctlrcmd1 functions. The specific controller command values and parameters are detailed below. To send an "Arming Status Request" command, the function would look like: ph_ctlrcmd1("ELKID",120,0,0,"","",1)
In addition to the above Controller commands supported by the Elk, there are a number of "Queued" commands that are also available for the Elk. "Queued" commands are normal tasks supported by controllers such as Send X10, Play IR, and Set Digital. The standard "Queued" commands such as the ones just listed are available by using the appropriate PowerHome functions or macro commands (such as ph_x10, ph_ir, etc). To access the non-standard queued commands supported by the Elk, use the PowerHome ph_ctlrsq function. An example of arm to away in area 1 with a usercode of 1234 would be: ph_ctlrsq("ELKCTLRID",121,"1234",1,1). Details on the Elk specific queued commands are below: