homelab-codex-ws/hardware/esp/ir-ac-ha-integration
oskar f1dbdf514d feat(gree-ir): wlasny komponent ESPHome dla klimy Gree
Natywne komponenty gree/coolix nie dzialaly - zla suma kontrolna.
Protokol zreverse-engineerowany z 22 ramek IR nagranych z pilota:
- bajt0 = tryb+power: cool 0x19, heat 0x4C, fan 0x1B, off 0x44
- bajt1 = temperatura jako (temp-16)
- checksum = (lo(b0..b3)+hi(b4..b6)+0x0A)&0xF w gornym nibblu b7
- timingi: hdr 9030/-4460, mark 677, space0 553, space1 1630, gap 19960

Termostat Off/Cool/Heat/Fan, zakres 16-30C, HW: Wemos D1 Mini + Grove IR.
2026-07-22 16:46:03 +02:00
..
components/gree_ir feat(gree-ir): wlasny komponent ESPHome dla klimy Gree 2026-07-22 16:46:03 +02:00
.gitignore feat(gree-ir): wlasny komponent ESPHome dla klimy Gree 2026-07-22 16:46:03 +02:00
deploy.sh feat(hardware): ESPHome Gree IR blaster (Wemos D1 Mini + Grove IR) 2026-07-22 16:46:03 +02:00
docker-compose.yml feat(hardware): ESPHome Gree IR blaster (Wemos D1 Mini + Grove IR) 2026-07-22 16:46:03 +02:00
gree-ir-blaster.yaml feat(gree-ir): wlasny komponent ESPHome dla klimy Gree 2026-07-22 16:46:03 +02:00
README.md feat(hardware): ESPHome Gree IR blaster (Wemos D1 Mini + Grove IR) 2026-07-22 16:46:03 +02:00
secrets.yaml.example feat(hardware): ESPHome Gree IR blaster (Wemos D1 Mini + Grove IR) 2026-07-22 16:46:03 +02:00

Gree IR Blaster

ESPHome firmware for a Wemos D1 Mini (ESP8266) driving a Gree air conditioner over IR, exposed to Home Assistant via the native ESPHome API (no MQTT, no Broadlink, no Tuya).

Hardware

  • Wemos D1 Mini (ESP8266)
  • Grove IR Emitter
  • Grove IR Receiver

Wiring

Grove module Pin Wemos D1 Mini
IR Emitter SIG D5
IR Emitter VCC 5V
IR Emitter GND GND
IR Receiver SIG D6
IR Receiver VCC 3V3 — not 5V, ESP8266 GPIO is not 5V-tolerant
IR Receiver GND GND

Home Assistant / deployment model

HA on piha runs as the home-assistant:stable Docker container, not HAOS, so ESPHome is not installed as an add-on. It runs as a one-off container via docker compose run --rm — there is no ESPHome daemon on piha. Compile/flash is a manual, operator-triggered action; this device is intentionally not registered in hosts/piha/services.yaml.

Once flashed, the device advertises itself via mDNS and shows up as a discoverable ESPHome device in Home Assistant (Settings → Devices & Services → Add Integration → ESPHome).

First flash (USB)

  1. Copy secrets.yaml.example to secrets.yaml and fill in wifi_ssid, wifi_password, fallback_password.
  2. Wire the board as above and plug it into piha via USB.
  3. Run:
    ./deploy.sh --usb
    
    This flashes over /dev/ttyUSB0.

Subsequent flashes (OTA)

Once the device is on WiFi, redeploy without --usb:

./deploy.sh

This runs docker compose run --rm esphome run gree-ir-blaster.yaml, which flashes over the network via the ESPHome OTA protocol.

Identifying the Gree protocol variant

The climate: platform: gree component needs a model: matching your AC's remote protocol. gree-ir-blaster.yaml currently ships with model: yan as a starting guess — this is not verified and must be confirmed against the actual remote.

To identify the correct variant:

  1. Flash the firmware and let the device boot (WiFi connected).
  2. Tail the logs:
    docker compose run --rm esphome logs gree-ir-blaster.yaml
    
  3. Point the physical Gree remote at the Grove IR Receiver and press a button (e.g. power on, or change temperature). dump: all on remote_receiver causes ESPHome to log the raw/decoded IR data it captured.
  4. Compare the decoded output against the known Gree variants supported by ESPHome and pick the closest match:
    • generic
    • yan
    • yaa
    • yac
    • yac1fb9
    • yx1ff
    • yag
  5. Update model: in gree-ir-blaster.yaml to the matching variant, then redeploy (./deploy.sh) and verify the AC responds correctly to commands sent from Home Assistant (power, mode, temperature, fan speed).

If none of the variants behave correctly, capture the raw IR dumps and check the ESPHome gree component issue tracker / docs for newer variants.