ESP32 & CC1101 and my last stubborn fan

I have a Hunter ceiling fan that I can turn on, but can't turn off to save my soul. I have added 4 raw captures to the end... what am I doing wrong?

This is my current rx config with commented out options I have tried:

remote_receiver:
  pin:
    number: GPIO25      # GDO2 (Optional for TX-only)
    inverted: false
  id: receiver0
  dump: raw
  filter: 150us   # Has worked for me
  #filter: 250us
  idle: 30ms         # Has worked for me
  #idle: 40ms
  #tolerance: 50%     # A guess
  buffer_size: 10kb

This code turns it on:

  - platform: template
    name: "Dining Room Fan ON"
    web_server:
      sorting_weight: 12
    on_press:
      - lambda: |-
          // Change frequency to 433.92 MHz before sending
          id(transceiver).set_frequency(433.92e6);
      - remote_transmitter.transmit_raw:
          code: [402, -2900, 275, -497, 299, -497, 300, -499, 327, -447, 350, -473, 325, -475, 326, -474, 326, -5239, 772, -444, 774, -422, 375, -823, 376, -824, 375, -799, 803, -397, 804, -398, 799, -422, 779, -423, 375, -825, 376, -824, 779, -423, 777,
-423, 776, -398, 802, -422, 375, -825, 377, -823, 376, -824, 376, -823, 778, -422, 779, -398, 804, -423, 374, -822, 377, -823, 376, -825, 378, -824, 776, -422, 778, -397, 401, -823, 376, -824, 778, -422, 377, -823, 779, -423, 375, -825, 375, -799,
400, -824, 778, -423, 778, -422, 778, -422, 776, -423, 776, -424, 376, -801, 401, -822, 377, -823, 377, -826, 375, -797, 803, -422, 376, -799, 402, -800, 401, -821, 376, -824, 377, -823, 377, -825, 777, -423, 776, -422, 779, -398, 801, -422, 779,
-422, 377, -800, 801, -422, 779, -397, 801, -398, 801, -397, 806, -397, 802, -423, 376, -25641]
          repeat:
            times: 2
            wait_time: 0ms
      - logger.log: "Dining room fan turned on"

I have tried likely up to 7 or 8 different samples and just can't make it work, here was y last attemp:

  - platform: template
    name: "Dining Room Fan Off"
    web_server:
      sorting_weight: 11
    on_press:
      - lambda: |-
          // Change frequency to 433.92 MHz before sending
          id(transceiver).set_frequency(433.92e6);
      - remote_transmitter.transmit_raw:
          code: [826, -400, 380, -426, 377, -424, 377, -424, 377, -423, 377, -399, 402, -398, 400, -423, 377, -423, 377, -423, 377, -424, 377, -5202, 800, -397, 801, -397, 402, -799, 402, -798, 401, -798, 804, -398, 803, -398, 801, -398, 800, -398, 402,
-799, 402, -799, 802, -398, 801, -398, 804, -397, 802, -397, 401, -799, 402, -799, 400, -798, 401, -799, 803, -397, 804, -397, 802, -397, 402, -799, 400, -799, 402, -800, 400, -798, 804, -398, 800, -398, 402, -799, 400, -799, 801, -399, 402, -799,
801, -398, 401, -799, 401, -799, 402, -799, 801, -397, 802, -398, 804, -398, 802, -398, 801, -398, 401, -799, 401, -799, 401, -798, 402, -799, 401, -799, 401, -799, 401, -799, 401, -799, 402, -798, 402, -799, 400, -798, 803, -399, 801, -398, 802,
-399, 801, -397, 803, -399, 800, -398, 803, -398, 804, -398, 801, -397, 802, -398, 801, -398, 802, -398, 402, -800, 400, -25644]
          repeat:
            times: 1
            wait_time: 0ms
      - logger.log: "Dining room fan turned off"

4 captures I made tonight: They look very similar to me, except the first lines timing seems to vary quite a bit and there is not a 4th and negative element captured ever. If I ignore the first line they look very similar, the last capture did not pick up the 2 codes and odd timing mark.

Capture 1:

