ESPhome IR Blaster example

Any code for Epson 3020 projector?

This thread at the avsforum may offer some insight.

Hi Fred,
I would like the ir receiver to receive command from remote controller and then forward it to the remote transmitter.
I use the following and it created a loop as the transmitter just send data and remote receiver receive and send back again.

remote_receiver:
  id: ir_receiver
  pin:
    number: D5 # GPIO14
    allow_other_uses: True
    inverted: True
    mode: OUTPUT_OPEN_DRAIN    
  dump:
    - lg
    - raw
  tolerance: 45%  
  on_lg:
    then:     
    - remote_transmitter.transmit_lg:
        data: !lambda |-
        id(is_forwarded)=1;
        uint32_t data = 0;
        if (x.containsKey("data"))
          data = x["data"];
        return data;
        
        nbits: !lambda |-
        id(is_forwarded)=1;
        uint8_t nbits = 32;
        if (x.containsKey("nbits"))
          nbits = x["nbits"];
        return nbits;        
    - logger.log:  "Forward the LG code to IR transmitter."
      
remote_transmitter:
  carrier_duty_percent: 100%
  id: ir_transmitter
  pin:
    number: D5
    allow_other_uses: True
    inverted: true
    mode: OUTPUT_OPEN_DRAIN

How can I solve this problem. My case is: I want the climate entity to update the temperature shown on HA in both case: (1) using HA to control and (2) using remote controller to control the LG AC. I could controll the AC from HA already but it does not update the value on climate entity shown on dashboard if command is send from the remote controller. I planned to use a global variable (is_forwarded) to check then stop sending if is_forwarded is true! But I could not manage to do so!
Thanks for your attention
Best,

Hello, trying to solve the same issue (but with AUX climate), have you succeeded finally? My case is even worse as AUX is not supported natively and i used heatpumpir platform to send signals to climate:

climate:
  - platform: heatpumpir
    name: "AUX"
    id: birusa_climate
    protocol: aux
    min_temperature: 16
    max_temperature: 32
    vertical_default: down
    horizontal_default: auto
    visual:
      min_temperature: 16 °C
      max_temperature: 32 °C
      temperature_step: 1.0 °C        

But in order to forward information from traditional remote, I’m afraid I need to parse RAW data from receiver :frowning:

hey can you please help me with a better diagram as to what pins connect where?

A friend of mine told me that he just solved with this on climatic component
header_high: 3265us
header_low: 9856us

Check more here, he follow this :IR Transmitter, not quite (hack) · esphome/esphome · Discussion #2078 · GitHub

Hallo, ich versuche, das gleiche Problem zu lösen (aber mit AUX-Klima)

Hello @CarManBelarus,

I know this post is a bit old, but I hope the air conditioners are still around. Now, there’s a way to replace the Broadlink with an ESP, which is written using ESP Home. Here, I’ve described my approach with an ESP32 NodeMCU:

AUX

MfG Joscha

Services was renamed to Actions in 2024.8

This is almost working, but it cannot consume a very long RAW command.
The command with more than 300 raw codes killing it.

api:
  encryption:
    key: !secret api_key
  services:
    - service: send_ir
      variables:
        protocol: string
        code: string
      then:
        - lambda: 'ESP_LOGD("main", "Protocol: %s",  protocol.c_str() ); '
        - if:
            condition: # --=[ *** RAW *** ]=--
              lambda: 'return protocol == "RAW";'
            then:
              - logger.log: "Sending RAW data...!"
              - remote_transmitter.transmit_raw:
                  carrier_frequency: 38kHz
                  code: !lambda |-
                    std::string fullcode = code;
                    std::vector<int> rawcodes;
                    char * token;
                    char seps[] = ",";
                    token = strtok (&fullcode[0],seps);
                    while (token != NULL)
                    {
                      rawcodes.push_back(std::stoi(token));
                      token = strtok (NULL, seps);
                    }
                    ESP_LOGD("Athom IR", "rawcode count %d", rawcodes.size());
                    std::string csv;
                    for (int num : rawcodes) {
                      csv += std::to_string(num) + " ";    
                    }
                    ESP_LOGD("Athom IR", "rawcodes: %s", csv.c_str());
                    return rawcodes;