Request: will anyone that hasr successfully using ESPhome as a remote IR transmitter please help

I am having some issues with IR codes for the xfinity x1 remote. I am using a Harmony Remote that repeats the signal and I think that is what is causing the issue. I have tried several iterations, but this is the raw data that I am getting back. Notice that there is multiple - values together. How should I format this?

[12:30:21][D][remote.raw:041]: Received Raw: -147, 959, -145, 1770, -168, 803, -145, 2874, -144, 1353, -143, 1379, -145, 1220, -145, 2715, -145
[12:30:21][D][remote.raw:041]: Received Raw: -147, 957, -147, 2611, -141, 803, -142, 828, -145, 1089, -144, 828, -143, 800, -145, 827, -145
[12:30:21][D][remote.raw:041]: Received Raw: -147, 958, -145, 1771, -145, 830, -140, 2849, -143, 1379, -144, 1352, -144, 1220, -146, 2743, -144
[12:30:21][D][remote.raw:041]: Received Raw: -144, 956, -146, 1483, -167, 1905, -146, 802, -146, 1086, -145, 826, -145, 827, -144, 801, -167

Are those codes from a single button press?

Maybe you could try these codes (if it is the same).

Yeah it was one button press, but I have noticed the IR coming from the Harmony remote repeats. I am not sure how many times. I will look into the codes on that website for sure. Appreciate the post.

OK I unpaired my Xfinity XR15 remote so it would send IR signals to confirm that the Harmony remote codes are correct. I have it below in 2 formats. I have tried to use Pronto and when transmitted it doesn’t work. I have tried Raw, but ESPHome gives me an error because the numbers are not + and - all the way thru the code.

Pronto from IR reciever:

[10:11:24][D][remote.pronto:238]: Received Pronto: data=0000 006D 0009 0000 0006 0024 0006 0044 0006 001F 0006 006E 0006 0034 0006 0034 0006 002F 0006 0069 0006 06C3
[10:11:24][D][remote.pronto:238]: Received Pronto: data=0000 006D 0009 0000 0006 0024 0006 003F 0006 001F 0006 001F 0006 002A 0006 0044 0006 001F 0006 001F 0006 06C3
[10:11:24][D][remote.pronto:238]: Received Pronto: data=0000 006D 0009 0000 0006 0024 0006 0044 0006 001F 0006 006E 0006 0034 0006 0034 0006 002F 0006 0069 0006 06C3
[10:11:24][D][remote.pronto:238]: Received Pronto: data=0000 006D 0009 0000 0006 0024 0006 0069 0006 0049 0006 001F 0006 002A 0006 0044 0006 001F 0006 001F 0006 06C3

Raw Codes:

[10:24:22][D][remote.raw:041]: Received Raw: -142, 965, -141, 1786, -142, 827, -142, 2882, -141, 1377, -140, 1377, -140, 1239, -141, 2746, -141
[10:24:22][D][remote.raw:041]: Received Raw: -140, 965, -142, 1649, -141, 829, -141, 828, -140, 1102, -141, 1788, -140, 829, -141, 828, -140
[10:24:22][D][remote.raw:041]: Received Raw: -143, 965, -140, 1787, -141, 828, -141, 2883, -141, 1376, -141, 1376, -141, 1238, -142, 2745, -142
[10:24:22][D][remote.raw:041]: Received Raw: -142, 965, -141, 2747, -140, 1924, -141, 828, -141, 1102, -141, 1787, -141, 828, -141, 827, -142

Any ideas???

Here is how it looks in ESPHome:

remote_transmitter:
  pin: D2
  # Infrared remotes use a 50% carrier signal
  carrier_duty_percent: 50%

# Example configuration entry
remote_receiver:
  pin: D4
#  dump: all
  dump: raw

switch:
  - platform: gpio
    name: "${esphome_name}-Onboard-LED"
    pin: 0
    inverted: True
  - platform: restart
    name: ${esphome_name}-restart
    id: restart_switch
#buttonsrow1
  - platform: template
    name: "cable_menu"
    id: cable_menu
    turn_on_action:
