Help with IR Commands to a projector

Hello all,

I have been moving my custom Arduino code over to ESPHome. The project I am working on is controlling my holiday projectors through IR commands. In my Arduino sketch I used the following to send commands:

  irsend.sendNEC(0xFF15EA,32);  // power
  delay(14000);
  irsend.sendNEC(0xFF59A6,32);  // down
  delay(2000);
  irsend.sendNEC(0xFF7986,32);  // enter
  delay(2000);
  irsend.sendNEC(0xFF7986,32);  // enter
  delay(2000);
  irsend.sendNEC(0xFFC936,32); // play

Reading the ESPHome instructions for IR and research in the forums I created the following but unfortunately it is not working.

esphome:
  name: mb_closet_projector
  platform: ESP8266
  board: d1_mini
  on_boot:
    priority: -10
    # ...
    then:
      - switch.turn_off: annoyingled
wifi:
  ssid: "xxxx"
  password: "xxxxx"

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "xxxx"
    password: "xxxx"

captive_portal:

# Enable logging
logger:

# Enable Home Assistant API
api:

ota:

remote_transmitter:
  carrier_duty_percent: 100%
  pin:
    number: D2
    
switch:
  - platform: gpio
    pin: GPIO2
    name: ledstripwemosled
    inverted: true
    id: annoyingled
  - platform: template
    name: MB Closet Projector
    turn_on_action:    
      - remote_transmitter.transmit_lg:
          data: 0xFF15EA
          nbits: 32
      - delay:
          milliseconds: 14000
      - remote_transmitter.transmit_lg:
          data: 0xFF59A6
          nbits: 32
      - delay:
          milliseconds: 2000        
      - remote_transmitter.transmit_lg:
          data: 0xFF7986
          nbits: 32
      - delay:
          milliseconds: 2000 
      - remote_transmitter.transmit_lg:
          data: 0xFF7986
          nbits: 32
      - delay:
          milliseconds: 2000 
      - remote_transmitter.transmit_lg:
          data: 0xFFC936
          nbits: 32
    turn_off_action:
      - remote_transmitter.transmit_lg:
          data: 0xFF15EA
          nbits: 32

Try setting the carrier duty percent to 50%. And is your LED connected - to ground and + to GPIO? If so, try switching to + to 3.3V and - to GPIO, that did the trick for me. Atleast i believe that, its been a few months since that and ive packed it pretty good toghether, cant check it.

I will give the 50% a try. This all worked with Arduino code so not sure why this isn’t working now.

For ir send the correct carrier_duty_percent is 50%.

You can check with your smartphone camera if the ir-diode is actually transmitting or if you have the pin wrong.