22:14:31
[I]
[remote.raw:035]
Received Raw: 284, -1658, 290
22:14:32
[I]
[remote.raw:026]
Received Raw: 400, -438, 354, -441, 362, -437, 362, -432, 357, -428, 379, -425, 378, -424, 377, -425, 377, -423, 377, -423, 377, -424, 376, -5212, 794, -396, 802, -397, 400, -798, 401, -800, 401, -798, 801, -423, 778, -398, 804, -398, 801, -397, 402,
22:14:32
[I]
[remote.raw:026]
-799, 400, -798, 803, -397, 805, -396, 805, -397, 801, -397, 401, -798, 403, -798, 402, -801, 399, -799, 804, -398, 802, -398, 801, -397, 400, -800, 402, -797, 401, -798, 402, -799, 801, -398, 803, -398, 400, -799, 402, -799, 804, -398, 401, -799,
22:14:32
[I]
[remote.raw:026]
802, -398, 400, -797, 401, -799, 402, -798, 804, -397, 801, -398, 804, -397, 803, -398, 802, -397, 401, -798, 402, -799, 401, -798, 402, -799, 402, -801, 401, -797, 401, -799, 401, -798, 401, -800, 401, -798, 401, -799, 803, -397, 801, -398, 804,
22:14:32
[I]
[remote.raw:026]
-398, 801, -397, 804, -398, 800, -398, 804, -397, 803, -398, 803, -397, 802, -398, 801, -397, 801, -423, 377, -800, 400, -25652, 401, -423, 378, -426, 376, -424, 377, -424, 376, -424, 376, -425, 376, -423, 377, -423, 377, -424, 376, -424, 376, -423,
22:14:32
[I]
[remote.raw:026]
376, -5214, 796, -396, 799, -396, 401, -799, 401, -798, 400, -824, 776, -424, 776, -424, 779, -398, 801, -422, 376, -825, 376, -800, 802, -421, 777, -423, 778, -422, 779, -397, 401, -823, 377, -823, 377, -824, 376, -823, 777, -422, 779, -423, 778,
22:14:32
[I]
[remote.raw:026]
-398, 401, -800, 400, -823, 377, -801, 400, -798, 801, -422, 777, -423, 376, -801, 400, -822, 778, -424, 376, -823, 778, -423, 376, -824, 375, -824, 377, -823, 776, -423, 779, -423, 776, -423, 778, -421, 780, -397, 401, -800, 402, -797, 401, -800,
22:14:32
[I]
[remote.raw:026]
400, -822, 377, -824, 377, -799, 400, -823, 377, -824, 376, -824, 375, -824, 377, -824, 776, -423, 779, -398, 800, -423, 779, -421, 780, -397, 804, -398, 801, -422, 779, -398, 804, -396, 801, -397, 800, -423, 779, -423, 376, -800, 401, -27453, 378,
22:14:32
[I]
[remote.raw:026]
-450, 324, -496, 299, -498, 301, -498, 327, -449, 351, -449, 350, -448, 350, -448, 376, -423, 376, -424, 376, -423, 378, -5213, 798, -395, 798, -396, 400, -798, 401, -799, 401, -823, 778, -422, 778, -423, 779, -397, 801, -422, 377, -800, 402, -798,
22:14:32
[I]
[remote.raw:035]
802, -422, 779, -398, 803, -397, 800, -422, 377, -799, 400, -824, 377, -799, 400, -824, 778, -423, 778, -398, 801, -398, 400, -799, 402, -824

Capture 2:

22:16:18
[I]
[remote.raw:035]
Received Raw: 277, -3514, 272
22:16:19
[I]
[remote.raw:026]
Received Raw: 400, -400, 401, -400, 400, -400, 401, -400, 400, -401, 400, -400, 401, -400, 400, -401, 400, -400, 400, -401, 400, -400, 401, -5204, 800, -401, 800, -401, 400, -800, 401, -800, 401, -800, 801, -400, 776, -425, 776, -425, 776, -425, 375,
22:16:19
[I]
[remote.raw:026]
-826, 375, -826, 775, -426, 775, -426, 775, -426, 775, -401, 400, -800, 401, -800, 401, -800, 401, -800, 801, -400, 801, -400, 801, -400, 400, -801, 400, -801, 400, -801, 400, -801, 800, -401, 800, -401, 400, -800, 401, -800, 801, -400, 401, -800,
22:16:19
[I]
[remote.raw:026]
801, -400, 375, -826, 375, -826, 375, -826, 776, -425, 775, -426, 775, -426, 775, -426, 775, -426, 375, -800, 401, -800, 401, -800, 401, -800, 401, -800, 401, -800, 400, -801, 400, -801, 400, -801, 400, -801, 400, -801, 800, -401, 800, -401, 800,
22:16:19
[I]
[remote.raw:026]
-400, 801, -400, 801, -400, 801, -400, 801, -400, 801, -400, 776, -425, 776, -425, 776, -425, 775, -426, 375, -826, 375, -25670, 400, -391, 399, -417, 402, -386, 401, -407, 381, -426, 379, -399, 404, -397, 400, -399, 402, -398, 401, -398, 402, -399,
22:16:19
[I]
[remote.raw:026]
402, -5201, 804, -398, 800, -397, 400, -824, 376, -799, 401, -800, 803, -398, 800, -423, 778, -397, 803, -397, 400, -824, 376, -800, 801, -423, 778, -399, 801, -398, 801, -398, 402, -799, 400, -800, 402, -798, 401, -798, 801, -424, 779, -398, 801,
22:16:19
[I]
[remote.raw:026]
-398, 402, -799, 400, -798, 400, -799, 402, -824, 777, -422, 779, -399, 401, -800, 400, -799, 801, -398, 401, -823, 779, -398, 401, -797, 401, -824, 377, -798, 800, -424, 779, -398, 801, -423, 779, -398, 804, -398, 400, -798, 400, -798, 400, -799,
22:16:19
[I]
[remote.raw:026]
402, -802, 401, -798, 400, -800, 402, -798, 400, -798, 402, -799, 401, -822, 377, -799, 801, -398, 803, -422, 776, -424, 779, -397, 804, -397, 801, -422, 776, -424, 779, -399, 802, -398, 801, -422, 780, -398, 801, -398, 400, -822, 377, -27447, 400,
22:16:19
[I]
[remote.raw:026]
-409, 408, -403, 379, -399, 401, -399, 402, -399, 400, -399, 401, -399, 401, -399, 402, -398, 402, -399, 400, -399, 402, -5203, 801, -396, 803, -398, 400, -797, 400, -801, 400, -799, 804, -398, 802, -397, 801, -398, 801, -398, 402, -799, 402, -798,
22:16:19
[I]
[remote.raw:035]
803, -397, 804, -398, 801, -398, 801, -398, 402, -799, 400, -799, 402, -798, 401, -798, 802, -398, 803, -399, 800, -424, 376, -800, 400, -824