#      - remote_transmitter.transmit_pronto:
#          data: "0000 006D 0009 0000 0007 0023 0007 0044 0006 001E 0006 006E 0006 0033 0006 0034 0006 002E 0006 0068 0006 06C3 0000 006D 0009 0000 0006 0023 0006 0064 0006 001E 0006 001F 0006 0029 0006 001F 0006 001E 0006 001F 0006 06C3 0000 006D 0009 0000 0006 0024 0006 0043 0006 001F 0006 006D 0006 0034 0006 0033 0006 002E 0007 0068 0006 06C3 0000 006D 0009 0000 0006 0024 0006 0039 0006 0048 0006 001F 0006 0029 0006 001E 0006 001F 0006 001F 0006 06C3"
      - remote_transmitter.transmit_raw:
          carrier_frequency: 38kHz
          code: [  -147, 959, -145, 1770, -168, 803, -145, 2874, -144, 1353, -143,
                   1379, -145, 1220, -145, 2715, -145, -147, 957, -147, 2611, -141, 
                   803, -142, 828, -145, 1089, -144, 828, -143, 800, -145, 827, -145,
                   -147, 957, -147, 2611, -141, 803, -142, 828, -145, 1089, -144, 828,
                   -143, 800, -145, 827, -145, -147, 958, -145, 1771, -145, 830, -140,
                   2849, -143, 1379, -144, 1352, -144, 1220, -146, 2743, -144, -144, 956,
                   -146, 1483, -167, 1905, -146, 802, -146, 1086, -145, 826, -145, 827,
                   -144, 801, -167]
          repeat:
            times: 3
  - platform: template
    name: "cable_page_up"
    id: cable_page_up
    turn_on_action:
      - remote_transmitter.transmit_raw:
          carrier_frequency: 38kHz
          code: [  -143, 962, -167, 1748, -141, 804, -170, 2847, -144, 1354, -168, 1353, -170, 1196, -168, 2694, -172, 932, -197, 1482, -108, 810, -171, 803, -171, 1061, -170, 1878, -168, 803, -171, 775, -169, 935, -170, 1746, -170, 801, -168, 2824, -165, 1358, -170, 1325, -170, 1222, -170, 2691, -168, 934, -169, 2561, -172, 1876, -164, 806, -171, 1064, -170, 1876, -141, 832, -168, 803]
  - platform: template
    name: "cable_info"
    id: cable_info
    turn_on_action:
      - remote_transmitter.transmit_raw:
          carrier_frequency: 38kHz
          code: [  -149, 957, -146, 1769, -148, 823, -147, 2846, -147, 1374, -148, 1349, -147, 1243, -148, 2713, -148, 955, -148, 1769, -147, 825, -146, 825, -146, 1086, -148, 1613, -145, 825, -147, 824, -149, 956, -147, 1769, -147, 797, -148, 2871, -148, 1348, -148, 1375, -147, 1216, -149, 2742, -148, 955, -148, 2845, -147, 1900, -147, 825, -146, 1087, -147, 1638, -147, 824, -147, 798]
 

From eyeballing the codes you’re learning, it looks to me like it’s sending “code 1, code 2, code 1, code 2”.

So potentially composite codes.

I would learn it several times (say 10) and cherry pick the most consistent to use as your masters.

You could try putting the codes and that pattern into an ESPHome button and playing with that.

Potentially even playing with very small delays between the signals.

Just ideas…

Good eye, I will try the raw code first because of the + to - values and break it up that way. The Pronto code doesn’t come thru very strong on my IR receiver on the home entertainment system.

1 Like

Ok here again are the codes I received from the Remote Receiver for the same command on the Xfinitiy Comcast XR15 Remote

Pronto:

[11:55:59][D][remote.pronto:229]: Received Pronto: data=0000 006D 0009 0000 0007 0023 0007 0044 0006 001E 0006 006E 0006 0033 0006 0034 0006 002E 0006 0068 0006 06C3
[11:55:59][D][remote.pronto:229]: Received Pronto: data=0000 006D 0009 0000 0006 0023 0006 0064 0006 001E 0006 001F 0006 0029 0006 001F 0006 001E 0006 001F 0006 06C3
[11:55:59][D][remote.pronto:229]: Received Pronto: data=0000 006D 0009 0000 0006 0024 0006 0043 0006 001F 0006 006D 0006 0034 0006 0033 0006 002E 0007 0068 0006 06C3
[11:55:59][D][remote.pronto:229]: Received Pronto: data=0000 006D 0009 0000 0006 0024 0006 0039 0006 0048 0006 001F 0006 0029 0006 001E 0006 001F 0006 001F 0006 06C3

