IR Transmitter Not Working on ESP8266

I am trying to transmit IR codes to my AC unit and I have gotten it working with the Arduino IDE, but I want to control it with ESPHome. I have used the NEC codes with my Arduino sketch so I know they work, but it seems like my ESPHome yaml is wrong somehow.
Either the IR led doesn’t come on when I press the button or it stays on and never turns off. Even if it does turn on, it doesn’t transmit the right code.

Here is my YAML:

esphome:
  name: swamp_cooler
  platform: ESP8266
  board: nodemcuv2

wifi:
  ssid: "****"
  password: "****"

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Swamp Cooler Fallback Hotspot"
    password: "UdV2YD5YhWMv"

captive_portal:

# Enable logging
logger:

# Enable Home Assistant API
api:

ota:
remote_receiver:
  pin: D5
  dump: all

remote_transmitter:
  pin: D6
  carrier_duty_percent: 50%

switch:
  - platform: template
    name: "Cooler - Power Toggle"
    turn_on_action:
      remote_transmitter.transmit_nec:
        address: 0x003F
        command: 0x21DE
  - platform: template
    name: "Cooler - Power Toggle RAW"
    turn_on_action:
      remote_transmitter.transmit_raw:
        code: [9100, -4424, 622, -502, 622, -502, 622, -504, 620, -504, 620, -504, 622, -502, 622, -504, 620, -504, 620, -504, 622, -502, 644, -1594, 620, -1618, 622, -1618, 636, -1602, 620, -1618, 620, -1620, 620, -504, 622, -500, 622, -1618, 620, -504, 622, -504, 620, -504, 622, -502, 620, -1618, 620, -1618, 620, -1620, 620, -502, 620, -1618, 622, -1618, 620, -1618, 620, -1620, 620, -490, 622]

Hi, do you get anything in the logs? Which IR transmitter are you using?

Check this post. The main problem most people have is that the IR signal is not strong enough to reach the device you want to control.

I found out what was wrong. It seems like the ground that I was using on the nodeMCU was bad. When I switched to a different ground pin the whole setup worked! Thanks for the help though!

1 Like