Capture 3:

22:17:06
[I]
[remote.raw:035]
Received Raw: 286, -1264, 282
22:17:07
[I]
[remote.raw:026]
Received Raw: 401, -400, 401, -414, 400, -387, 400, -402, 400, -400, 401, -401, 401, -389, 401, -400, 400, -401, 400, -400, 401, -414, 401, -5196, 800, -401, 800, -401, 400, -801, 400, -792, 400, -801, 800, -401, 800, -394, 801, -400, 801, -400, 401,
22:17:07
[I]
[remote.raw:026]
-801, 401, -795, 801, -400, 801, -400, 801, -395, 800, -401, 400, -801, 400, -801, 400, -800, 401, -800, 801, -400, 801, -400, 801, -394, 401, -800, 401, -800, 401, -800, 401, -800, 801, -400, 801, -400, 400, -801, 400, -801, 800, -401, 400, -801,
22:17:07
[I]
[remote.raw:026]
800, -401, 400, -801, 400, -800, 401, -800, 801, -400, 776, -425, 776, -425, 776, -425, 776, -425, 375, -826, 375, -826, 375, -801, 400, -801, 400, -801, 400, -801, 400, -800, 401, -800, 401, -800, 401, -800, 401, -800, 801, -400, 801, -400, 801,
22:17:07
[I]
[remote.raw:026]
-400, 801, -400, 800, -401, 800, -401, 800, -401, 800, -401, 800, -400, 801, -400, 801, -400, 776, -425, 401, -800, 375, -25670, 401, -400, 400, -400, 401, -400, 400, -401, 400, -400, 401, -400, 400, -401, 400, -400, 400, -401, 400, -400, 401, -400,
22:17:07
[I]
[remote.raw:026]
400, -5204, 776, -425, 776, -425, 375, -826, 375, -826, 375, -826, 776, -425, 775, -426, 775, -401, 800, -401, 400, -801, 400, -800, 801, -400, 801, -400, 801, -400, 801, -400, 400, -801, 400, -801, 400, -801, 400, -801, 800, -401, 800, -401, 800,
22:17:07
[I]
[remote.raw:026]
-401, 400, -800, 401, -800, 401, -800, 376, -825, 776, -425, 776, -425, 375, -826, 375, -826, 776, -425, 375, -826, 775, -426, 375, -801, 400, -801, 400, -800, 801, -400, 801, -400, 801, -400, 801, -400, 801, -400, 400, -801, 400, -801, 400, -801,
22:17:07
[I]
[remote.raw:026]
400, -801, 400, -801, 400, -801, 400, -801, 400, -801, 400, -800, 401, -800, 401, -800, 801, -400, 776, -413, 801, -400, 802, -390, 802, -414, 803, -388, 801, -400, 804, -401, 803, -388, 801, -415, 776, -425, 800, -394, 395, -794, 401, -27466, 401,
22:17:08
[I]
[remote.raw:026]
-415, 388, -405, 401, -403, 400, -401, 378, -398, 427, -373, 428, -377, 401, -397, 400, -423, 376, -423, 376, -424, 375, -5203, 800, -399, 800, -401, 400, -801, 400, -801, 400, -800, 801, -400, 801, -400, 801, -400, 801, -400, 400, -801, 400, -801,
22:17:08
[I]
[remote.raw:035]
801, -400, 801, -400, 800, -401, 800, -401, 400, -801, 400, -801, 400, -800, 401, -793, 800, -401, 800, -401, 800, -401, 400, -800, 401, -800