Here is the same command in Raw format:

[12:30:21][D][remote.raw:041]: Received Raw: -147, 959, -145, 1770, -168, 803, -145, 2874, -144, 1353, -143, 1379, -145, 1220, -145, 2715, -145
[12:30:21][D][remote.raw:041]: Received Raw: -147, 957, -147, 2611, -141, 803, -142, 828, -145, 1089, -144, 828, -143, 800, -145, 827, -145
[12:30:21][D][remote.raw:041]: Received Raw: -147, 958, -145, 1771, -145, 830, -140, 2849, -143, 1379, -144, 1352, -144, 1220, -146, 2743, -144
[12:30:21][D][remote.raw:041]: Received Raw: -144, 956, -146, 1483, -167, 1905, -146, 802, -146, 1086, -145, 826, -145, 827, -144, 801, -167

I have created several ways to emulate this in ESP home with no success. Any ideas???

button:
  - platform: template
    name: "cable_menu_2"
    on_press:
      - remote_transmitter.transmit_raw:
          carrier_frequency: 38kHz
          code: [ -147, 959, -145, 1770, -168, 803, -145, 2874, -144, 1353, -143, 1379, -145, 1220, -145, 2715, -145 ]
      - remote_transmitter.transmit_raw:
          carrier_frequency: 38kHz
          code: [ -147, 957, -147, 2611, -141, 803, -142, 828, -145, 1089, -144, 828, -143, 800, -145, 827, -145 ]
      - remote_transmitter.transmit_raw:
          carrier_frequency: 38kHz
          code: [ -147, 958, -145, 1771, -145, 830, -140, 2849, -143, 1379, -144, 1352, -144, 1220, -146, 2743, -144 ]
      - remote_transmitter.transmit_raw:
          carrier_frequency: 38kHz
          code: [ -144, 956, -146, 1483, -167, 1905, -146, 802, -146, 1086, -145, 826, -145, 827, -144, 801, -167 ]

switch:
  - platform: gpio
    name: "${esphome_name}-Onboard-LED"
    pin: 0
    inverted: True
  - platform: restart
    name: ${esphome_name}-restart
    id: restart_switch
