Insteon support and PowerHome.

Beta version 1.03.4.7 of PowerHome provides full support for SmartHome's Insteon protocol and devices including software linking.  Please read the following details below in order to maximize your results when using Insteon with PowerHome.

PowerHome utilizes the SmartHome Device Manager ActiveX control for Insteon support.  This control allows both the serial and USB versions of the Insteon PLC to be used and later the ethernet interface when made available.

To fully realize the features and possibilities of Insteon, it helps to understand a little about how it works.

Unlike X-10, each Insteon device comes preconfigured from the factory with a unique address.  With X-10, you could individually address each device by choosing a housecode from A to P (16 possible choices) and a unitcode from 1 to 16.  This gave you a maximum of 256 possible unique devices.  With Insteon, each device is preconfigured with a 3 byte address yielding a possible 16777216 combinations.  This 3 byte address is represented in hexadecimal format (the decimal numbers 0 thru 9 and the letters A thru F).  You will typically see an Insteon address such as: 01.2A.4C.  Each two hexadecimal digits represent a single byte with each byte representation separated by a period.  All Insteon devices will have a label showing what their unique address is.

Dimmable Insteon devices will have an output level ranging from 0 to 255.  A value of 0 would be fully dimmed or off and a value of 255 would be 100% bright.  When you control an Insteon device locally, it will default to turning full on.  You can optionally set a "local level" so that when you turn a dimmable Insteon device on locally, it will turn on at a predefined level of your choosing.  Once on at this level, if you press the "On" switch again, the light will go to "full on".  If you set the "local level" to 0, the light will turn on to the last level the light was at when it was turned off.  Additionally, each dimmable Insteon device has an individual "local ramprate".  The local ramprate controls how quickly the device turns On or Off when the device is locally switched.  Values for the ramprate range from 0 to 31 with 31 being nearly instant and 0 taking close to 9 minutes.

All Insteon devices are inherently two-way unlike X-10 where typically only the more expensive devices were capable of two-way communication.  Most Insteon devices are capable of being remotely controlled as well as acting as a controller to control other Insteon devices.  

The Insteon specification allow for a number of standard and extended length messages, but for our purposes, we really only need to concern ourselves with two types of standard messages.  These are direct commands and group commands.  A direct command is a single Insteon device directly communicating with another single Insteon device.  These communcations are typically acknowledged through two-way communication between the devices and automatically retried in the event of communication failure.  The second type of message is a group message.  Group messages are not acknowledged and are a broadcast command.  In other words, the message is not sent to a single device.  The message originates with a single device and is "broadcast" to any device within range.

When an Insteon device controls another Insteon device, this is accomplished through group commands.  A standard SwitchLinc dimmer has a single on/off paddle.  As such, a SwitchLinc dimmer is capable of controlling a single group of devices.  Multiple devices may be contained within a single group.  When a SwitchLinc dimmer is turned on locally by pressing the "On" paddle, the dimmer turns itself on to the "local level" using the "local ramprate".  It also sends out a group command if it has been "linked" to any other Insteon devices.  This group command will be for group 1 of the SwitchLinc's address.  Any device linked to the SwitchLinc will turn on at the "group level" and "group ramprate".  Without getting overly complicated and technical, in addition the a "local level" and "local ramprate", each device has a "group level" and "group ramprate" for each group/device combination that it belongs to.

When the group broadcast command from the SwitchLinc is received by another Insteon device, that device will check it's internal database and see wheither or not it is a member of the SwitchLinc's group 1.  If it is, it will look up the "group level" and "group ramprate" associated with the SwitchLinc's address and group 1 and will turn on to that level using the ramprate.  A similar thing happens when the SwitchLinc is switched off or dimmed or brightened locally at the switch.

As part of the Insteon standard, after the group command is sent (not acknowledged), the controller will then scan it's internal database and will send a direct group cleanup command (acknowledged) to each device that is a member of it's group to insure that the group command is carried out.  It's important to remember that when a device is added to a group (this process is called "linking"), not only is a record created in the database of the controlled device, but also a record is created in the database of the controlling device.  This way, the controlled device knows who is controlling it and the controlling device knows who it is controlling.