4th. capture:

22:33:29
[I]
[remote.raw:026]
Received Raw: 375, -451, 350, -450, 351, -425, 375, -425, 376, -425, 375, -426, 375, -425, 376, -425, 375, -426, 375, -425, 375, -426, 375, -5229, 751, -450, 776, -425, 350, -851, 350, -851, 350, -851, 750, -451, 750, -451, 750, -451, 750, -450, 351,
22:33:29
[I]
[remote.raw:026]
-850, 351, -850, 751, -450, 751, -450, 751, -425, 776, -425, 375, -826, 375, -826, 375, -826, 375, -826, 775, -426, 775, -426, 775, -425, 376, -825, 376, -825, 376, -825, 375, -826, 751, -450, 751, -450, 350, -851, 375, -826, 750, -451, 350, -851,
22:33:30
[I]
[remote.raw:026]
750, -451, 350, -851, 350, -850, 351, -850, 751, -450, 751, -450, 751, -450, 751, -450, 751, -425, 375, -826, 375, -826, 375, -826, 375, -826, 375, -826, 375, -825, 376, -825, 376, -825, 376, -825, 376, -825, 375, -826, 776, -425, 776, -425, 751,
22:33:30
[I]
[remote.raw:026]
-450, 750, -451, 775, -426, 750, -451, 750, -451, 750, -450, 751, -450, 751, -450, 751, -450, 751, -425, 375, -826, 375, -25695, 375, -426, 375, -425, 376, -425, 375, -426, 375, -425, 376, -425, 375, -425, 376, -425, 375, -426, 375, -425, 351, -450,
22:33:30
[I]
[remote.raw:026]
350, -5229, 776, -425, 776, -425, 375, -826, 375, -826, 375, -826, 775, -426, 775, -426, 775, -426, 775, -426, 375, -825, 376, -825, 776, -425, 776, -425, 776, -425, 776, -425, 375, -826, 375, -826, 375, -826, 375, -826, 750, -451, 775, -426, 750,
22:33:30
[I]
[remote.raw:026]
-451, 350, -850, 351, -850, 351, -850, 351, -850, 751, -450, 751, -425, 375, -826, 375, -826, 776, -425, 375, -826, 775, -426, 375, -826, 375, -826, 375, -825, 776, -425, 776, -425, 776, -425, 776, -425, 776, -425, 375, -826, 350, -851, 350, -851,
22:33:30
[I]
[remote.raw:026]
350, -851, 350, -851, 350, -851, 350, -851, 350, -851, 350, -850, 351, -850, 351, -850, 751, -450, 751, -450, 751, -425, 776, -450, 751, -425, 775, -426, 775, -426, 775, -426, 775, -426, 775, -425, 776, -425, 776, -425, 376, -825, 376, -27471, 350,
22:33:30
[I]
[remote.raw:026]
-450, 351, -450, 350, -425, 376, -425, 375, -426, 375, -425, 376, -425, 375, -426, 375, -425, 375, -426, 375, -425, 376, -5229, 775, -426, 775, -426, 375, -826, 375, -825, 376, -825, 776, -425, 776, -425, 776, -425, 776, -425, 375, -826, 375, -826,
22:33:30
[I]
[remote.raw:035]
775, -426, 775, -426, 775, -426, 775, -401, 375, -826, 375, -825, 376, -825, 376, -825, 776, -425, 776, -425, 776, -425, 375, -826, 375, -826

I ended up cleaning up the 4th sample and tried it, of course it did not work!

