Fully working Air Conditioner Controller (with receiver)

I was looking to build an ESPHome sensor that can sit beside my Air Conditioner unit and allow me to remotely control my AC. I also wanted the state of the AC on my Home Assistant instance to be in sync with the AC if someone used the remote control.

It could be me, but I did not find a comprehensive enough guide and it took me a full day to cobble things up. Hence posting my work here for others. Hope it is useful.

Sensors used

  1. DHT-22 for temperature and humidity
  2. KY-022 Infrared Sensor Receiver Module
  3. KY-005 38KHz Infrared Transmitter module

Board used: ESP32

For wiring, refer to the pin_* variables in the substitutions below.
To make this work with your variant of AC, refer to the link near the climate: section.

substitutions:
  name: climate-control-esph-1337
  friendly_name: Climate Control ESPH-1337
  pin_status_led: GPIO2
  pin_transmitter: GPIO4
  pin_receiver: GPIO12
  pin_dht: GPIO14

esphome:
  name: ${name}
  friendly_name: ${friendly_name}
  name_add_mac_suffix: false
  project:
    name: esphome.web
    version: '1.0'

esp32:
  board: esp32dev
  framework:
    type: arduino


logger: # Enable logging
api: # Enable Home Assistant API
ota: # Allow Over-The-Air updates
improv_serial: # Allow provisioning Wi-Fi via serial
wifi: # Enable WiFi

# -----------------------------------------------------------------

light:
  - platform: status_led
    id: builtin_led
    # name: "Status Light"
    pin: ${pin_status_led}

remote_transmitter:
  id: heatpump_remote_transmitter
  # name: "IR Transmitter"
  pin: ${pin_transmitter}
  carrier_duty_percent: 50%

remote_receiver:
  id: heatpump_remote_receiver
  # name: "IR Receiver"
  pin:
    number: ${pin_receiver}
    inverted: true
    mode:
      input: true
      pullup: true
  # high 55% tolerance is recommended for some remote control units
  tolerance: 55%
  filter: 10us
  idle: 25ms

sensor:
  - platform: dht
    pin: ${pin_dht}
    model: DHT22
    temperature:
      # name: "Temperature"
      id: heatpump_room_temperature
    humidity:
      # name: "Humidity"
      id: heatpump_room_humidity

# Refer the following for other platforms of ACs
# https://esphome.io/components/climate/climate_ir.html
climate:
  - platform: daikin
    name: "Daikin AC"
    id: my_daikin_ac
    transmitter_id: heatpump_remote_transmitter
    receiver_id: heatpump_remote_receiver
    sensor: heatpump_room_temperature
    visual:
      min_temperature: 18
      max_temperature: 32
      temperature_step:
        target_temperature: 1
        current_temperature: 0.1

1 Like

Something like this has been on my to-do list - so I greatly appreciate your write-up!

Next up I need to figure out if my AC is compatible with any of the existing supported ones.

1 Like

Might be slightly too late, but since your AC is a Daikin, you could have used this if you’ve got a supported model.

1 Like

Oh shoot! You’re right. This could have made me explore a completely different route if I had spotted this during initial research.

Thanks a tonne.

I still have 4 more units to automate and have a neat housing + power source for each. I may explore the S21 port of the units. Will keep posted.

1 Like

were u able to make this IR blaster working for Daikin AC? I am looking for the same.

My Daikin Comes with CN_wired , not with S21 port. thats y looking for IR solution now.

CN_Wired works with the Faikin Solution.