Control Kelon/Electra/Tadiran AC with Tuya IR blaster — fully reverse-engineered KELON168 protocol

Hey everyone,

I recently decided to make my old A/C smart using an IR blaster.

I didn’t have an IR blaster directly supported by Home Assistant, so I used a cheap Tuya IR blaster with LAN control, since the official Tuya integration doesn’t support IR blasters properly.

My A/C uses the KELON168 IR protocol , used by Kelon / Electra / Tadiran air conditioners, which are very common in Israel.

This became quite a collaborative project. I did the “stupid monkey” part: manual IR captures (totally ~15 raw codes was used), testing and chatting. Claude helped with protocol analysis, byte decoding, Jinja2 code generation, and Home Assistant integration. Of course, sometimes you still need to guide Claude and stop it from doing stupid things :slight_smile:

Why this was hard:

  • The protocol is 168-bit, 3-frame, LSB-first , so it is not trivial to decode.
  • LocalTuya RC stores learned codes as 42-bit NEC , which is only about 25% of the signal.
  • Raw pulse format is the only working approach. (but who wants to learn all combinations?)
  • The power button is a toggle, with no absolute ON/OFF command. (turbo workaround exist)
  • “I Feel” mode requires sending the live temperature sensor value inside the IR frame.

Key discoveries:

  1. Power ON
    The TURBO frame unconditionally turns the A/C on, regardless of the current state.
    Sending turbo + desired state frame gives guaranteed power on without sync issues.
  2. Power OFF
    Sending turbo + power toggle frame gives guaranteed power off without sync issues.
  3. :high_voltage:Dynamic code generation :high_voltage:
    Instead of recording 200+ IR codes, all IR frames are calculated dynamically from the protocol spec using Jinja2 inside a Home Assistant script.
  4. I Feel mode
    Bytes 6, 11, 12, and 15 encode the sensor temperature and activate room-temperature-based control. (so - external temp sensor for this old device, my wi-fi a/c doesnt not support external sensors, but here it's working)

What is included:

  • kelon168.py — Python IR code generator with self-tests
  • climate_template_kelon168.yaml — full HA climate entity using litinoveweedle/hass-template-climate
  • Full protocol specification with byte definitions, checksums, and special modes

Works with: Kelon, Electra, Tadiran, Airwell, Emailair — and probably anything using the KELON168 protocol, especially if the first two bytes are 0x83 0x06 .

Migrating to an ESPHome IR blaster should be only a small change: the protocol logic stays the same, only the send method changes.
Posting here - just in case somebody will need something similar.
GitHub: GitHub - Aikidyst/kelon168-ir-homeassistant: ELON168 IR protocol reverse-engineered for Home Assistant — Kelon/Electra/Tadiran AC control via Tuya IR blaster · GitHub