It really looks to me like I could grab the first block ending in -25695 and repeat it twice and would maybe be golden?

  - platform: template
    name: "Dining Room Fan Off"
    web_server:
      sorting_weight: 11
    on_press:
      - lambda: |-
          // Change frequency to 433.92 MHz before sending
          id(transceiver).set_frequency(433.92e6);
      - remote_transmitter.transmit_raw:
          code: [375, -451, 350, -450, 351, -425, 375, -425, 376, -425, 375, -426, 375, -425, 376, -425, 375, -426, 375, -425, 375, -426, 375, -5229, 
          751, -450, 776, -425, 350, -851, 350, -851, 350, -851, 750, -451, 750, -451, 750, -451, 750, -450, 351, -850, 351, -850, 751, -450, 751, -450, 
          751, -425, 776, -425, 375, -826, 375, -826, 375, -826, 375, -826, 775, -426, 775, -426, 775, -425, 376, -825, 376, -825, 376, -825, 375, -826, 
          751, -450, 751, -450, 350, -851, 375, -826, 750, -451, 350, -851, 750, -451, 350, -851, 350, -850, 351, -850, 751, -450, 751, -450, 751, -450, 
          751, -450, 751, -425, 375, -826, 375, -826, 375, -826, 375, -826, 375, -826, 375, -825, 376, -825, 376, -825, 376, -825, 376, -825, 375, -826, 
          776, -425, 776, -425, 751, -450, 750, -451, 775, -426, 750, -451, 750, -451, 750, -450, 751, -450, 751, -450, 751, -450, 751, -425, 375, -826, 
          375, -25695, 375, -426, 375, -425, 376, -425, 375, -426, 375, -425, 376, -425, 375, -425, 376, -425, 375, -426, 375, -425, 351, -450, 350, -5229, 
          776, -425, 776, -425, 375, -826, 375, -826, 375, -826, 775, -426, 775, -426, 775, -426, 775, -426, 375, -825, 376, -825, 776, -425, 776, -425, 
          776, -425, 776, -425, 375, -826, 375, -826, 375, -826, 375, -826, 750, -451, 775, -426, 750, -451, 350, -850, 351, -850, 351, -850, 351, -850, 
          751, -450, 751, -425, 375, -826, 375, -826, 776, -425, 375, -826, 775, -426, 375, -826, 375, -826, 375, -825, 776, -425, 776, -425, 776, -425, 
          776, -425, 776, -425, 375, -826, 350, -851, 350, -851, 350, -851, 350, -851, 350, -851, 350, -851, 350, -851, 350, -850, 351, -850, 351, -850, 
          751, -450, 751, -450, 751, -425, 776, -450, 751, -425, 775, -426, 775, -426, 775, -426, 775, -426, 775, -425, 776, -425, 776, -425, 376, -825, 
          376, -27471, 350, -450, 351, -450, 350, -425, 376, -425, 375, -426, 375, -425, 376, -425, 375, -426, 375, -425, 375, -426, 375, -425, 376, -5229, 
          775, -426, 775, -426, 375, -826, 375, -825, 376, -825, 776, -425, 776, -425, 776, -425, 776, -425, 375, -826, 375, -826, 775, -426, 775, -426, 
          775, -426, 775, -401, 375, -826, 375, -825, 376, -825, 376, -825, 776, -425, 776, -425, 776, -425, 375, -826, 375, -826]
          repeat:
            times: 1
            wait_time: 0ms
      - logger.log: "Dining room fan turned off"

I also tried shortening it as I mentioned above and repeating 2 times, still did not work.

 - platform: template
    name: "Dining Room Fan Off"
    web_server:
      sorting_weight: 11
    on_press:
      - lambda: |-
          // Change frequency to 433.92 MHz before sending
          id(transceiver).set_frequency(433.92e6);
      - remote_transmitter.transmit_raw:
          code: [375, -451, 350, -450, 351, -425, 375, -425, 376, -425, 375, -426, 375, -425, 376, -425, 375, -426, 375, -425, 375, -426, 375, -5229, 
          751, -450, 776, -425, 350, -851, 350, -851, 350, -851, 750, -451, 750, -451, 750, -451, 750, -450, 351, -850, 351, -850, 751, -450, 751, -450, 
          751, -425, 776, -425, 375, -826, 375, -826, 375, -826, 375, -826, 775, -426, 775, -426, 775, -425, 376, -825, 376, -825, 376, -825, 375, -826, 
          751, -450, 751, -450, 350, -851, 375, -826, 750, -451, 350, -851, 750, -451, 350, -851, 350, -850, 351, -850, 751, -450, 751, -450, 751, -450, 
          751, -450, 751, -425, 375, -826, 375, -826, 375, -826, 375, -826, 375, -826, 375, -825, 376, -825, 376, -825, 376, -825, 376, -825, 375, -826, 
          776, -425, 776, -425, 751, -450, 750, -451, 775, -426, 750, -451, 750, -451, 750, -450, 751, -450, 751, -450, 751, -450, 751, -425, 375, -826, 
          375, -25695]
          repeat:
            times: 2
            wait_time: 0ms
      - logger.log: "Dining room fan turned off"

