Request: will any user successfully using ESPhome as a remote IR transmitter please post their yaml

Hi @khalilio, I had the same problem with limited range. My solution may not work for you, but maybe.

It seems that the range is limited by the LEDs themselves, so what I did was move the LEDs closer to the device I wanted to control. In my case, it was a ceiling fan unit. So I had the Wemos D1 Mini inside my light switch gang box at the wall, and then I ran a cable from there up into the ceiling, to a point closer to the fan.

That is where I installed the LEDs, in a little 3D-printed enclosure so they still looked ok. It works well.

So the circuit is the same as ever, but the LEDs are connected to it by a long cable (about 2m, I guess). Over such a short distance, the power loss is negligible, at least for my purpose.

I had the advantage that the room I was installing this in was drywall, so it was easy to snake the cable where I needed it. I have had to do something similar in a brick wall in the past, and it was trickier. To reach the ceiling, it was necessary to cut a channel into the brick wall with an angle grinder with a diamond blade, install the cable, plaster over the channel, and then repaint.

Thanks @DeeBeeKay. My setup is very similar to yours, having the MCU inside a light switch box; but the closest outlet where I can route the transmitter in my case is about 4 meters away.
Initially I thought there was something wrong with my codes; but I used arduino sketch on an ESP8266 module, which receives an IR signal and re-transmit it. When I stood halfway between my ESP32 transmitter and My AC unit, I was able to control the AC without any issues.
I found some powerful IR transmitters on AliExpress, but I don’t know if they would work. I’ll probably give it a shot.

1W 350MA High Power Infrared Ray IR Remote Control Launch Module

Hi all,

I have bought a 5v IR RX TX YS-IRTM board. Powered 5v and tx rx… to my d1 mini esphome… no matter what I try I get it working… flipping tx rx, config options etc… I had it working with a separate ir tx and rx led but ir was not powerful…

This is my config:

esphome:
  name: irtxrxr
  platform: ESP8266
  board: d1_mini

remote_receiver:
  pin: 
    number: D4
    inverted: True
    mode: INPUT_PULLUP

remote_transmitter:
  pin: D2
  # Infrared remotes use a 50% carrier signal
  carrier_duty_percent: 50%
  
switch:
  - platform: template
    name: TheFrame Off (IR)
    turn_on_action:
     - remote_transmitter.transmit_raw:
         code: [-4426, 4574, -514, 1759, -512, 1759, -514, 1757, -514, 630, -514, 631, -512, 632, -511, 632, -542, 602, -512, 1760, -512, 1761, -511, 1760, -512, 632, -512, 634, -511, 634, -539, 604, -510, 635, -538, 604, -541, 1731, -512, 1760, -511, 633, -512, 634, -510, 1760, -512, 1761, -511, 1761, -511, 1761, -539, 604, -512, 633, -540, 1732, -538, 1734, -511, 632, -512, 633, -511, 632, -512, 632, -4455, 4547, -511, 1761, -510, 1762, -541, 1731, -538, 605, -512, 633, -511, 632, -512, 633, -511, 661, -513, 1732, -510, 1762, -511, 1761, -510, 634, -539, 604, -518, 627, -510, 633, -541, 602, -541, 604, -541, 1732, -511, 1760, -540, 605, -510, 634, -541, 1730, -513, 1759, -512, 1761, -511, 1761, -540, 603, -512, 633, -511, 1761, -511, 1760, -512, 634, -510, 633, -538, 607, -540]
  - platform: template
    name: "Samsung TV Power"
    icon: mdi:remote
    turn_on_action:
      remote_transmitter.transmit_samsung:
        data: 0xE0E040BF
  - platform: template
    name: "Samsung TV Power 2"
    icon: mdi:remote
    turn_on_action:
      remote_transmitter.transmit_samsung:
        data: 0xE0E019E6

Picture of board

Anyone have this remote setup, can I see images how the ir diodes are hook up to the esp32?

I have the same board lying. If you get it to work, please post your config.

@DeeBeeKay
Hello. So I setup an esp32 remote. When I try to learn a code, I see all these in the log. I know I am suppose to join the 028 line and 041 lines together, but which set. I have a few. I also tried a few, but it doesn’t work. Trying to turn on an AC. Help.

log:

