Open source Gree wifi module replacement

Ok I finally had some time to mess around with this again. I had actually ordered both an ESP01 as an ESP32 to test it with. But since I had just flashed an ESP01 with the Midea firmware (for another AC) I thought I’d try it again with an ESP01 and it worked! Well 99% :slight_smile: It does communicate with the AC but among correct packets I saw a fan mode error. Will look into that, doesn’t seem to be a biggy. But I can change temperature, turn it on/off etc, so seems to work mostly fine! I do find that it occassionally doesn’t seem to process a settings change, something that the author of all this also saw, but will need to look into that.

How I did it: I bought this:
https://nl.aliexpress.com/item/1005008528226032.html
So that’s both an ESP01 and the ‘adaptor’ board for 3.3V ↔ 5V conversion (since the ESP01 uses 3.3V and the AC uses 5V). Then I created a new project in the HA Esphome builder based on ESP01. Then I modded the below YAML with the keys and passwords from the default generated yaml:

substitutions:
  node_name: gree # Use a unique name.
  node_id: Gree_ac    # Use a unique id.
  friendly_node_name: "Gree AC"
  deviceid: gree
  devicename: AC Bedroom

esphome:
  name: gree
  friendly_name: "Gree AC"

esp8266:
  board: esp01_1m

# Enable Home Assistant API
api:
  encryption:
    key: [insert yours here]

ota:
  - platform: esphome
    password: [insert yours here]

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Gree Fallback Hotspot"
    password: [insert yours here]

captive_portal:

# Enable logging
logger:
  baud_rate: 0 # disable LOG output on UART as UART is used for Sinclair AC unit
  #level: VERBOSE

uart:
  tx_pin: 1
  rx_pin: 3
  baud_rate: 4800
  parity: EVEN

time:
  - platform: sntp

external_components:
  - source: github://piotrva/esphome_gree_ac
    components: [sinclair_ac]
    refresh: 0s

climate:
  - platform: sinclair_ac
    name: ${devicename}
    horizontal_swing_select:
      name: ${devicename} Horizontal Swing Mode
    vertical_swing_select:
      name: ${devicename} Vertical Swing Mode
    display_select:
      name: ${devicename} Display Mode
    display_unit_select:
      name: ${devicename} Display Unit
    plasma_switch:
      name: ${devicename} Plasma
    sleep_switch:
      name: ${devicename} Sleep
    xfan_switch:
      name: ${devicename} X-fan
    save_switch:
      name: ${devicename} Save/8 Heat  
    

I could then have it compiled and download the compiled binary.
Then I flashed the binary with an serial adaptor, I used this one: Amazon.com: IZOKEE CP2102 Module USB to TTL 5PIN Serial Converter Adapter Module Downloader for UART STC 3.3V and 5V with Jumper Wires : Electronics
But I guess most (all?) models will work fine.

And then connected it directly to the ESP01 (so without the adaptor board) since both use 3.3V:

I used the “esphome flasher” to flash it:Releases · esphome/esphome-flasher · GitHub

And then I could see the device online in the esphome builder and could add it to HA via the esphome integration.