« Return to Thread: Problems with new insteon appliancelinc

Re: Problems with new insteon appliancelinc

by John Branch () :: Rate this Message:

| View in Thread

Chris Engel wrote:
CS in the name refers to "checksum". All extended messages place a checksum byte in D14. How this is computed or checked... uncertain.
For those out there that are interested, I did a bit of research to try to figure out how to use the PLM to send commands to the devices using the new i2CS. From various online sources I collected a few command traces that use i2CS:

1. 0262 XXXXXX 1F 6B 09 00000000000000000000000000 8C
2. 0262 XXXXXX 1F 2F 000000 0F FF 01 0000000000000000 C2
3. 0262 XXXXXX 1F 2F 000000 0F F7 01 0000000000000000 CA
4. 0262 XXXXXX 1F 2F 000000 0F EF 01 0000000000000000 D2

I quickly noticed that the bytes representing the device ID (XXXXXX) are not used to compute the checksum as I was able to send the first command to a new thermostat adapter (using i2CS) and it worked to turn it off.

While I did not figure out how the checksum is computed, I noticed that, from one command to another, the offset in the addition of all the bytes, after the device ID bytes, matches the inverse offset in the checksum. Let us look at the commands 2 and 3 above for an example.

The checksum of command 2 is 0xC2 which is smaller than the checksum of command 3, 0xCA, by 0x08 units. The sum of the extended command bytes in command 2 is 0x10F and for the command 3 is 0x107. The difference between the two sums is again 0x08. But as the difference in sums is positive, the difference in the checksums is negative. This is what I mean by "inverse" offset.

By using this approach, various other commands can be built. These are examples of commands used for the thermostat adapter:

1. 0262 XXXXXX 1F 6B 09 00000000000000000000000000 8C - thermostat off
2. 0262 XXXXXX 1F 6B 04 00000000000000000000000000 91 - heat on
3. 0262 XXXXXX 1F 6B 0A 00000000000000000000000000 8B - heat program
4. 0262 XXXXXX 1F 6D 90 00000000000000000000000000 03 - heat at 72F

Looking forward to learn about the actual algorithm used to compute the checksum. Form what I can tell it may be the 16 bit 2's complement checksum.

Cheers,

JB

 « Return to Thread: Problems with new insteon appliancelinc