#buttonsrow1
  - platform: template
    name: "cable_menu_pronto"
    id: cable_menu_pronto
    turn_on_action:
      - remote_transmitter.transmit_pronto:
          data: "0000 006D 0009 0000 0007 0023 0007 0044 0006 001E 0006 006E 0006 0033 0006 0034 0006 002E 0006 0068 0006 06C3 0000 006D 0009 0000 0006 0023 0006 0064 0006 001E 0006 001F 0006 0029 0006 001F 0006 001E 0006 001F 0006 06C3 0000 006D 0009 0000 0006 0024 0006 0043 0006 001F 0006 006D 0006 0034 0006 0033 0006 002E 0007 0068 0006 06C3 0000 006D 0009 0000 0006 0024 0006 0039 0006 0048 0006 001F 0006 0029 0006 001E 0006 001F 0006 001F 0006 06C3"
  - platform: template
    name: "cable_menu_split"
    id: cable_menu_split
    turn_on_action:
      - remote_transmitter.transmit_raw:
          carrier_frequency: 38kHz
          code: [ -147, 959, -145, 1770, -168, 803, -145, 2874, -144, 1353, -143, 1379, -145, 1220, -145, 2715, -145 ]
      - remote_transmitter.transmit_raw:
          carrier_frequency: 38kHz
          code: [ -147, 957, -147, 2611, -141, 803, -142, 828, -145, 1089, -144, 828, -143, 800, -145, 827, -145 ]
      - remote_transmitter.transmit_raw:
          carrier_frequency: 38kHz
          code: [ -147, 958, -145, 1771, -145, 830, -140, 2849, -143, 1379, -144, 1352, -144, 1220, -146, 2743, -144 ]
      - remote_transmitter.transmit_raw:
          carrier_frequency: 38kHz
          code: [ -144, 956, -146, 1483, -167, 1905, -146, 802, -146, 1086, -145, 826, -145, 827, -144, 801, -167 ]
  - platform: template
    name: "cable_menu_zero"
    id: cable_menu_zero
    turn_on_action:
      - remote_transmitter.transmit_raw:
          carrier_frequency: 38kHz
          code: [ -147, 959, -145, 1770, -168, 803, -145, 2874, -144, 1353, -143, 1379, -145, 1220, -145, 2715, -145, 0,
                  -147, 957, -147, 2611, -141, 803, -142, 828, -145, 1089, -144, 828, -143, 800, -145, 827, -145 , 0,
                  -147, 958, -145, 1771, -145, 830, -140, 2849, -143, 1379, -144, 1352, -144, 1220, -146, 2743, -144, 0,
                  -144, 956, -146, 1483, -167, 1905, -146, 802, -146, 1086, -145, 826, -145, 827, -144, 801, -167 ]
          repeat:
            times: 2
  - platform: template
    name: "cable_menu_1000"
    id: cable_menu_1000
    turn_on_action:
      - remote_transmitter.transmit_raw:
          carrier_frequency: 38kHz
          code: [ -147, 959, -145, 1770, -168, 803, -145, 2874, -144, 1353, -143, 1379, -145, 1220, -145, 2715, -145, 1000,
                  -147, 957, -147, 2611, -141, 803, -142, 828, -145, 1089, -144, 828, -143, 800, -145, 827, -145 , 1000,
                  -147, 958, -145, 1771, -145, 830, -140, 2849, -143, 1379, -144, 1352, -144, 1220, -146, 2743, -144, 1000,
                  -144, 956, -146, 1483, -167, 1905, -146, 802, -146, 1086, -145, 826, -145, 827, -144, 801, -167 ]
          repeat:
            times: 2        

Neither the pronto or the raw seems to be working. I tried putting a 0 or 1000 in there as an integer, but no success…

By using this thread Request: will any user successfully using ESPhome as a remote IR transmitter please post their yaml I was able to update my remote receiver and at least figured that piece out. This is what I did below for the remote receiver in esphome.

remote_receiver:
  pin:
    number: D5
    inverted: True
    mode: INPUT_PULLUP
#  dump: all
  dump: raw

When I do that the receiver gets this message in esphome, notice there is no more negate beginning values for the remote signals. Which makes me feel I am reading it correctly now. Here is that log.

[14:33:59][D][remote.raw:041]: Received Raw: 169, -938, 167, -1762, 166, -802, 197, -2827, 197, -1320, 198, -1319, 198, -1182, 197, -2690, 197
[14:33:59][D][remote.raw:041]: Received Raw: 198, -908, 200, -1044, 198, -771, 197, -772, 195, -772, 197, -2554, 197, -772, 167, -802, 197
[14:33:59][D][remote.raw:041]: Received Raw: 198, -908, 197, -1731, 198, -771, 197, -2825, 168, -1349, 199, -1320, 196, -1184, 167, -2720, 196
[14:33:59][D][remote.raw:041]: Received Raw: 199, -908, 198, -2141, 198, -1866, 197, -773, 197, -772, 197, -2554, 195, -773, 195, -774, 196

Here is where the issue is again, notice that there is 2 + numbers together so I am unable to concatenate this into one signal. Breaking it up into 4 signals I have done this.

  - platform: template
    name: "cable_channel_up"
    id: cable_channel_up
    turn_on_action:
      - remote_transmitter.transmit_raw:
          carrier_frequency: 38kHz
          code: [  169, -938, 167, -1762, 166, -802, 197, -2827, 197, -1320, 198, -1319, 198, -1182, 197, -2690, 197 ]
      - remote_transmitter.transmit_raw:
          carrier_frequency: 38kHz
          code: [  198, -908, 200, -1044, 198, -771, 197, -772, 195, -772, 197, -2554, 197, -772, 167, -802, 197 ]
      - remote_transmitter.transmit_raw:
          carrier_frequency: 38kHz
          code: [  198, -908, 197, -1731, 198, -771, 197, -2825, 168, -1349, 199, -1320, 196, -1184, 167, -2720, 196 ]
      - remote_transmitter.transmit_raw:
          carrier_frequency: 38kHz
          code: [  199, -908, 198, -2141, 198, -1866, 197, -773, 197, -772, 197, -2554, 195, -773, 195, -774, 196 ]

