Repository navigation
Protocol Reference
← Documentation · Events and actions · Contributing
This reference records the protocol behaviour already implemented and documented by the project. It is intended for diagnostics and development; ordinary setup does not require these details.
TecomHA uses the CTPlus / Management Software binary protocol, reverse engineered from CTPlus traffic, packet captures, logs and event-table data. It is not an official vendor protocol specification. For implementation details, see ctplus_protocol.py, hub.py and the changelog.
The panel keeps separate Alarm and Access event queues. If a queue head is not retired correctly, the same event is resent and later events remain blocked behind it. This can eventually appear as communication-path flapping.
Frame integrity is strict: an acknowledgement the panel cannot parse is effectively a missing acknowledgement. The historical multi-hour stalls required packet-level analysis to identify; changing broad polling intervals did not address their cause.
CTPlus uses targeted recalls for doors, inputs, areas and DGP states. The integration follows that approach, with status synchronisation at startup/reconnect and optional runtime polling. Heavy polling can compete with live event handling.
5E <type> <flag1> <flag2> <sequence> <body...> <CRC16 little-endian>
CRC is CRC16/Modbus over the bytes from type through the end of the body.
0x5E is the frame sync marker. Every occurrence after the leading sync byte, including in the header, sequence, body or CRC, is escaped on the wire as 0x5E 0xFF. Both encoding and parsing must account for the entire post-sync region. Omitting CRC/header escaping caused earlier queue stalls.
The basic message types are 0x40 data/event, 0x41 panel acknowledgement, 0x60 command, 0x64 heartbeat and 0x73 host acknowledgement. The protocol also uses type-offset variants; follow the existing implementation rather than guessing a type from one capture.
An input is sealed only when both bits 5 and 6 are set:
sealed = (raw_status & 0x60) == 0x60Standard inputs can become unsealed by clearing 0x20; Type 20 inputs clear 0x40 instead. Testing one bit alone gives incorrect results for one group. Home Assistant reports unsealed as on and sealed as off.
Bit 0x0080 of the area status word indicates armed. Lower modifier bits, such as isolation-related flags, must not determine armed state.
The status word cannot distinguish stay from away. Events 0x6C and 0x0B supply that distinction. Polls preserve a known stay-arm state and must not clear an active alarm simply because a status reply arrived.
DGP door status words are decoded big-endian. The project confirmed the following by comparing locked/unlocked and open/closed combinations:
| Bit | Meaning |
|---|---|
0x0200 |
Lock released |
0x0080 |
Contact open |
0x1000 |
Co-varies with contact open in the captured combinations |
0x0040 |
Unsecured: unlocked or open |
A recent live door event briefly takes precedence over a conflicting queued poll response. Current status replies can populate lock/contact state at startup. The word does not express the difference between manual and automatic lock modes.
| Code | Meaning |
|---|---|
0x4B |
Card rejection, trailing door field; no identified user |
0x8B |
Access denied — void; identified user field |
0x86 |
Door unlocked |
0x87 |
Door locked |
0x88 |
Door auto unlocked |
0x89 |
Door auto locked |
0x92 |
Access granted |
0x9D |
Access granted — egress |
0xA5 |
Door open |
0xA6 |
Door closed |
0xA7 |
Door forced |
0xA8 |
Door forced restored |
0xA9 |
Door open too long |
0xAA |
Door open too long restored |
0xAE |
Door unsecured |
0xAF |
Door secured |
Timestamp-correlated HA debug frames and CTPlus screenshots confirm these anchored 0F 0C bodies, exactly 14 bytes long:
| Code | Body fields after the code at offset 6 |
|---|---|
0x4B |
Offsets 7–12: six raw card bytes; offset 13: one-byte door number |
0x8B |
Offsets 7–8: door, little endian; offset 9: area; offsets 10–11: user, little endian |
The card-rejection door field was confirmed on two doors. Both unknown and voided cards produced 0x4B, so it is labelled “Card rejected” without inferring a user or reason. The registered-card test still reported “void” in CTPlus and used 0x8B; no 0x8C / not-in-group layout is established. Other lengths and legacy unanchored denial forms are not guessed. Raw 0x4B card bytes are redacted from diagnostics and bus payloads.
See the regression tests and stable release notes.
| Code | Meaning |
|---|---|
0x84 |
Output active |
0x85 |
Output normal |
| Code | Meaning |
|---|---|
0x96 |
Unsealed (HA state: on) |
0x97 |
Sealed (HA state: off) |
Seal state from polled status is decoded from bits 5 and 6 together — see Input status. Alternative mapping modes are available in the options for panels that behaved differently under earlier 2.x builds.
Alarm events are point-scoped and carry the area in the event body.
| Alarm | Restore | Meaning |
|---|---|---|
0x00 |
0x02 |
Alarm |
0x04 |
0x05 |
Secure alarm |
0x57 |
0x58 |
Multi-break alarm |
0x67 |
0x68 |
Exit alarm |
0xC2 |
0xC3 |
Local alarm |
Note that 0x00 collides with "Comms - offline" in the event table; the meaning is context-dependent.
| Code | Meaning |
|---|---|
0x0B |
Area armed (away) |
0x0C |
Area disarmed |
0x6C |
Area armed (stay / home) |
| Code | Meaning |
|---|---|
0x59 |
Comms path fail |
0x5A |
Comms path restored |
0x5B |
Expander communications fault |
0x5C |
Expander communications restored |
User-facing setup is in Panel setup. The implemented authentication methods are a packed 10-digit security password and fixed-width path user/password credentials.
Encrypted UDP payloads consist of a 16-byte IV, a two-byte big-endian plaintext length and CBC ciphertext through the end of the UDP payload. There is no four-byte trailer. The protocol uses zero padding rather than PKCS#7; the configured ASCII key is padded to 16 bytes for AES-128/TwoFish or 32 bytes for AES-256.
This layout was checked against 552 datagrams across 12 CTPlus captures: each cipher with both security/computer-password and path-user/password authentication. All decrypt to CRC-valid frames and re-encrypt byte-identically with their original IV. Authentication and host acknowledgement sends were also reproduced through the hub. These checks cover UDP; encrypted TCP is not implemented.
Both immediate and async acknowledgements use the selected encryption. Wrong-key detection checks padding and frame CRCs, because CBC decryption can return invalid bytes without raising an error.
See ctplus_crypto.py, twofish.py and the stable release notes for details and capture-validation evidence.
The repository includes tools for decoding captured frames, inspecting debug dumps and comparing replay results:
The PCAPNG reader supports Ethernet/IPv4 UDP, including VLAN tags and IPv4 options. It honours captured packet and UDP lengths, excludes capture padding/options/footers, and rejects malformed blocks or unsupported interface types. It does not reassemble IP fragments. The incorrect offsets in the older reader caused the false trailer claim corrected in 3.4.2.
Protocol values should be backed by a capture of the corresponding CTPlus action. Preserve distinctions between verified observations and values inferred from tables or incomplete captures.