I see only few possible reasons why it would not work..
First, set the repeat times to 4

          code: [375, -451, 350, -450, 351, -425, 375, -425, 376, -425, 375, -426, 375, -425, 376, -425, 375, -426, 375, -425, 375, -426, 375, -5229, 751, -450, 776, -425, 350, -851, 350, -851, 350, -851, 750, -451, 750, -451, 750, -451, 750, -450, 351, -850, 351, -850, 751, -450, 751, -450, 751, -425, 776, -425, 375, -826, 375, -826, 375, -826, 375, -826, 775, -426, 775, -426, 775, -425, 376, -825, 376, -825, 376, -825, 375, -826, 751, -450, 751, -450, 350, -851, 375, -826, 750, -451, 350, -851, 750, -451, 350, -851, 350, -850, 351, -850, 751, -450, 751, -450, 751, -450, 751, -450, 751, -425, 375, -826, 375, -826, 375, -826, 375, -826, 375, -826, 375, -825, 376, -825, 376, -825, 376, -825, 376, -825, 375, -826, 776, -425, 776, -425, 751, -450, 750, -451, 775, -426, 750, -451, 750, -451, 750, -450, 751, -450, 751, -450, 751, -450, 751, -425, 375, -826, 375, -25695]
          repeat:
            times: 4
            wait_time: 0ms

If that doesn't work I see one possible cause: If receiver is picky with the pause time that 25700 doesn't match perfectly with second pause that is almost 2ms longer (27500).
In that case you can try this:

          code: [375, -451, 350, -450, 351, -425, 375, -425, 376, -425, 375, -426, 375, -425, 376, -425, 375, -426, 375, -425, 375, -426, 375, -5229, 751, -450, 776, -425, 350, -851, 350, -851, 350, -851, 750, -451, 750, -451, 750, -451, 750, -450, 351, -850, 351, -850, 751, -450, 751, -450, 751, -425, 776, -425, 375, -826, 375, -826, 375, -826, 375, -826, 775, -426, 775, -426, 775, -425, 376, -825, 376, -825, 376, -825, 375, -826, 751, -450, 751, -450, 350, -851, 375, -826, 750, -451, 350, -851, 750, -451, 350, -851, 350, -850, 351, -850, 751, -450, 751, -450, 751, -450, 751, -450, 751, -425, 375, -826, 375, -826, 375, -826, 375, -826, 375, -826, 375, -825, 376, -825, 376, -825, 376, -825, 376, -825, 375, -826, 776, -425, 776, -425, 751, -450, 750, -451, 775, -426, 750, -451, 750, -451, 750, -450, 751, -450, 751, -450, 751, -450, 751, -425, 375, -826, 375, -25695, 375, -426, 375, -425, 376, -425, 375, -426, 375, -425, 376, -425, 375, -425, 376, -425, 375, -426, 375, -425, 351, -450, 350, -5229, 776, -425, 776, -425, 375, -826, 375, -826, 375, -826, 775, -426, 775, -426, 775, -426, 775, -426, 375, -825, 376, -825, 776, -425, 776, -425, 776, -425, 776, -425, 375, -826, 375, -826, 375, -826, 375, -826, 750, -451, 775, -426, 750, -451, 350, -850, 351, -850, 351, -850, 351, -850, 751, -450, 751, -425, 375, -826, 375, -826, 776, -425, 375, -826, 775, -426, 375, -826, 375, -826, 375, -825, 776, -425, 776, -425, 776, -425, 776, -425, 776, -425, 375, -826, 350, -851, 350, -851, 350, -851, 350, -851, 350, -851, 350, -851, 350, -851, 350, -850, 351, -850, 351, -850, 751, -450, 751, -450, 751, -425, 776, -450, 751, -425, 775, -426, 775, -426, 775, -426, 775, -426, 775, -425, 776, -425, 776, -425, 376, -825, 376, -27471]
          repeat:
            times: 2
            wait_time: 0ms