[14:54:10][D][remote.raw:028]: Received Raw: 3546, -1623, 539, -1175, 539, -1176, 537, -361, 510, -360, 510, -360, 509, -1176, 539, -361, 509, -361, 510, -1174, 540, -1173, 540, -360, 509, -1176, 539, -360, 508, -362, 509, -1176, 539, -1175, 539, -360, 510, -1176, 537, -1177, 538, 
[14:54:11][D][remote.raw:028]:   -361, 510, -360, 510, -1176, 538, -360, 510, -361, 510, -1174, 540, -360, 510, -360, 510, -361, 509, -360, 511, -360, 509, -361, 511, -359, 509, -361, 510, -361, 510, -360, 509, -361, 511, -359, 511, -359, 510, -361, 508, -362, 509, -8937, 3547, -1622, 
[14:54:11][D][remote.raw:028]:   539, -1175, 540, -1174, 540, -359, 512, -359, 510, -361, 510, -1174, 540, -360, 510, -359, 511, -1175, 539, -1176, 539, -359, 511, -1174, 539, -360, 511, -360, 510, -1175, 541, -1174, 538, -360, 511, -1174, 538, -1178, 538, -359, 511, -359, 511, -1174, 
[14:54:11][D][remote.raw:028]:   538, -362, 510, -360, 510, -1175, 539, -360, 511, -359, 511, -359, 511, -359, 510, -360, 511, -360, 510, -360, 511, -359, 511, -360, 509, -361, 511, -359, 510, -360, 510, -360, 511, -360, 511, -359, 511, -359, 511, -359, 510, -360, 511, -360, 510, 
[14:54:11][D][remote.raw:028]:   -360, 511, -1174, 541, -359, 510, -359, 511, -360, 511, -359, 511, -359, 510, -1176, 539, -1174, 539, -360, 509, -1175, 539, -360, 511, -1176, 538, -1176, 540, -359, 510, -1174, 539, -360, 511, -360, 511, -359, 509, -362, 509, -360, 511, -360, 511, 
[14:54:11][D][remote.raw:028]:   -1173, 540, -360, 510, -361, 509, -361, 510, -360, 510, -360, 510, -360, 510, -360, 510, -361, 510, -360, 509, -361, 511, -360, 509, -361, 509, -361, 510, -1176, 538, -361, 510, -360, 509, -1178, 536, -1176, 540, -360, 510, -1175, 538, -361, 509, -361, 
[14:54:11][D][remote.raw:028]:   510, -360, 509, -361, 509, -362, 508, -362, 509, -361, 508, -362, 509, -361, 508, -362, 508, -362, 509, -361, 509, -362, 509, -361, 508, -363, 507, -362, 508, -363, 508, -361, 509, -362, 509, -361, 508, -361, 509, -362, 508, -362, 509, -361, 508, -362, 
[14:54:11][D][remote.raw:028]:   510, -360, 509, -362, 508, -362, 507, -363, 507, -1179, 536, -362, 507, -363, 508, -363, 508, -1177, 537, -1176, 537, -1178, 537, -361, 509, -362, 507, -363, 508, -362, 507, -364, 506, -364, 507, -362, 507, -365, 506, -363, 506, -364, 507, -363, 508, 
[14:54:11][D][remote.raw:041]:   -363, 507, -363, 507, -364, 506, -364, 506, -1180, 535, -1179, 536, -362, 506, -365, 506, -364, 507, -363, 506
[14:54:11][D][remote.raw:028]: Received Raw: 3544, -1622, 540, -1175, 540, -1175, 538, -361, 510, -360, 509, -361, 511, -1175, 537, -362, 510, -360, 509, -1176, 536, -1175, 542, -361, 508, -914, 801, -361, 509, -360, 511, -1175, 539, -1175, 538, -361, 510, -1174, 539, -1176, 538, 
[14:54:11][D][remote.raw:028]:   -361, 510, -360, 509, -1178, 536, -362, 509, -361, 509, -1176, 537, -362, 509, -361, 510, -360, 511, -359, 511, -360, 511, -359, 509, -328, 543, -361, 509, -361, 509, -361, 507, -362, 510, -361, 509, -361, 510, -360, 511, -359, 511, -360, 509, -361, 
[14:54:11][D][remote.raw:028]:   510, -360, 510, -360, 509, -361, 510, -361, 508, -361, 510, -1175, 539, -360, 510, -361, 510, -1174, 540, -360, 509, -361, 510, -361, 509, -361, 510, -361, 509, -361, 510, -361, 508, -361, 503, -367, 511, -360, 508, -362, 509, -361, 509, -361, 509, 
[14:54:11][D][remote.raw:028]:   -1177, 538, -1175, 538, -361, 510, -1174, 540, -1175, 629, -226, 553, -361, 510, -361, 508, -361, 510, -361, 508, -362, 508, -362, 510, -361, 507, -363, 508, -1178, 536, -1177, 538, -1176, 539, -360, 508, -362, 508, -1177, 537, -1176, 538, -362, 509, 
[14:54:11][D][remote.raw:028]:   -1177, 535, -363, 508, -363, 507, -363, 508, -362, 507, -363, 508, -362, 508, -362, 507, -364, 507, -362, 507, -364, 508, -362, 508, -362, 507, -363, 507, -363, 507, -363, 506, -365, 507, -363, 507, -363, 507, -363, 506, -365, 505, -365, 505, -365, 
[14:54:11][D][remote.raw:028]:   507, -363, 507, -363, 508, -363, 505, -365, 506, -364, 506, -364, 506, -363, 506, -365, 507, -363, 508, -363, 505, -365, 505, -365, 506, -365, 505, -364, 505, -365, 506, -364, 506, -364, 506, -364, 506, -365, 506, -365, 505, -365, 506, -364, 505, -365, 
[14:54:11][D][remote.raw:041]:   506, -365, 505, -365, 504, -366, 506, -364, 503, -1183, 533, -366, 503, -1181, 534, -1181, 535, -364, 504, -366, 505, -1182, 532, -1181, 532

This is part of my config file:

# Remote Control
remote_receiver:
  pin: 
    number: GPIO15
    inverted: True
    mode: INPUT_PULLUP
  dump: raw

remote_transmitter:
  pin: GPIO2
  carrier_duty_percent: 50%

switch:
  - platform: template
    name: 'AC Shion On'
    id: ac_sr_on
    turn_on_action:
      - remote_transmitter.transmit_raw:
          code: [510, -360, 509, -362, 508, -362, 507, -363, 507, -1179, 536, -362, 507, -363, 508, -363, 508, -1177, 537, -1176, 537, -1178, 537, -361, 509, -362, 507, -363, 508, -362, 507, -364, 506, -364, 507, -362, 507, -365, 506, -363, 506, -364, 507, -363, 508, -363, 507, -363, 507, -364, 506, -364, 506, -1180, 535, -1179, 536, -362, 506, -365, 506, -364, 507, -363, 506]
          carrier_frequency: 38kHz
  - platform: template
    name: 'AC Shion Off'
    id: ac_sr_off
    turn_on_action:
      - remote_transmitter.transmit_raw:
          code: [-466, 395, -1328, 369, -494, 368, -494, 369, -491, 372, -491, 370, -493, 369, -492, 369, -492, 369, -493, 369, -491, 370, -492, 371, -497, 369, -487, 370, -492, 394, -467, 369, -521, 368, -470, 394, -464, 397, -465, 396, -466, 369, -492, 369, -492, 368, -496, 368, -492, 369, -493, 368, -499, 368, -487, 370, -494, 368, -1355, 393, -468, 369, -1353, 396, -468, 368, -494, 369, -1353, 369]
          carrier_frequency: 38kHz


Ok. I got it working. Took some trial and error, but I figure out what worked for my IR device (split system HVAC).
When you are learning the IR codes, point the remote control directly to the ESP IR receiver LED only. Don’t point it to the actual device that you want it to control while learning. I find out that the raw codes isn’t correct and mostly will not work. I connected my IR LEDs to 5v on the ESP32.