The process of creating groups is called "linking".  Each Insteon device has it's own "database" of devices it controls and devices that control it.  This data is stored in EEPROM and is remembered even in the event of power failure.  A standard use of linking, is during the setup of 3 or multi-way switches.  Unlike X-10 where a 3-way lighting circuit had a master controller and then a cheap "dummy" slave switch that is electrically linked to the master, Insteon accomlishes 3 and multi-way circuits virtually.  Essentially, a single Insteon switch (the master) is electrically connected to the light being controlled with any "slave" type switches being removed from the circuit with simple wiring changes.  The "slave" switch is then wired into the house wiring, but with no load(light) connected and without a direct connection to the master.  The slave switch is then "linked" to the master with an Insteon group.  When the slave switch is turned on, a group command is sent to the master and the master switch then turns on.  At this point, it is not required to do any more in order for the 3 way circuit to work.  However, if you want the LED indicator light on the slave switch to reflect the status of the light when the light is switched using the master, you must "cross link" the slave to the master.  Basically what is done is that the slave is linked to the master such that the slave controls the master (this is necessary just to get the 3 way switch to work) and additionally, the master is "cross linked" to the slave so that the master controls the slave.  Even though the slave is not electrically tied to the light, it will still receive an "on" command when the master is switched on and it's status LED will reflect that the master is "on".