If that doesnt work either we need to adjust receiver parameters to capture the whole signal including all repeats (at the moment it's truncated).

Yes, when I look at the signal with URH I see 4 sets of definite pulses. So, other than buffers being set at 10k and I have not changed the RMT, looks like I could bump it to 512 on my esp. I will test more this evening and let you know... I just tried setting rmt_symbols on the receiver to 512, but because the transmitter defaults to 64 I had to back the receiver down to 256. Is this what is causing the truncation or is it not dumping fast enough due to dma?

Oh how I wish someone made a good ESP based fan controller that would integrate with HA and still had a remote! I am really not sure how hard it would be to make, would take some relays and an old remote along with a CC1101, but it does not look undoable. At that point one could even add control over rotation direction.

I had a look at the URH screenshot from your other topic.
And it presents 2 slightly different signals. First two are same, after 27500 pause other two signals.


So you need the last part as well.
I have not played with RMT parameters and don't have any device that output that long signal, but try what i suggested on previous topic.
In case you can't manage to capture the whole signal just set the idle: 10ms and esphome cuts the signal in 4 pieces. Since we know the correct pauses now, from there the whole signal can be built.

OMG, I got it to turn off!!! There are some visual queues, but I am really not sure how to break it down for a smaller payload. It almost looks to me line the last 3 lines repeated twice might work, have not tired it yet.

These are my rx settings that got me the long capture and I have defined 2 toggles that set either 350 or 433 mhz and start the rx and run it for 5 seconds and then stops the rx. I have a lot of stuff on 433 so it tends to scroll by quite a bit..

rx code:

remote_receiver:
  pin:
    number: GPIO25      # GDO2 (Optional for TX-only)
    inverted: false
  id: receiver0
  rmt_symbols: 256
  receive_symbols: 512
  dump: raw
  filter: 150us   # Has worked for me
  #filter: 250us
  #idle: 30ms     # Has worked for me
  #idle: 40ms
  idle: 50ms      # For devices with long codes, works
  #tolerance: 50%     # A guess
  buffer_size: 20kb

Here is the capture broken up at the pause frames:

426, -426, 355, -427, 380, -425, 378, -424, 376, -423, 377, -424, 377, -425, 375, -423, 377, -424, 375, -423, 377, -424, 377, -5213, 
798, -394, 799, -395, 401, -798, 402, -799, 401, -799, 800, -398, 805, -398, 803, -397, 801, -396, 402, -799, 403, -798, 801, -398, 802, -398, 801, -398, 804, -398, 400, -799, 402, -798, 400, -798, 403, -799, 805, -398, 802, -396, 804, -396, 401, -800, 401, -797, 401, -799, 400, -799, 802, -397, 804, -398, 400, -799, 401, -800, 801, -398, 402, -798, 804, -398, 400, -799, 402, -798, 401, -800, 802, -396, 802, -398, 802, -397, 805, -398, 801, -397, 402, -798, 401, -798, 403, -799, 402, -798, 400, -798, 402, -800, 401, -798, 402, -799, 401, -798, 401, -800, 401, -798, 804, -398, 802, -397, 801, -398, 801, -399, 802, -398, 803, -397, 803, -397, 804, -397, 801, -398, 802, -397, 803, -398, 804, -398, 400, -798, 402, -25643, 
425, -419, 358, -428, 379, -427, 377, -425, 377, -423, 376, -423, 376, -424, 376, -424, 377, -424, 375, -424, 377, -424, 376, -5212, 
798, -394, 800, -395, 401, -799, 402, -799, 400, -800, 801, -396, 805, -396, 801, -398, 805, -397, 402, -797, 402, -799, 801, -397, 804, -398, 801, -397, 802, -398, 402, -799, 401, -799, 402, -798, 401, -801, 801, -397, 804, -398, 801, -397, 400, -799, 401, -800, 401, -799, 400, -799, 805, -398, 801, -398, 401, -801, 400, -798, 801, -398, 402, -800, 801, -397, 402, -801, 399, -797, 402, -799, 802, -398, 802, -398, 801, -398, 804, -398, 801, -397, 402, -800, 400, -799, 402, -798, 401, -799, 401, -798, 401, -801, 400, -799, 400, -799, 402, -798, 401, -799, 401, -799, 805, -397, 802, -396, 804, -397, 802, -398, 804, -397, 801, -421, 779, -398, 804, -396, 803, -397, 801, -423, 780, -398, 803, -397, 401, -797, 402, -27469, 
400, -430, 356, -428, 380, -425, 377, -424, 376, -424, 377, -423, 377, -423, 377, -424, 376, -424, 376, -423, 377, -424, 376, -5216, 
796, -393, 799, -396, 400, -799, 402, -799, 400, -798, 804, -397, 801, -398, 804, -397, 802, -398, 400, -800, 403, -799, 800, -397, 804, -398, 803, -398, 802, -396, 401, -798, 402, -799, 401, -798, 402, -799, 803, -397, 800, -398, 802, -398, 402, -801, 400, -798, 401, -799, 402, -799, 803, -397, 801, -398, 401, -799, 401, -799, 802, -398, 402, -800, 801, -397, 402, -799, 401, -797, 402, -799, 801, -398, 804, -398, 801, -398, 801, -398, 805, -398, 401, -797, 402, -798, 401, -798, 402, -800, 400, -798, 402, -799, 800, -399, 402, -801, 400, -799, 401, -799, 801, -397, 402, -800, 804, -397, 802, -396, 801, -398, 803, -398, 803, -396, 802, -398, 402, -799, 803, -397, 801, -398, 805, -398, 401, -797, 801, -398, 402, -25648, 
401, -473, 304, -476, 328, -475, 327, -473, 328, -474, 326, -473, 326, -474, 327, -449, 351, -449, 375, -424, 377, -423, 377, -5212, 
800, -394, 800, -395, 400, -823, 375, -801, 400, -823, 778, -422, 777, -423, 779, -397, 801, -423, 375, -824

It's still not complete signal, fourth part is missing half. But since 4. is same as 3. you can just repeat it.

on_press:
      - lambda: |-
          // Change frequency to 433.92 MHz before sending
          id(transceiver).set_frequency(433.92e6);
      - remote_transmitter.transmit_raw:
          code: [426, -426, 355, -427, 380, -425, 378, -424, 376, -423, 377, -424, 377, -425, 375, -423, 377, -424, 375, -423, 377, -424, 377, -5213, 798, -394, 799, -395, 401, -798, 402, -799, 401, -799, 800, -398, 805, -398, 803, -397, 801, -396, 402, -799, 403, -798, 801, -398, 802, -398, 801, -398, 804, -398, 400, -799, 402, -798, 400, -798, 403, -799, 805, -398, 802, -396, 804, -396, 401, -800, 401, -797, 401, -799, 400, -799, 802, -397, 804, -398, 400, -799, 401, -800, 801, -398, 402, -798, 804, -398, 400, -799, 402, -798, 401, -800, 802, -396, 802, -398, 802, -397, 805, -398, 801, -397, 402, -798, 401, -798, 403, -799, 402, -798, 400, -798, 402, -800, 401, -798, 402, -799, 401, -798, 401, -800, 401, -798, 804, -398, 802, -397, 801, -398, 801, -399, 802, -398, 803, -397, 803, -397, 804, -397, 801, -398, 802, -397, 803, -398, 804, -398, 400, -798, 402, -25643]
          repeat:
            times: 2
            wait_time: 0ms
      - delay: 1.7ms
      - remote_transmitter.transmit_raw:
          code: [400, -430, 356, -428, 380, -425, 377, -424, 376, -424, 377, -423, 377, -423, 377, -424, 376, -424, 376, -423, 377, -424, 376, -5216, 796, -393, 799, -396, 400, -799, 402, -799, 400, -798, 804, -397, 801, -398, 804, -397, 802, -398, 400, -800, 403, -799, 800, -397, 804, -398, 803, -398, 802, -396, 401, -798, 402, -799, 401, -798, 402, -799, 803, -397, 800, -398, 802, -398, 402, -801, 400, -798, 401, -799, 402, -799, 803, -397, 801, -398, 401, -799, 401, -799, 802, -398, 402, -800, 801, -397, 402, -799, 401, -797, 402, -799, 801, -398, 804, -398, 801, -398, 801, -398, 805, -398, 401, -797, 402, -798, 401, -798, 402, -800, 400, -798, 402, -799, 800, -399, 402, -801, 400, -799, 401, -799, 801, -397, 402, -800, 804, -397, 802, -396, 801, -398, 803, -398, 803, -396, 802, -398, 402, -799, 803, -397, 801, -398, 805, -398, 401, -797, 801, -398, 402, -25648]
          repeat:
            times: 2
            wait_time: 0ms
      - logger.log: "Dining room fan turned off"

I will try the change this evening. I will also try bumping up the idle timer and see if I can get it all. Will let you know either way.

Can you tell me how you came up with the 1.7ms delay in the middle? I thought the very long number on the end made the required delay and you are adding more?

Bumping up idle doesn't help you here. It only defines how long pause is breaking reception. 30ms idle already includes your 27ms pause. And docs say 32ms is maximum value for esp32.
Instead if you set idle to 10, you likely receive 4 separate signals.
But If 3. and 4. burst are same, the code above should work.

I will try to work with it more to capture the full string. I might run into this again in the future...

Had to bump the 1.7ms to 2.0 due to this error at compile: Maximum precision is milliseconds.
delay: 1.7ms

Go on, i'm curious as well. But you don't really need to read them at once.
Did you try with rmt symbols set to higher value like 320?
256 is not enough if receive symbols cap with that value..

That delay is likely not even needed there.

Well the repeated codes work just as well! I have spent a fair amount of time this evening looking through the remote_rx docs, making adjustments and testing and have come to the conclusion that I just cannot capture the entire data stream with the limited and pooled amount of RMT memory. I maxed it out and dropped the idle time and got a lot more, but not all of it. The lower idle also appeared to cause a loss of data/timing pairs in some cases.

Thanks again... My other Hunter fan, purchased at the same time was much easier than this one, different remote in the box, so assuming a different controller as well.

Did you try with DMA enabled? I don't know if it's allowed on classic esp32 though.

I did not, will try it... the worst that can happen is that it does not support it.