Hardware used:
ESP32 NodeMCU
IR Receiver Sensor Module Kit Set

ESP Config:

# ESP32 NodeMCU
esphome:
  name: bed_sensor
  platform: ESP32
  board: nodemcu-32s

wifi:
  ssid: 'rice_dwarf'
  password: !secret ssid_pass
  ap:
    ssid: covid-19
    password: ''
# Fallback portal 
captive_portal:
# Logging
logger:
# Uncomment this if you use Home Assistant
#api:
#  password: ''

status_led:
  pin: GPIO2

mqtt:
  broker: 192.168.1.20
  username: !secret mqtt_user
  password: !secret mqtt_pass

ota:
  password: !secret ota_pass

# Remote Control
remote_receiver:
  pin: 
    number: GPIO15
    inverted: True
    mode: INPUT_PULLUP
  dump: raw

remote_transmitter:
  pin: GPIO2
  carrier_duty_percent: 50%

switch:
  - platform: template
    name: 'AC SR On'
    turn_on_action:
      - remote_transmitter.transmit_raw:
          code: [3493, -1675, 489, -1227, 487, -1227, 487, -410, 460, -411, 457, -413, 457, -1229, 484, -414, 457, -413, 460, -1226, 489, -1223, 488, -413, 456, -1231, 485, -411, 463, -408, 455, -1230, 484, -1232, 483, -414, 457, -1229, 486, -1227, 488, -413, 428, -441, 460, -1225, 487, -412, 456, -414, 457, -1230, 490, -408, 457, -413, 460, -410, 459, -411, 457, -414, 460, -410, 459, -412, 460, -409, 459, -412, 456, -414, 460, -410, 459, -412, 460, -410, 458, -412, 456, -414, 459, -8987, 3496, -1673, 485, -1228, 488, -1226, 488, -412, 457, -413, 460, -410, 430, -1256, 487, -410, 457, -414, 456, -1230, 488, -1226, 488, -410, 459, -1226, 486, -414, 457, -413, 457, -1228, 488, -1227, 484, -414, 459, -1226, 489, -1228, 486, -411, 456, -414, 457, -1228, 490, -409, 460, -410, 458, -1227, 490, -410, 458, -412, 457, -414, 460, -409, 460, -410, 460, -410, 457, -413, 458, -412, 460, -410, 461, -409, 461, -410, 457, -413, 456, -414, 457, -413, 457, -413, 458, -413, 459, -412, 457, -413, 455, -414, 459, -412, 458, -1227, 487, -412, 460, -410, 429, -441, 458, -412, 456, -415, 458, -1227, 488, -1226, 486, -390, 480, -1228, 489, -410, 459, -411, 459, -412, 457, -413, 458, -1227, 487, -412, 457, -414, 460, -410, 458, -412, 459, -411, 459, -412, 459, -1229, 485, -411, 456, -414, 430, -441, 428, -442, 457, -413, 431, -439, 459, -411, 459, -412, 460, -411, 458, -387, 481, -413, 463, -408, 459, -411, 462, -408, 464, -406, 430, -441, 457, -413, 459, -411, 456, -415, 457, -1228, 489, -410, 458, -412, 461, -409, 459, -411, 458, -392, 480, -410, 460, -411, 458, -412, 460, -409, 459, -411, 459, -412, 458, -412, 459, -411, 431, -440, 428, -442, 459, -411, 456, -415, 456, -414, 457, -413, 459, -412, 458, -411, 455, -415, 462, -409, 458, -413, 456, -414, 454, -415, 460, -411, 457, -413, 460, -410, 459, -1227, 490, -408, 459, -411, 461, -410, 460, -1227, 457, -1258, 483, -1229, 459, -439, 456, -415, 456, -414, 458, -412, 457, -413, 458, -412, 458, -412, 458, -411, 460, -412, 463, -408, 460, -409, 461, -410, 457, -413, 456, -414, 464, -406, 461, -409, 460, -411, 460, -1226, 487, -1227, 487, -1226, 486, -1229, 486]
          carrier_frequency: 38kHz
  - platform: template
    name: 'AC SR Off'
    turn_on_action:
      - remote_transmitter.transmit_raw:
          code: [3540, -1627, 532, -1183, 535, -1179, 533, -340, 533, -335, 535, -336, 532, -1180, 537, -335, 535, -334, 537, -1178, 535, -1179, 536, -334, 534, -1182, 534, -363, 505, -336, 537, -1177, 536, -1179, 537, -335, 534, -1179, 534, -1181, 535, -332, 536, -335, 537, -1178, 534, -335, 534, -336, 537, -1178, 535, -364, 505, -337, 534, -334, 536, -338, 531, -337, 535, -335, 535, -336, 534, -339, 530, -337, 534, -338, 533, -336, 532, -338, 535, -337, 534, -338, 528, -343, 530, -8941, 3542, -1626, 536, -1177, 536, -1181, 532, -341, 530, -336, 537, -363, 507, -1176, 537, -334, 534, -338, 533, -1180, 536, -1180, 535, -335, 534, -1180, 533, -337, 535, -334, 537, -1176, 535, -1181, 536, -334, 537, -1177, 536, -1179, 537, -361, 506, -337, 533, -1180, 534, -365, 506, -337, 533, -1179, 536, -336, 535, -335, 534, -364, 507, -335, 529, -370, 507, -363, 505, -364, 509, -336, 532, -336, 534, -364, 507, -337, 532, -336, 534, -338, 534, -335, 534, -199, 669, -339, 533, -364, 507, -336, 535, -331, 537, -337, 536, -337, 531, -365, 506, -365, 507, -336, 531, -366, 506, -334, 536, -1179, 535, -1179, 537, -362, 508, -1178, 536, -336, 534, -1180, 532, -1182, 534, -337, 534, -1177, 537, -336, 534, -363, 505, -339, 531, -337, 536, -333, 535, -365, 506, -1180, 534, -338, 530, -337, 534, -366, 505, -336, 533, -366, 507, -335, 532, -368, 503, -336, 533, -338, 536, -336, 532, -335, 536, -365, 505, -341, 530, -1181, 533, -1181, 535, -1178, 534, -336, 534, -1182, 531, -1183, 532, -1182, 533, -338, 532, -336, 533, -366, 507, -336, 533, -338, 530, -342, 530, -337, 532, -341, 530, -339, 530, -341, 529, -341, 528, -339, 530, -370, 500, -341, 533, -365, 505, -337, 531, -342, 528, -339, 533, -339, 533, -338, 530, -340, 531, -340, 529, -339, 531, -339, 530, -341, 525, -345, 524, -347, 530, -339, 526, -373, 501, -1183, 531, -342, 527, -345, 524, -344, 529, -1183, 532, -1183, 526, -1188, 529, -340, 528, -344, 529, -369, 500, -344, 521, -349, 525, -345, 524, -346, 527, -344, 527, -345, 524, -344, 523, -347, 523, -349, 519, -350, 527, -343, 524, -1187, 529, -343, 525, -1188, 499, -373, 521, -348, 524, -348, 497, -374, 496]
          carrier_frequency: 38kHz