An important point to remember is that if an Insteon device does not control any other devices (no links exist in it's database as a controller), when the device is switched locally, no Insteon message is generated from the switch.  What this means is that the PLC and any program attached to it will be unaware that a transition ocurred.  As long as the switch is controlling at least one other device, a group message will be sent and the PLC and any program attached will know that the switch was turned on or off locally.

If local switch sensing is desired and the switch does not control any other loads, you can still link the switch directly to the PLC.  This will in effect create a record in the switch's database and a group command will be sent.  Although the PLC will not respond to the command, it will receive the message and pass it on to any connected program.

The PLC device itself can have it's own groups and control them as well.  The PLC device can have a total of 254 groups from 1 to 254.  The PLC CANNOT trigger another devices groups.  All Insteon messages are signed with the address of the originating device and the PLC is no different.  If you have a KeyPadLinc that controls 5 lights in it's group 3, then you cannot trigger that group directly from the PLC and would instead have to re-create the same group of 5 lights into a PLC group.

Group 255 is an "All Units On" group.  If the PLC or another Insteon device sends a command to group 255, then any device that is a member of any group from the controlling device will respond.  This is how a ControLinc performs an "All Lights On" and "All Lights Off" commands.

How PowerHome uses Insteon:

PowerHome supports both direct commands from the PLC to another Insteon device as well as group commands sent from the PLC.  PowerHome should also accurately track all Insteon commands whether they originate from PowerHome or from any other Insteon device on the network and update the Device Status screen appropriately.

PowerHome also supports the creation of links within the PLC and remote devices from within PowerHome.  If you prefer to create links using the physical tap-tap method, PowerHome supports this as well and will automatically query remote devices for any changes within their database.

To set PowerHome up for Insteon use, you must first declare an Insteon controller in the PowerHome Explorer.  Open the PowerHome Explorer and using the left-hand tree view, navigate to PowerHome->Setup->Controllers.  Assign a short, meaningful ID (you will use this ID to send Insteon commands) and choose the "Insteon DM" controller type.  Click the "Active" box.  You can click the "Settings" button to see the individual settings, but the defaults should be fine.  Restart PowerHome in order for the changes to take effect and allow the Insteon Controller to load.

Once PowerHome is restarted, the SmartHome Insteon Device Manager should automatically load.  You should see a new icon in the System Tray (the list of icons on the far right of the Start toolbar).  The Device Manager should automatically detect the type of PLC and what port it is on but sometimes fails to do so.  If the Device Manager is unable to sense your PLC, PowerHome will respond with the message: "The XXX PLC is not responding.  Commands will not be sent." where XXX is the ID you assigned to your Insteon controller.  If you should get this message, open the SmartHome Device Manager by doubleclicking it's icon in the System Tray.  You should see the SmartHome Device Manager window open.  Left click anywhere in the big log window and then type the letters D M.  A single line edit window should open towards the bottom of the screen.  Type "port=?" without the quotes in the edit window and press enter.  This should force the DM to locate your PLC.  Give it a few seconds and you should see "PLC: port=true" in the log window.  However, if it still cannot locate your PLC, you may get a "PLC: port=false" message.  Whatever message you get, type "getport" in the edit window and press enter.  In the log window, you should see what port the DM is currently looking at.  If you have a USB PLC, then the port should be "USB4".  If your PLC is serial, then you should see COM followed by the number of the COM port the PLC is in.  If the port returned by getport is not correct for your setup then type "port=USB4" if your PLC is USB and "port=COM1" if your PLC is serial and connected to COM1.  Adjust the COM port number for your situation.  You can verify the port was set using the "getport" command.  Once the DM finally recognizes your PLC, it will store the settings in the registry and will be remembered unless you change the port.  Once everything is communicating, you can minimize the DM.

The next step is to tell PowerHome what Insteon devices you have.  In order for PowerHome to monitor or control your devices, it must know what the devices are.  Open the PowerHome Explorer and using the tree view navigate to PowerHome->Devices->Insteon->Units.  Using this screen you can manually enter in each of your Insteon devices.  In order to do this, you'll need to make a list of the Insteon address and device type of each device you have.  As an alternative, PowerHome has the ability to remotely sense your Insteon devices.  This is a lot easier than looking up all of your device addresses and typing the info in.  It still requires a physical visit to each device, but it's a lot easier than a lot of typing.  We'll get to the Auto Discovery in a minute.

Right-click on the "Insteon Devices Detail" screen and select the "Insteon DM Control" from the popup menu.  In order for PowerHome to effectively work with Insteon, the PLC must first be prepared.  From the "Insteon Device Manager Control" window,  dropdown the controller field and select the ID of your Insteon controller.  This is the ID you created in the PowerHome Explorer under Setup->Controllers.  After selecting your Insteon Controller ID, the buttons should become available.  The first thing you should do is "Download Core Application".  The Insteon PLC allows different programs to be downloaded to it.  The program that PowerHome was written to work with is "timercoreapp06".  

After the core application has been downloaded to the PLC, you should next "Clear PLC Database".  This will remove any ID's currently existing within your PLC's database and prep it for auto discovery.  Skip over the "Clear PowerHome Insteon Devices" and "Clear PowerHome Insteon Groups".  These buttons work with the PowerHome database and may be used to clear any Insteon Devices defined within PowerHome as well as any Insteon links defined within PowerHome.  These two buttons DO NOT effect any Insteon devices and simply wipe out PowerHomes Insteon database.  

You're now ready to auto discover your Insteon Devices.  Click the "Turn Discover Mode On" button.  The PLC will now be listening for enrollment requests from other Insteon Devices.  The easiest way to do this is to have pencil and paper and visit each Insteon Device you have.  Press and hold either the "Set" button or "On" button for 10 seconds until the status LED is blinking and the Insteon Device is in enrollment mode.  As soon as the Insteon device enters enrollment mode, tap the "Set" or "On" button to turn enrollment mode off.  The status LED should stop blinking and become steady.  Make a note on the paper what device you were just at.  That's it.  Visit each Insteon Device, place it in enrollment mode, cancel the enrollment, note the switch, and move to the next.  Each time a device is placed into enrollment mode, PowerHome will receive a notification and automatically create an entry in the Insteon Devices table.  Each entry will have a unique ID starting with "NEW DEVICE 1".  The second device you place in enrollment will be "NEW DEVICE 2", etc.  This is why you should have pencil and paper and note the order of the devices as you place them in enrollment.

When you've discovered all of your devices, return to PowerHome and press the "Turn Discover Mode Off" button.  Exit the "Insteon Device Manager Control" window.  You should be back in the PowerHome Explorer at the "Insteon Devices Detail" screen.  Press the "F5" key to refresh the view and you should see a list of all devices you discovered.  You should go through each device and change the default ID that was created to a short, meaningful ID.  The ID you create will be used for direct control so make it easy to remember.  Type a description for the device if you wish and a location if you like.  You should verify the device type to make sure that it is accurate.  It's possible that not every device was discovered.  Noise on the line could block enrollment broadcasts and at least one device type doesnt seem to auto discover (ControLincs).  After you're done making changes, press the "F5" key to update the database.

At this point, sit back and relax a little.  PowerHome is currently interrogating each device to discover it's local level, current status, and any database links they may have.  If you've been previously using Insteon and have created groups and multi-way circuits, PowerHome will discover all of this automatically.

You can monitor PowerHome's progress from the PowerHome Explorer by navigating to PowerHome->Devices->Insteon->Groups->By Controller.  You should start to see your Insteon groups appear.  Keep in mind that the screen is not autoupdated and you must press the "F5" key to refresh the screen.  In this screen, you will see the Group Controller followed by all responders to the controller.  You'll be able to see the group level and group ramprate associated.  Two important field to monitor are the "Controller Status" and "Responder Status" fields.  Possible values are "VERIFIED", "CHECKING", "NOT FOUND", "FLAGGED DELETE", and "FLAGGED CREATE".  At this point, you should only see 1 of the first 3.  "VERIFIED" means that the link has been properly verified in either the controller or responder.  "CHECKING" means that PowerHome is currently in the process of validation.  "NOT FOUND" means that the link was not found in either the controller or the responder.  Since a link exists in both the controller and responder, a link is only good if "VERIFIED" appears in both the controller and responder fields.  If you have a "NOT FOUND", then the link is not complete and is only wasting database space in the "VERIFIED" device.  Be patient, it takes time to for PowerHome to discover all of the links.  It takes a lot of Insteon data in order to retrieve all of the information and since PowerHome is doing the checking in the background, it may take up to an hour for a lot of links.

After PowerHome has discovered all there is to know of your Insteon Devices, it's best to decide now which method you prefer for future linking.  If you prefer tap-tap linking, thats fine.  PowerHome will automatically discover any changes you make to the device databases using tap-tap linking.  You'll see these changes updated in the Insteon Groups section of the PowerHome Explorer.  If you prefer to manage your links using PowerHome, it's best to not use tap-tap linking anymore because of conflicts.  For example, you create a new link using tap-tap linking.  PowerHome will eventually discover the link, but it may take a few minutes.  If you create a different link in PowerHome using any of the same devices before PowerHome discovers the link, PowerHome may overwrite the previously created tap-tap link.

Creating and updating links in PowerHome is both fast and easy.  If you want to delete a link, just right-click the link and choose "Delete from Devices".  This will flag the link to be deleted from both the controller and the responder.  If you want to change the group level or group ramprate, just type in the new values (0 to 255 for level, 0 to 31 for ramprate).  Any changes you make must be saved (by pressing "F5") before PowerHome actually updates the Insteon devices.  If you wish to create an entirely new link, right-click and choose "Create/Edit/Clone".  A new window will appear allowing you to create, delete,edit, or clone links.  

In the "Create Insteon Group" window, first select the "Group Master".  This is the controlling device.  Next select the group number of the master.  For ControLincs, this will be from 1 to 5 (for each of the 5 buttons) and 1 for SwitchLincs and the like.  A KeypadLinc has a total of 8 groups and the PLC has up to 254.  After selecting the group number, the "Responders" and "Available Devices" window will update to reflect the current status of the group.  You can add devices to the group by doubleclicking them in the "Available Devices" list and you can remove them from the group by doubleclicking them in the "Responders" list.  Once you've added devices into the "Responders" list, be sure you scroll to the right and set the appropriate group levels and ramprates.  When you're done, click the "Save Group" button and you're ready to start on the next group.  PowerHome will automatically start sending the appropriate commands to create/delete/edit the group in the background.

You can also view groups by "Responder".  In the PowerHome Explorer, navigate to PowerHome->Insteon->Devices->Groups->By Responder.  You cannot make changes to the groups using this screen.  If you need to make changes, use the "By Controller" screen.

PowerHome also provides a couple of Insteon Reports.  Under the Reports menu option, choose Insteon->Devices Not Group Controller.  This report will give you a list of all devices that are not configured to control a group.  This report is useful because any device showing in this report will not send an Insteon command when switched locally and so won't be able to be tracked within PowerHome.  You can remedy this by creating a group for the device as a controller and placing the PLC into the group as a responder.

The second Insteon report, "Devices without Links" give you a list of all devices defined within PowerHome that have no links at all.

The last field to visit is the "Local Level" field in the "Insteon Devices Details" screen.  PowerHome will initially discover the "Local Level" automatically.  Unfortunately, PowerHome cannot change the local level of an Insteon device because the EEPROM setting is only read at startup.  The "Local Level" is the level that a dimmable Insteon device will turn on to when switched locally.  This level can be set at the switch by dimming the light to the appropriate level (either locally or remotely such as with PowerHome).  Once the device is at the proper level, quickly press the "Set" button one time.  This procedure works with SwitchLincs and may differ for different devices.  Once the local level is set, pressing the "On" button once will turn the light on to the previously configured "Local Level".  If the light is already on and the "On" button is pressed again, the light will turn to full brightness.  If you are using a predefined local level, don't make any changes within PowerHome.  PowerHome will discover the local level on it's own.  Another possibility with local level is "resume dim".  Resume dim will always turn a light on to the last level that it was at.  To use resume dim, set the local level to 0.  To do this, dim the light all the way to 0 (don't turn it off) and then quickly press the "Set" button once.  Now, every time the "On" button is pressed, the light will turn on to the last level it was at when the light was turned off.  If you are using "Resume dim", set the "Local Level" field in PowerHome to 0.  A value of 0 tells PowerHome to NOT query the devices local level and to function in resume dim mode.  If an Insteon device is not dimmable (ControLincs, ApplianceLincs, etc.), then you should set their "Local Level" to 0 as well in order to reduce traffic.

Once PowerHome has been configured to use Insteon, you can monitor and control your Insteon devices from the "Device Status" screen.  This screen will reflect in realtime the actual status of your Insteon devices as their status changes.

You can also get a finer degree of control of your Insteon devices using the PowerHome Insteon built-in functions.  These functions are ph_insteon, ph_insteonraw, ph_insteonrawgroup, and ph_devicebtn.  An explanation of these functions can be found in the PowerHome Help file.  Additionally, you can retrieve status and information on Insteon devices using the following functions: ph_getinsteondt, ph_getinsteonlevel, ph_getinsteonseconds, and ph_getinsteonstat.