It isn’t working on the box and when I check the receiving code, it isn’t 100% matching. Here it is:

[14:46:34][D][remote.raw:028]: Received Raw: 165, -1762, 61, -910, 163, -2860, 161, -1355, 163, -1354, 162, -1219, 93, -2795, 164, -755, 80, -1014, 97, -1144, 107, -1778, 103, -866, 129, -2620, 166, -802, 95, -876, 165, -2875, 75, -958, 162, -1765, 162, -834, 99, -2897, 95, -1422, 
[14:46:34][D][remote.raw:041]:   167, -1351, 164, -1215, 61, -2827, 163, -3401, 164, -2175, 194, -1868, 165, -807, 191, -777, 162, -3559, 95, -872, 197

Any ideas???

Ok here is what I did overnight and I am documenting so others can follow. First of all I am trying to emulate a Xfinity Comcast XR15 remote. Unfortunately I noticed that the module I bought requires 5v and looks like this.

As you can see I had to move to an ESP 32 and I pinned it on the Vin and GND pins for the board.
After that I noticed the data changed from the IR Reciever on the same ESP32 directly from the XR15 remote.

It changed to this:

[  279, -871, 267, -1660, 267, -703, 266, -2758, 292, -1225, 292, -1225, 292, -1088, 292, -2595, 293 ]
[  294, -814, 291, -952, 292, -677, 292, -677, 292, -676, 293, -2458, 291, -678, 291, -678, 292 ]
[  311, -841, 290, -1637, 291, -679, 291, -2733, 289, -1228, 289, -1228, 290, -1089, 289, -2598, 289 ]
[  262, -845, 262, -2077, 261, -1804, 261, -708, 261, -709, 260, -2488, 263, -707, 260, -710, 261 ]

When I replaced it in ESPHOME, boom it started working but not on every button press. After looking at the code coming back on the receiver, I noticed that I needed to add delays to fully get the IR code to match. Then the code started to work, but on every like 10th button press. I noticed when I use the Xfinity XR15 remote that the signal is bursting. So I kept playing with repeating the signal and then the delays until I settled on the code below. Now it works almost every button press.

#templates for remote
  - platform: template
    name: "cable_chan_up"
    id: cable_chan_up
    turn_on_action:
      - remote_transmitter.transmit_raw:
          repeat:
            times: 15
            wait_time: 16 ms
          carrier_frequency: 38kHz
          code: [  279, -871, 267, -1660, 267, -703, 266, -2758, 292, -1225, 292, -1225, 292, -1088, 292, -2595, 293 ]
      - delay: 16 ms
      - remote_transmitter.transmit_raw:
          repeat:
            times: 15
            wait_time: 16 ms
          carrier_frequency: 38kHz
          code: [  294, -814, 291, -952, 292, -677, 292, -677, 292, -676, 293, -2458, 291, -678, 291, -678, 292 ]
      - delay: 16 ms    
      - remote_transmitter.transmit_raw:
          repeat:
            times: 15
            wait_time: 16 ms
          carrier_frequency: 38kHz
          code: [  311, -841, 290, -1637, 291, -679, 291, -2733, 289, -1228, 289, -1228, 290, -1089, 289, -2598, 289 ]
      - delay: 16 ms
      - remote_transmitter.transmit_raw:
          repeat:
            times: 15
            wait_time: 16 ms
          carrier_frequency: 38kHz
          code: [  262, -845, 262, -2077, 261, -1804, 261, -708, 261, -709, 260, -2488, 263, -707, 260, -710, 261 ]

Any follow up thoughts? comments? Wow it took me weeks to get to this point. Thought I would document this in two places because I dont see many people trying to remote control this Comcast box…

1 Like

Nice one, you got there! I’ve also found that changing boards can improve remote results.

Good on you for sharing the solution.

Once you’ve struggled though it alone vs found a tidy posted solution you start to really appreciate when people document their solutions for others to find and use.