To answer my other post regarding what raw codes to use in the log, grab the first set of codes and concatenate them between [ ].
So grab all the [remote.raw:028] lines up and including the [remote.raw:041]. It’s ok some codes will be longer than others. I have a few of those.

1 Like

Ok. I got past the first hurdle. I am looking at another issue as I am figuring out my automation. The frontend UI shows it as a toggle. That is when I turn it on, it switches to ‘on’ momentary and back to the ‘off’ state, but the AC unit is on. How do I set it as an on/off switch?

Found the Fix:
I found the fix at this post

Need to add these 2 lines under swtich:

    optimistic: True
    assumed_state: True

Duplicated your turn_on_action code with a turn_off_action` code underneath it.

1 Like

Just seen this thread. Here’s my reliably functioning yaml:

substitutions:
  device_name: ir_blaster
  friendly_name: "IR Blaster"

esphome:
  name: ${device_name}
  platform: ESP8266
  board: nodemcuv2

wifi:
  ssid: "SSID"
  password: !secret wifi_password
  fast_connect: on

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "IR Blaster AP"
    password: !secret ap_password

captive_portal:

# Enable logging
logger:

# Enable Home Assistant API
api:
  password: !secret api_password
  services:
    - service: send_raw_command # service name (device name will be used as prefix)
      variables: # list of service params
        command: int[]
      then:
        - remote_transmitter.transmit_raw:
            carrier_frequency: 38kHz
            code: !lambda 'return command;' # use array from service param

ota:
  password: !secret ota_password

switch:
- platform: restart
  name: "${friendly_name} REBOOT"

remote_receiver:
  pin:
    number: GPIO14
    inverted: True
    mode: INPUT_PULLUP
  #dump: raw

remote_transmitter:
  pin: GPIO4
  carrier_duty_percent: 50%

…and and image of the blaster:

I used the circuit outlined here:

EDIT: Oh and I use them with SmartIR…

Hi guys, I also have a problem and I can’t figure out where I’m wrong.
My .yaml is:

esphome:
  name: covers
  platform: ESP8266
  board: nodemcuv2

wifi:
  ssid: "******"
  password: "*****"
  use_address: 192.168.50.177
  manual_ip:
    static_ip: 192.168.50.177
    gateway: 192.168.50.1
    subnet: 255.255.255.0

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

captive_portal:

# Enable logging
logger:

# Enable Home Assistant API
api:

ota:

mqtt:
  broker: '192.168.50.225'
  username: 'homeassistant'
  password: '*****'

remote_receiver:
  pin:
    number: D5
    inverted: true
  dump: raw
  tolerance: 50%
  filter: 250us
  idle: 4ms
  buffer_size: 2kb

remote_transmitter:
  - id: firstCover
    pin: D4
    carrier_duty_percent: 100%

And when i press on up button on the remote i receive:

[09:12:37][D][remote.raw:041]: Received Raw: 1413, -380, 695, -370, 699, -372, 701, -725, 348, -367, 705, -369, 703, -723, 351, -367
[09:12:37][D][remote.raw:028]: Received Raw: -724, 350, -717, 357, -713, 357, -361, 710, -739, 336, -796, 272, -400, 673, -719, 354, -355, 714, -359, 712, -361, 709, -717, 356, -359, 712, -360, 700, -3950, 346, -365, 707, -719, 357, -360, 711, -360, 712, -361, 709, -797, 280, -660, 
[09:12:37][D][remote.raw:041]:   406, -389, 682, -368, 704, -717
[09:12:37][D][remote.raw:041]: Received Raw: 
[09:12:37][D][remote.raw:041]: Received Raw: 1475, -360, 712, -415, 657, -627, 443, -725, 347, -362, 709, -361, 709, -718, 355, -360, 711, -717, 357, -360, 711, -361, 313
[09:12:37][D][remote.raw:041]: Received Raw: 358, -358, 712, -717, 356, -715, 358, -357, 716, -711, 361, -384, 685, -440, 632, -370, 703, -716, 358, -358, 714, -362, 710, -362, 709, -361, 711, -361, 711
[09:12:37][D][remote.raw:041]: Received Raw: 708, -367, 703, -721, 356, -360, 710, -362, 710, -364, 707, -1061
[09:12:37][D][remote.raw:041]: Received Raw: 
[09:12:37][D][remote.raw:041]: Received Raw: 1470, -362, 710, -363, 709, -362, 710, -719, 354, -362, 710, -417, 655, -729, 344, -365, 709, -718, 355, -361, 710, -362, 710, -718, 355, -717, 355, -717
[09:12:37][D][remote.raw:041]: Received Raw: -359, 713, -713, 360, -356, 714, -358, 712, -361, 712, -738, 337, -602, 470, -368, 705, -368, 703, -364, 710, -362, 707, -720, 354, -363, 710, -718, 356, -361
[09:12:37][D][remote.raw:041]: Received Raw: -368, 705, -364, 708, -719
[09:12:37][D][remote.raw:041]: Received Raw: 
[09:12:37][D][remote.raw:041]: Received Raw: 707, -720, 355, -361, 711, -362, 710, -718, 355, -360, 712, -737, 336, -393, 678, -371, 702, -717, 356, -716, 358, -714, 360, -713, 359, -358, 714, -716, 356
[09:12:37][D][remote.raw:041]: Received Raw: 711, -365, 710, -714, 359, -359, 715, -358, 712, -386, 688, -417, 658, -394, 677, -719, 354, -360, 711, -716, 358, -359, 711, -362, 711, -362, 708, -720
[09:12:37][D][remote.raw:041]: Received Raw: 
[09:12:37][D][remote.raw:028]: Received Raw: 1473, -363, 709, -366, 379, -3912, 707, -722, 353, -361, 713, -717, 356, -361, 711, -362, 712, -752, 321, -743, 333, -723, 350, -713, 362, -356, 716, -713, 360, -713, 362, -354, 718, -712, 366, -353, 3592, -702, 711, -361, 712, -361, 712, 
[09:12:37][D][remote.raw:041]:   -361, 711, -363, 713, -803, 270, -382, 687, -738, 338, -363, 711, -358, 713, -365, 707, -719, 355, -361, 711, -362, 710, -363, 674
[09:12:37][D][remote.raw:041]: Received Raw: 1467, -360, 710, -363, 707, -365, 711, -720, 354, -359, 602
[09:12:37][D][remote.raw:041]: Received Raw: 354, -363, 708, -362, 711, -717, 356, -715, 358, -713, 360, -729, 343, -374, 699, -715, 358, -710, 367, -349, 717, -711, 361, -356, 716, -356, 715, -358, 712
[09:12:37][D][remote.raw:041]: Received Raw: 710, -363, 707, -718, 356, -360, 712, -718, 356, -360, 712, -392, 680, -488, 585, -726, 347, -358, 714, -360, 711, -362, 711, -717, 2717
[09:12:37][D][remote.raw:028]: Received Raw: 1474, -378, 694, -371, 700, -363, 707, -719, 353, -362, 709, -364, 708, -719, 354, -361, 710, -3936, 352, -719, 354, -716, 358, -714, 359, -356, 717, -713, 359, -745, 328, -374, 696, -714, 359, -358, 713, -356, 713, -362, 709, -716, 356, 
[09:12:37][D][remote.raw:041]:   -360, 711, -363, 709, -362, 508
[09:12:37][D][remote.raw:041]: Received Raw: 352, -363, 711, -362, 711, -361, 711, -718, 355, -742, 332, -735, 336, -722, 352, -355
[09:12:37][D][remote.raw:041]: Received Raw: 
[09:12:37][D][remote.raw:041]: Received Raw: 1475, -360, 710, -362, 712, -416, 658, -735, 339, -360, 711, -361, 712, -715, 356, -360, 713, -717, 355, -360, 713, -361, 710
[09:12:37][D][remote.raw:041]: Received Raw: 714, -713, 362, -709, 363, -353, 717, -711, 360, -354, 717, -378, 693, -377, 692, -721, 353, -358, 714, -359, 711, -360, 712, -361, 709, -364, 710, -719, 353
[09:12:37][D][remote.raw:041]: Received Raw: 708, -718, 356, -716, 359, -713, 360, -713, 360, -373
[09:12:37][D][remote.raw:041]: Received Raw: 
[09:12:37][D][remote.raw:041]: Received Raw: 707, -364, 707, -365, 706, -723, 353, -362, 711, -463, 607, -898, 1249, -718, 355, -360, 713, -360, 712, -716, 357, -715, 360, -712, 359, -715
[09:12:37][D][remote.raw:041]: Received Raw: -715, 360, -356, 715, -358, 713, -361, 712, -716, 359, -397, 674, -480, 594, -365, 706, -361, 712, -362, 711, -717, 356, -361, 711, -717, 358, -360, 712, -3936, 1428, -715, 359, -355
[09:12:37][D][remote.raw:041]: Received Raw: 
[09:12:37][D][remote.raw:041]: Received Raw: 661
[09:12:37][D][remote.raw:041]: Received Raw: 355, -359, 712, -360, 712, -715, 358, -358, 714, -741, 333, -386, 686, -400, 672, -721, 352, -714, 359, -713, 360, -711, 362, -356, 716, -714, 358, -714, 251
[09:12:37][D][remote.raw:041]: Received Raw: 711, -715, 358, -358, 712, -361, 711, -364, 710, -432, 637, -482, 592, -725, 349, -371, 701, -715, 358, -358, 712, -361, 712, -360, 712, -717, 355
[09:12:37][D][remote.raw:041]: Received Raw: 2871
[09:12:37][D][remote.raw:041]: Received Raw: 1478, -358, 709, -363, 708, -362
[09:12:37][D][remote.raw:041]: Received Raw: -362, 711, -715, 357, -359, 712, -360, 711, -745, 326, -750, 323, -751, 321, -712, 359, -354, 717, -713, 358, -712, 360, -355, 716, -713, 360, -356, 714
[09:12:37][D][remote.raw:041]: Received Raw: 709, -362, 711, -360, 710, -362, 711, -715, 355, -391, 679, -897, 1250, -365, 706, -363, 708, -718, 356, -712, 359, -714, 359, -712, 359, -356, 513
[09:12:37][D][remote.raw:041]: Received Raw: 1472, -358, 712, -360, 711, -360, 711, -716, 356, -360, 710, -362, 464
[09:12:37][D][remote.raw:041]: Received Raw: 708, -715, 357, -714, 359, -712, 361, -711, 362, -374, 698, -750, 323, -712, 361, -356, 714, -711, 362, -355, 716, -357, 711, -360, 713, -716, 358, -360
[09:12:37][D][remote.raw:041]: Received Raw: -719, 353, -363, 712, -719, 358, -358, 714, -360, 711, -389, 686, -740, 335, -717, 356, -716, 359, -712, 359, -357, 3997

This raw is not working:
-724, 350, -717, 357, -713, 357, -361, 710, -739, 336, -796, 272, -400, 673, -719, 354, -355, 714, -359, 712, -361, 709, -717, 356, -359, 712, -360, 700, -3950, 346, -365, 707, -719, 357, -360, 711, -360, 712, -361, 709, -797, 280, -660, 406, -389, 682, -368, 704, -717

I try like this:

switch:
  - platform: template
    name: "Screen up"
    turn_on_action:
      remote_transmitter.transmit_raw:
        code: [-724, 350, -717, 357, -713, 357, -361, 710, -739, 336, -796, 272, -400, 673, -719, 354, -355, 714, -359, 712, -361, 709, -717, 356, -359, 712, -360, 700, -3950, 346, -365, 707, -719, 357, -360, 711, -360, 712, -361, 709, -797, 280, -660, 406, -389, 682, -368, 704, -717]

Thank you!

1 Like

I don’t know if it matters, try adding these other lines as well.

switch:
  - platform: template
    name: 'SOME NAME'
    optimistic: True
    assumed_state: True
    turn_on_action:
      - remote_transmitter.transmit_raw:
          code: [YOUR IR CODE]
          carrier_frequency: 38kHz

Thank you, but still not working.

switch:
  - platform: template
    name: "Cover Open"
    id: open_cover_switch
    optimistic: true
    assumed_state: True
    turn_on_action:
      - remote_transmitter.transmit_raw:
          code: [2121, -1714, 62, -54, 5684, -225, 78, -71, 51, -118, 4648, -68, 71, -561, 99, -113, 82, -189, 57, -125, 287, -70, 144, -74, 532, -136, 121, -9626, 1462, -364, 703, -869, 201, -1803, 337, -367, 700, -357, 711, -711, 357, -355, 714, -711, 358, -356, 712, -356, 347, -3209, 361, -706, 365, -350, 718, -707, 363, -706, 365, -350, 717, -707, 363, -511, 557, -602, 467, -376, 693, -711, 359, -351, 717, -352, 716, -354, 713, -355, 713, -356, 711, -2849, 141, -574, 712, -359, 712, -357, 711, -714, 356, -357, 710, -358, 710, -359, 709, -1495, 6914, -4762, 1477, -353, 715, -355, 714, -356, 710, -712, 359, -354, 713, -467, 604, -729, 340, -373, 696, -709, 361, -352, 716, -354, 714, -709, 361, -707, 362, -706, 362, -2845, 306, -762, 366, -348, 721, -705, 364, -349, 719, -351, 717, -354, 715, -1000, 71, -1007, 61, -369, 702, -365, 704, -352, 716, -353, 715, -709, 361, -352, 716, -709, 362, -353, 480, -3084, 356, -355, 716, -354, 713, -356, 712, -711, 7706, -4767, 198, -2695, 125, -942, 711, -713, 356, -356, 711, -358, 709, -713, 356, -357, 711, -790, 280, -917, 151, -360, 705, -709, 359, -704, 364, -704, 365, -702, 366, -348, 718, -703, 365, -701, 78, -2055, 84, -628, 188, -879, 718, -353, 714, -707, 362, -353, 714, -354, 713, -356, 711, -495, 572, -589, 479, -728, 342, -355, 712, -709, 361, -352, 715, -354, 712, -356, 711, -712, 357, -353, 85, -2052, 56, -1368, 7704, -4770, 1474, -353, 715, -355, 712, -355, 94, -2040, 56, -1012, 711, -711, 360, -355, 714, -711, 358, -356, 712, -356, 713, -2851, 359, -712, 357, -346, 721, -701, 368, -701, 369, -347, 721, -703, 366, -347, 706, -2857, 340, -375, 717, -353, 716, -353, 714, -356, 712, -356, 712, -712, 358, -780, 290, -955, 116, -365, 703, -361, 707, -353, 714, -708, 361, -353, 715, -354, 714, -355, 713, -709, 144, -3737, 3827, -4785, 1458, -355, 713, -356, 712, -357, 711, -712, 358, -356, 713, -357, 391, -3170, 359, -355, 716, -358, 711, -711, 359, -710, 359, -709, 362, -706, 364, -496, 574, -795, 276, -715, 356, -353, 716, -706, 364, -347, 721, -351, 717, -352, 715, -708, 363, -351, 150, -3059, 710, -361, 712, -713, 358, -356, 713, -712, 360, -355, 714, -357, 712, -473, 597, -732, 339, -378, 691, -360, 709, -356, 713, -714, 3638, -3930, 136, -4775, 1473, -456, 616, -500, 570, -376, 693, -713, 360, -353, 716, -354, 714, -711, 360, -355, 714, -711, 358, -2850, 279, -790, 364, -708, 364, -705, 365, -350, 719, -706, 364, -706, 365, -761, 309, -1018, 1124, -361, 707, -349, 720, -705, 366, -349, 719, -351, 718, -353, 717, -354, 472, -2738, 87, -71, 83, -1186, 364, -354, 716, -355, 715, -356, 714, -712, 359, -355, 715, -633, 438, -632, 438, -722, 7234, -5254, 1477, -356, 714, -358, 711, -358, 711, -804, 269, -717, 353, -370, 700, -712, 358, -353, 716, -709, 361, -353, 715, -355, 714, -711, 361, -708, 2253, -599, 271, -56, 67, -62, 106, -54, 53, -757, 365, -706, 366, -350, 718, -708, 366, -350, 718, -353, 717, -428, 642, -757, 315, -367, 704, -357, 713, -354, 715, -356, 714, -357, 713, -713, 359, -355, 712, -2498, 83, -988, 715, -714, 358, -711, 361, -710, 365, -705, 363, -351, 8065, -6606, 717, -357, 714, -356, 713, -713, 358, -356, 713, -357, 712, -988, 86, -1791, 353, -363, 706, -351, 718, -707, 363, -708, 364, -705, 366, -703, 368, -347, 480, -2730, 97, -1331, 365, -348, 720, -351, 719, -353, 717, -708, 364, -351, 717, -604, 467, -810, 262, -368, 702, -355, 715, -708, 363, -351, 718, -708, 364, -351, 717, -355, 714, -354, 172, -2322, 83, -987, 364, -706, 364, -349, 8069, -4769, 1474, -355, 172, -3389, 358, -358, 711, -358, 711, -713, 358, -357, 714, -713, 358, -356, 713, -470, 600, -798, 274, -723, 347, -707, 362, -704, 366, -350, 719, -706, 364, -703, 367, -350, 718, -2489, 94, -976, 715, -712, 362, -351, 716, -355, 714, -357, 712, -358, 712, -920, 151, -1463, 677, -713, 358, -352, 716, -354, 715, -355, 715, -709, 361, -708, 363, -705, 194, -3883, 157]
          carrier_frequency: 38kHz
  - platform: template
    name: "Cover Stop"
    id: stop_cover_switch
    optimistic: true
    assumed_state: True
    turn_on_action:
      - remote_transmitter.transmit_raw:
          code: [-66, 101, -448, 3425, -5895, 710, -367, 707, -363, 707, -722, 353, -364, 709, -362, 711, -940, 135, -682, 391, -752, 322, -361, 711, -357, 716, -712, 363, -710, 364, -708, 363, -709, 366, -349, 101, -2403, 175, -543, 722, -708, 368, -351, 718, -355, 720, -354, 718, -712, 364, -354, 719, -1529, 620, -374, 698, -357, 715, -711, 362, -355, 719, -711, 363, -354, 719, -710, 305, -2559, 127, -504, 1166, -353, 720, -709, 7739, -4790, 1329, -2656, 115, -74, 53, -1191, 361, -353, 718, -358, 716, -713, 362, -357, 716, -713, 362, -686, 390, -768, 305, -746, 331, -707, 366, -705, 370, -702, 371, -348, 725, -707, 368, -702, 371, -346, 186, -3036, 270, -81, 52, -289, 1106, -709, 365, -353, 719, -355, 718, -356, 718, -357, 717, -458, 613, -752, 324, -387, 687, -711, 365, -352, 719, -711, 365, -352, 721, -711, 363, -354, 719, -2856, 284, -824, 6637, -4788, 1485, -355, 717, -356, 716, -358, 709, -2505, 110, -1319, 360, -355, 719, -713, 361, -355, 716, -356, 716, -713, 361, -854, 219, -817, 257, -724, 349, -360, 713, -704, 369, -702, 369, -348, 724, -706, 366, -350, 722, -351, 356, -2145, 56, -662, 154, -919, 718, -357, 716, -357, 716, -358, 715, -714, 360, -357, 716, -857, 219, -600, 472, -730, 345, -353, 720, -708, 363, -351, 721, -709, 364, -352, 721, -710, 662, -3873, 3204, -4837, 1437, -355, 719, -352, 720, -354, 717, -714, 362, -354, 718, -356, 717, -2858, 212, -506, 720, -356, 718, -712, 362, -711, 364, -711, 365, -709, 367, -431, 644, -1794, 357, -352, 722, -702, 373, -346, 726, -348, 726, -350, 722, -709, 369, -350, 512, -2710, 110, -965, 719, -712, 363, -354, 720, -711, 363, -354, 718, -711, 365, -600, 474, -885, 193, -365, 709, -711, 363, -349, 723, -709, 4066, -8469, 1483, -577, 497, -821, 255, -374, 699, -714, 360, -351, 720, -354, 720, -711, 363, -354, 720, -710, 364, -351, 127, -2377, 140, -932, 366, -709, 366, -707, 366, -352, 722, -709, 367, -707, 368, -349, 724, -1610, 540, -364, 709, -351, 721, -708, 369, -348, 725, -351, 722, -353, 722, -356, 694, -2529, 119, -1313, 365, -355, 718, -713, 362, -355, 719, -711, 364, -355, 720, -812, 263, -1024, 8176, -5123, 1488, -356, 719, -356, 719, -354, 717, -864, 212, -947, 129, -362, 712, -711, 362, -351, 725, -705, 367, -351, 722, -353, 721, -709, 365, -706, 57, -2089, 59, -658, 238, -1194, 369, -707, 365, -349, 722, -709, 369, -348, 724, -351, 722, -420, 653, -755, 321, -368, 705, -354, 718, -353, 718, -355, 719, -356, 717, -714, 362, -354, 719, -2859, 290, -426, 721, -713, 362, -353, 719, -712, 364, -355, 717, -712]
          carrier_frequency: 38kHz
  - platform: template
    name: "Cover Close"
    id: close_cover_switch
    optimistic: true
    assumed_state: True
    turn_on_action:
      - remote_transmitter.transmit_raw:
          code: [-210, 507, -950, 4425, -3378, 54, -71, 58, -67, 61, -59, 9666, -378, 189, -222, 91, -195, 66, -7785, 51, -377, 54, -441, 706, -366, 705, -369, 701, -718, 354, -361, 709, -362, 708, -1537, 608, -747, 325, -372, 697, -359, 710, -712, 360, -710, 361, -707, 365, -705, 365, -349, 703, -2510, 122, -1304, 363, -352, 720, -353, 717, -353, 716, -708, 365, -350, 718, -809, 262, -1437, 701, -369, 700, -708, 363, -349, 720, -705, 365, -350, 718, -351, 718, -708, 122, -2729, 178, -380, 52, -68, 1109, -707, 7706, -4764, 1479, -351, 381, -3183, 360, -353, 715, -358, 713, -710, 360, -355, 716, -712, 358, -352, 717, -516, 554, -893, 179, -722, 350, -704, 365, -703, 367, -347, 723, -703, 370, -699, 370, -345, 722, -2484, 54, -1016, 714, -712, 362, -351, 718, -352, 716, -351, 715, -355, 714, -355, 713, -1695, 445, -720, 351, -353, 713, -354, 715, -706, 364, -703, 367, -347, 720, -349, 717, -3514, 52, -67, 58, -64, 5722, -4767, 1474, -352, 717, -352, 716, -356, 710, -709, 360, -2848, 298, -415, 714, -712, 359, -353, 716, -354, 714, -709, 361, -708, 361, -992, 80, -1458, 681, -703, 366, -701, 368, -345, 723, -699, 369, -345, 722, -349, 719, -350, 497, -2710, 119, -66, 52, -832, 715, -359, 709, -357, 712, -710, 359, -355, 713, -709, 361, -681, 388, -937, 134, -719, 350, -703, 365, -350, 716, -349, 720, -703, 366, -701, 1990, -3441, 54, -84, 62, -54, 54, -6837, 1368, -373, 693, -359, 711, -353, 713, -711, 361, -352, 717, -354, 714, -708, 361, -353, 216, -2993, 201, -242, 52, -87, 68, -774, 358, -709, 363, -705, 363, -705, 364, -349, 720, -919, 151, -1735, 403, -713, 356, -346, 721, -348, 718, -352, 716, -706, 366, -348, 719, -350, 718, -352, 68, -2070, 55, -72, 53, -1241, 362, -354, 715, -709, 362, -350, 717, -353, 716, -708, 362, -1552, 587, -448, 621, -717, 353, -703, 5627, -6851, 1476, -354, 713, -482, 587, -1799, 343, -382, 684, -354, 712, -709, 361, -353, 716, -708, 362, -351, 715, -354, 662, -2896, 362, -708, 362, -350, 719, -706, 363, -703, 365, -349, 718, -705, 364, -767, 301, -1437, 700, -706, 362, -348, 719, -349, 719, -350, 716, -350, 715, -354, 714, -708, 124, -2019, 53, -162, 54, -438, 166, -417, 58, -429, 714, -712, 358, -706, 362, -351, 715, -354, 713, -710, 360, -773, 7637, -4766, 1475, -355, 714, -354, 714, -356, 712, -709, 359, -354, 715, -563, 506, -775, 295, -381, 687, -709, 360, -351, 715, -354, 714, -708, 360, -707, 363, -704, 364, -705, 2243, -71, 53, -836, 365, -348, 718, -704, 363, -349, 720, -352, 714, -354, 715, -1509, 631, -558, 510, -374, 693, -353, 713, -356, 714, -707, 362, -352, 713, -711, 361, -351, 714, -2846, 276, -72, 1082, -353, 715, -708, 360, -707, 7711, -4768, 534, -2365, 104, -969, 708, -713, 357, -357, 712, -359, 711, -710, 358, -357, 711, -1012, 57, -1476, 665, -711, 357, -704, 364, -704, 367, -700, 368, -346, 722, -704, 365, -702, 192, -2660, 136, -78, 51, -804, 718, -353, 716, -708, 363, -351, 715, -355, 715, -354, 713, -747, 323, -1796, 342, -358, 708, -703, 365]
          carrier_frequency: 38kHz

This is the rest of my settings. Worth a try to mimic mine to see if it will work.

remote_receiver:
  pin: 
    number: GPIO15
    inverted: True
    mode: INPUT_PULLUP
  dump: raw

remote_transmitter:
  pin: GPIO2
  carrier_duty_percent: 50%

Still no luck for me …!
This is’t mai remote. Any ideeas?
WhatsApp Image 2020-11-17 at 15.08.35 (1)|375x500

Not sure what problem you are having, but your remote seems to be an RF remote (433MHz) while all the other posts in the thread are about Infra Red (IR) remotes.

This requires different configuration according to ESPHome docs, but I am not familiar with this type of remote so cannot really help there.

@cristianchiribes, at some post above glmnet was saying that the numbers in raw format represent time of the transmission (when positive) and the delay (no activity) when negative. Assuming this, the sequence of codes in raw format cannot start with negative number as the receiver cannot know when “pause” (no activity) starts…
This can indicate that your sequence is recorded “negative” and in order to fix it I would try to add inverted: false (opposite to what you have) to your pin definition for receiver. Then I would see how the raw codes looks and if the are starting with positive number. If so, then would try this code.

First major step in remote IR integration with HA is behind me with major success!
This topic helped me a Great Deal as after reading it I actually with very slight challenges made the concept working. I can now easily read any code from any of my remote (have more then 10) and play them successfully from ESP32 board!
Especially wanted to thank @DeeBeeKay @glmnet and @Holdestmade ! :slight_smile:

Next are the steps to integrate it more with HA and also consider to replace my Harmony universal remote (which is old and already some buttons do not work correctly) with some smartphone (or other device) based one the established platform.

Although ESPHome is really easy to set, can any of you try Tasmota IR for the similar purpose? Even if not all IR codes are recognized, it has the largest devices database of the DIY solutions.

@Rikels I like your idea very much. It helps to make the configuration clean and I do not have to compile&upload new code to esp32 each time i have new RC button to define.
Hoever I have trouble to call the service from your exmaple. I have defined the service as per your example:

 services:
   - service: pioneer
     variables:
       keycode: int[]
     then:
     - remote_transmitter.transmit_raw:
         code: !lambda 'return keycode;'
         carrier_frequency: 38kHz

It compiles OK but for some reason I cannot get right format of data to call the service.
Trying with developer tools:


and gettig the following error:

ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [2730016120] Error handling message: expected dict for dictionary value @ data['service_data']. Got [8556, -4204, 585, -1539, 582, -514, 562, -1561, 559, -512, 565, -505, 560, -1563, 558, -513, 563, -1560, 561, -510, 566, -1557, 564, -507, 558, -1565, 566, -1532, 589, -507, 558, -1565, 567, -504, 561, -510, 558, -1539, 590, -507, 559, -511, 565, -1532, 589, -507, 558, -513, 564, -506, 559, -1539, 582, -514, 562, -1561, 560, -1538, 593, -503, 562, -1561, 560, -1539, 592, -1533, 587]

Was trying with different combination of brackets and apostrphes (’ " ) - no luck :frowning:
I hope I am doing some simple/stupid error here…

Can you share example how do you call the service from your script (or other “place”) ?

keycode: [8556, -4204, ...]

1 Like