The i2cs Protocol
In March 2012, Smarthome began shipping new devices using the i2cs protocol.
Like the previous upgrade from i1 to i2, the devices remained compatible (i.e.
you can still manually link a device of any protocol with any other protocol)
but there were changes in how they need to be handled for programming purposes.
The "cs" in the name refers to checksums, which are now used to ensure accurate
reception of extended messages. However there are a number of other changes.
The details have not been officially released but here is what I have put
together so far:
- All extended messages place a checksum byte in D14. For more details, see
below.
- Wired i2cs devices must specifically be linked as a responder before they
will accept commands (linking them only as controllers will not work). It
is no longer possible to send direct commands to unlinked devices.
(Uncertain whether this refers to all i2cs devices or only some.) If the
device is not linked, it will return a NAK message (flag byte will be
0xAB). If you use an ALDB query command, an unlinked device will return
only the address of each byte instead of its contents. (This restriction
does not appear to apply to all wireless devices. Specifically we have seen
motion sensors and triggerlincs that do not seem to have this limit.)
- After an i2cs device sends a group command, it will transmit a report of
how many devices didn't respond with a cleanup message. This message
appears to be a broadcast message with command1=01 (looks like Set Button
Pressed) but command2=00 (for success) or unknown value for failure reports
(possibly the number of failures?).
- It is possible to set how many times cleanup direct messages are set
after a group broadcast. Also, previously any other Insteon traffic would
cancel these messages. It is now possible to turn on a setting that forces
a device to finish cleanup.
- x10 has been removed from some devices.
- The Get Insteon Engine Version command will return a value of 0xFF and a
NAK if the i2cs device is not linked to the PLM. If it is linked, it will
return a 0x02 which is the i2cs indicator.
- i2cs devices mostly do not support Peek/Poke. These were deprecated in i2
and now have been dropped from most devices. To edit the link table, use
the Read/Write All-Link Database command (2F) instead.
- As with other aspects of the protocol, not every device supports every
command.
- Many command that previously were sent as Standard messages now must be
sent as Extended messages. These include Enter Linking Mode and device
configuration commands for many devices including Insteon thermostats. For
these messages, typically just fill in 00 for all the extended data bytes,
but you do need the checksum byte (which is presumably the purpose of this
change).
- Other changes I have yet to notice.
Linking
You can still programmatically link an i2cs that isn't already linked. This
is necessary because of the second point above.
First put the PLM into linking mode:
02 64 [type] [group]
Where [type] = 00 if the PLM will be the responder, 01 if the PLM will be
the controller, or 03 if the first device to go into linking mode will be the
controller. [group] is the group number for the link.
Then send the command "Enter Linking Mode" to the recipient device as an
extended message:
02 62 [address] 3F 09 [group] 00 00 00 00 00 00 00
00 00 00 00 00 00 [checksum]
Checksums
To send extended commands to i2cs devices, it is now necessary to compute a
checksum and place it in D14 of the extended command. The checksum is based on
the twos complement of the sum of cmd1 through D13. In VB2005 you can compute
it as:
((Not(sum of cmd1..d13)) + 1) and 255
(This may appear to have more parentheses than necessary, but there seems to be
an order of operations bug that caused it to be incorrect without the
extras.)
Here are some example of extended commands with checksums which you can use as
a check to make sure you are calculating them correctly:
02 62 1B C5 E4 1F 2E 00 01 00 00 00 00 00 00 00 00 00 00 00 00
D1
02 62 1C 06 23 1F 2F 00 00 00 0F FF 01 00 00 00 00 00 00 00
00 C2
02 51 1C 06 23 19 70 1A 11 2F 00 01 01 0F FF 00 A2 00 19 70 1A FF 1F 01 5D
02 62 1C 06 23 1F 2F 00 00 00 0F F7 01 00 00 00 00 00 00 00
00 CA
02 51 1C 06 23 19 70 1A 11 2F 00 01 01 0F F7 00 E2 01 19 70 1A FF 1F 01 24
02 62 1C 06 23 1F 2F 00 00 00 0F EF 01 00 00 00 00 00 00 00
00 D2
02 51 1C 06 23 19 70 1A 11 2F 00 01 01 0F EF 00 00 00 00 00 00 00 00 00 D1