Discrepancies between received and transmitted codes - CC1101

Hello everyone! I’m a new Home Assistant user and quickly got sucked into trying to make my own IoT devices using ESPHome. I’m currently trying to use a D1 Mini to control a GE ceiling fan that is normally controlled with a RF remote controller on 303.875MHz from Rhine Electronic.

I bought a 3-pack ESP8266 D1 mini boards and 2-pack CC1101 transceiver modules. I was able to configure the board and module to capture codes from the remote. Just focusing on the light on/off button for now, I am able to reliably capture the following rc_switch code when pressing the button, with the odd truncated code in the logs:

Received RCSwitch Raw: protocol=6 data='000001111110'

However, trying to transmit these codes did not result in the light turning on/off. After many unsuccessful troubleshooting steps, I decided to make a second ESPHome transceiver to capture the codes transmitted by the first transceiver. I noticed that the codes the receiver received did not consistently match the configuration of the transmitter. Here’s a sample of the capture resulting from me triggering the action that transmits the codes from my ESPHome transmitter:

[22:38:27.209][I][remote.rc_switch:261]: Received RCSwitch Raw: protocol=6 data='000001111110'
[22:38:29.091][I][remote.rc_switch:261]: Received RCSwitch Raw: protocol=3 data='111111000001'
[22:38:30.734][I][remote.rc_switch:261]: Received RCSwitch Raw: protocol=6 data='000001111110'
[22:38:32.262][I][remote.rc_switch:261]: Received RCSwitch Raw: protocol=6 data='000001111110'
[22:38:32.955][I][remote.rc_switch:261]: Received RCSwitch Raw: protocol=3 data='11111100000'
[22:38:33.784][I][remote.rc_switch:261]: Received RCSwitch Raw: protocol=3 data='11111100000'
[22:38:34.839][I][remote.rc_switch:261]: Received RCSwitch Raw: protocol=3 data='11111100000'
[22:38:35.605][I][remote.rc_switch:261]: Received RCSwitch Raw: protocol=3 data='11111100000'
[22:38:38.961][I][remote.rc_switch:261]: Received RCSwitch Raw: protocol=3 data='11111100000'
[22:38:38.961][I][remote.rc_switch:261]: Received RCSwitch Raw: protocol=3 data='11111100000'
[22:38:40.260][I][remote.rc_switch:261]: Received RCSwitch Raw: protocol=3 data='11111100000'
[22:38:40.484][I][remote.rc_switch:261]: Received RCSwitch Raw: protocol=3 data='11111100000'
[22:38:42.509][I][remote.rc_switch:261]: Received RCSwitch Raw: protocol=6 data='000001111110'
[22:38:43.187][I][remote.rc_switch:261]: Received RCSwitch Raw: protocol=6 data='000001111110'
[22:38:45.033][I][remote.rc_switch:261]: Received RCSwitch Raw: protocol=3 data='11111100000'
[22:38:46.058][I][remote.rc_switch:261]: Received RCSwitch Raw: protocol=3 data='111111000001'
[22:39:08.924][I][remote.rc_switch:261]: Received RCSwitch Raw: protocol=3 data='11111100000'
[22:39:10.332][I][remote.rc_switch:261]: Received RCSwitch Raw: protocol=6 data='000001111110'
[22:39:11.357][I][remote.rc_switch:261]: Received RCSwitch Raw: protocol=6 data='000001111110'
[22:39:11.874][I][remote.rc_switch:261]: Received RCSwitch Raw: protocol=3 data='111111000001'
[22:39:12.883][I][remote.rc_switch:261]: Received RCSwitch Raw: protocol=6 data='000001111110'

As you can see, the code is more often than not captured as a protocol 3 code that is shifted from the configured code, while the transmitter is configured to transmit a protocol 6 code. Here is the configuration I am using for transmitting and receiving the codes (both devices are using the same configuration):

cc1101:
  cs_pin: GPIO15
  frequency: 303.875MHz

remote_receiver:
  pin: GPIO4
  dump: rc_switch
  # Settings to optimize recognition of RF devices
  tolerance: 50%
  filter: 250us
  idle: 4ms
  buffer_size: 2kb

# Example configuration entry
remote_transmitter:
  pin: GPIO5
  carrier_duty_percent: 100%
  on_transmit:
    then:
      - cc1101.begin_tx
  on_complete:
    then:
      - cc1101.begin_rx

button:
  - platform: template
    name: RF Light Button
    on_press:
       - remote_transmitter.transmit_rc_switch_raw:
          code: '000001111110'
          protocol: 6

My question are as follows:

  • Are these discrepancies between the receiver and transmitter normal?
  • Could the “wrong codes” being transmitted be the cause of my issues with using the ESPHome device to control the ceiling light?
  • Do you have any tips on capturing these codes from the remot? I tried using dump all. I saw some Pronto codes that are all different from line to line. Dumping those codes in IrScrutinizer doesn’t yield a decoded protocol… rc_switch is the only dump protocol I found that yields consistent codes for each button of the remote. Any tips on using the ESP8266 devices as capture hardware for IrScrutinizer?

Any pointers are appreciated. Thanks in advance!

I see few issues here.
Since CC1101 modules for 315mhz range are almost impossible to find, I expect you use module tuned for 433mhz. So capturing 303mhz signal is not optimal.

Then you use rc_switch dump with 50% tolerance, so the already bad signal can be 50% off between received and sent.
Also idle 4ms can break the signal in pieces. So you might send only one part of the signal or miss needed repeats.

Try with RAW and post the dump here from your logs.

  dump: raw
  # Settings to optimize recognition of RF devices
  # tolerance: 50%
  filter: 150us
  idle: 20ms
  buffer_size: 2kb

You are absolutely right. That’s strike one for me and a lesson learned to actually look at the board specs, not just the chip. The exact module is an E07-M1101D which, after checking the datasheet, sure enough advertises a frequency operating range of 387 to 464 MHz…

Still, I tried the receiver configuration you suggested and got those codes for two ~1-second presses of the same button:

[19:23:39.688][I][remote.raw:028]: Received Raw: 301, -381, 568, -364, 586, -364, 586, -371, 583, -359, 587, -694, 252, -709, 268, -670, 287, -674, 268, -703, 262, -690, 266, -370, 585, -11306, 289, -365, 566, -374, 591, -365, 567, -394, 575, -370, 567, -701, 268, -693, 264, -701, 242, 
[19:23:39.688][I][remote.raw:028]:   -708, 259, -700, 268, -676, 275, -390, 561, -11302, 285, -358, 591, -362, 587, -366, 595, -370, 567, -382, 570, -690, 268, -700, 256, -696, 247, -717, 262, -687, 261, -708, 269, -346, 583, -11313, 265, -364, 580, -393, 566, -391, 568, -373, 584, -368, 
[19:23:39.688][I][remote.raw:028]:   582, -695, 268, -696, 262, -674, 269, -700, 262, -698, 269, -673, 268, -386, 555, -11330, 260, -381, 566, -364, 584, -395, 572, -371, 567, -374, 591, -688, 270, -675, 275, -691, 267, -699, 264, -697, 270, -673, 269, -360, 581, -11310, 299, -346, 584, 
[19:23:39.764][I][remote.raw:028]:   -370, 585, -367, 590, -362, 587, -365, 585, -699, 252, -692, 264, -699, 263, -697, 270, -674, 268, -687, 274, -360, 592, -11296, 299, -347, 583, -369, 593, -375, 568, -363, 587, -364, 585, -697, 256, -692, 268, -702, 254, -707, 264, -681, 266, -707, 
[19:23:39.765][I][remote.raw:028]:   252, -367, 585, -11302, 259, -381, 589, -362, 587, -366, 571, -396, 568, -380, 570, -690, 269, -700, 252, -692, 269, -699, 264, -672, 295, -673, 269, -384, 578, -11288, 298, -347, 584, -367, 584, -368, 591, -362, 586, -365, 585, -698, 253, -691, 270, 
[19:23:39.765][I][remote.raw:028]:   -699, 263, -697, 270, -675, 267, -686, 252, -383, 591, -11321, 258, -353, 585, -364, 585, -369, 583, -370, 595, -377, 569, -691, 268, -675, 277, -700, 247, -692, 292, -671, 266, -703, 264, -359, 577, -11303, 298, -345, 582, -396, 568, -379, 570, -365, 
[19:23:39.837][I][remote.raw:028]:   590, -364, 585, -697, 254, -700, 247, -692, 287, -686, 262, -682, 295, -671, 283, -365, 564, -11306, 284, -356, 592, -364, 592, -367, 573, -371, 594, -352, 592, -690, 269, -677, 277, -692, 246, -720, 264, -696, 270, -673, 268, -360, 601, -11275, 282, 
[19:23:39.837][I][remote.raw:028]:   -355, 613, -364, 565, -369, 603, -372, 566, -372, 592, -690, 270, -678, 273, -692, 264, -695, 263, -685, 262, -709, 268, -347, 581, -11310, 268, -372, 577, -391, 565, -365, 594, -370, 569, -383, 573, -691, 268, -700, 254, -700, 247, -692, 291, -671, 
[19:23:39.837][I][remote.raw:028]:   293, -674, 268, -359, 578, -11312, 269, -378, 573, -370, 593, -377, 568, -364, 591, -366, 571, -705, 271, -691, 241, -716, 240, -710, 261, -680, 290, -684, 255, -366, 585, -11306, 284, -357, 593, -362, 587, -366, 569, -396, 568, -380, 574, -690, 269, 
[19:23:39.911][I][remote.raw:028]:   -679, 273, -699, 247, -693, 295, -667, 266, -682, 269, -390, 579, -11304, 258, -380, 563, -388, 586, -365, 585, -351, 586, -370, 598, -692, 261, -682, 268, -700, 257, -693, 269, -699, 264, -671, 293, -371, 573, -11298, 270, -370, 584, -370, 568, -382, 
[19:23:39.912][I][remote.raw:028]:   572, -364, 587, -364, 585, -694, 283, -675, 271, -699, 263, -673, 294, -679, 245, -693, 275, -387, 569, -11298, 298, -347, 583, -369, 571, -374, 592, -364, 592, -367, 571, -698, 247, -716, 263, -686, 261, -709, 269, -671, 283, -673, 269, -372, 572, 
[19:23:39.912][I][remote.raw:028]:   -11302, 299, -346, 573, -391, 580, -368, 565, -386, 587, -366, 586, -696, 244, -687, 265, -693, 263, -711, 262, -684, 267, -700, 255, -395, 562, -11306, 259, -380, 565, -389, 567, -370, 582, -397, 569, -379, 571, -690, 269, -676, 275, -695, 265, -697, 
[19:23:39.966][I][remote.raw:028]:   264, -698, 269, -673, 268, -359, 603, -11276, 300, -366, 557, -396, 574, -377, 569, -369, 592, -361, 573, -698, 270, -695, 264, -687, 262, -709, 264, -681, 264, -683, 275, -367, 584, -11290, 294, -344, 582, -396, 574, -377, 569, -365, 590, -365, 585, 
[19:23:39.966][I][remote.raw:028]:   -698, 253, -699, 245, -719, 264, -673, 294, -674, 267, -684, 250, -383, 591, -11298, 272, -351, 597, -388, 554, -391, 564, -388, 562, -370, 597, -696, 246, -718, 238, -698, 265, -697, 244, -708, 262, -701, 268, -375, 572, -11286, 284, -384, 569, -365, 
[19:23:39.981][I][remote.raw:028]:   592, -367, 571, -370, 588, -371, 592, -689, 269, -678, 272, -696, 250, -687, 291, -671, 266, -706, 246, -390, 582, -11285, 299, -347, 581, -360, 594, -380, 569, -390, 565, -366, 584, -698, 254, -692, 268, -703, 262, -674, 293, -673, 268, -688, 274, 
[19:23:40.066][I][remote.raw:028]:   -361, 591, -11297, 272, -375, 580, -371, 566, -399, 567, -362, 587, -364, 585, -697, 254, -699, 246, -720, 264, -673, 293, -673, 267, -687, 262, -374, 588, -11301, 268, -375, 572, -371, 591, -363, 587, -364, 587, -373, 584, -674, 269, -705, 261, -699, 
[19:23:40.066][I][remote.raw:028]:   268, -679, 272, -670, 273, -689, 295, -340, 585, -11304, 285, -349, 593, -369, 566, -389, 560, -392, 559, -378, 596, -690, 253, -709, 267, -699, 262, -671, 269, -703, 253, -709, 242, -372, 597, -11285, 263, -388, 572, -366, 587, -363, 585, -392, 559, 
[19:23:40.066][I][remote.raw:028]:   -383, 583, -697, 242, -706, 262, -700, 269, -677, 276, -694, 247, -691, 265, -381, 592, -11299, 272, -354, 573, -386, 573, -364, 587, -388, 562, -369, 582, -699, 268, -687, 289, -676, 268, -677, 275, -696, 246, -719, 263, -371, 568, -11308, 283, -348, 
[19:23:40.082][I][remote.raw:028]:   588, -369, 566, -391, 564, -396, 570, -369, 585, -695, 267, -697, 262, -674, 269, -700, 262, -674, 293, -672, 269, -385, 578, -11276, 292, -351, 584, -369, 598, -366, 583, -370, 565, -390, 565, -712, 262, -698, 247, -700, 263, -699, 268, -676, 276, 
[19:23:40.137][I][remote.raw:028]:   -689, 266, -370, 573, -11300, 298, -347, 574, -366, 600, -368, 563, -386, 586, -365, 585, -698, 251, -699, 246, -717, 239, -711, 262, -684, 267, -698, 255, -396, 564, -11290, 298, -346, 599, -369, 581, -368, 591, -363, 567, -368, 600, -696, 246, -691, 
[19:23:40.138][I][remote.raw:028]:   292, -671, 266, -699, 264, -682, 264, -689, 263, -384, 589, -11277, 295, -375, 576, -350, 592, -365, 591, -367, 572, -381, 590, -690, 265, -698, 267, -682, 252, -689, 266, -699, 268, -684, 266, -379, 589, -11289, 265, -381, 579, -362, 589, -377, 569, 
[19:23:40.188][I][remote.raw:028]:   -365, 590, -366, 571, -704, 273, -694, 247, -714, 240, -709, 262, -684, 268, -699, 253, -369, 586, -11291, 270, -374, 583, -373, 564, -373, 593, -363, 587, -364, 583, -710, 262, -689, 244, -705, 262, -700, 269, -677, 274, -670, 265, -392, 574, -11273, 
[19:23:40.189][I][remote.raw:041]:   294, -346, 596, -350, 591, -389, 564, -365, 582
[19:23:40.189][W][component:547]: remote_receiver took a long time for an operation (547 ms)
[19:23:40.197][W][component:550]: Components should block for at most 30 ms
[19:23:50.337][I][remote.raw:028]: Received Raw: 323, -360, 568, -372, 571, -392, 554, -393, 567, -393, 569, -701, 251, -695, 246, -720, 263, -671, 266, -698, 269, -688, 261, -376, 591, -11300, 297, -348, 569, -373, 590, -362, 585, -365, 594, -350, 599, -694, 264, -673, 295, -674, 267, 
[19:23:50.338][I][remote.raw:028]:   -686, 275, -684, 261, -683, 296, -345, 608, -11282, 267, -367, 583, -391, 568, -366, 598, -367, 566, -384, 575, -692, 267, -700, 252, -715, 242, -701, 254, -708, 238, -709, 265, -383, 560, -11314, 274, -370, 580, -368, 590, -363, 592, -341, 599, -368, 
[19:23:50.412][I][remote.raw:028]:   586, -695, 269, -673, 285, -678, 268, -699, 265, -672, 296, -675, 267, -359, 605, -11289, 276, -347, 603, -385, 552, -391, 567, -367, 571, -394, 574, -709, 261, -672, 266, -702, 241, -708, 265, -691, 260, -707, 265, -359, 595, -11282, 288, -368, 570, 
[19:23:50.413][I][remote.raw:028]:   -389, 563, -388, 586, -342, 604, -370, 570, -700, 267, -698, 263, -674, 269, -701, 263, -674, 295, -674, 268, -361, 602, -11283, 298, -323, 599, -394, 568, -380, 571, -365, 592, -366, 571, -698, 268, -687, 275, -688, 267, -696, 263, -697, 244, -705, 
[19:23:50.413][I][remote.raw:028]:   263, -372, 587, -11286, 288, -349, 592, -370, 589, -361, 587, -366, 595, -369, 574, -682, 265, -697, 266, -701, 243, -706, 262, -699, 270, -677, 274, -367, 583, -11287, 283, -354, 584, -389, 561, -393, 560, -395, 566, -382, 577, -691, 263, -699, 252, 
[19:23:50.449][I][remote.raw:028]:   -698, 246, -718, 240, -710, 261, -685, 268, -371, 584, -11315, 266, -356, 599, -366, 564, -389, 566, -370, 582, -397, 572, -678, 266, -696, 265, -683, 269, -690, 274, -686, 262, -684, 294, -346, 583, -11307, 268, -364, 580, -392, 565, -365, 596, -372, 
[19:23:50.465][I][remote.raw:028]:   586, -368, 583, -695, 267, -672, 284, -673, 269, -702, 263, -700, 269, -672, 266, -386, 578, -11287, 299, -350, 576, -374, 568, -373, 592, -366, 583, -367, 579, -683, 288, -676, 268, -702, 263, -699, 270, -676, 268, -687, 290, -347, 584, -11292, 298, 
[19:23:50.490][I][remote.raw:028]:   -349, 575, -373, 567, -390, 567, -395, 569, -368, 588, -694, 265, -700, 260, -685, 248, -709, 247, -710, 263, -711, 241, -373, 582, -11305, 263, -370, 574, -389, 587, -361, 590, -368, 574, -370, 588, -695, 270, -673, 284, -665, 268, -703, 263, -676, 
[19:23:50.543][I][remote.raw:028]:   296, -676, 268, -360, 604, -11286, 295, -324, 601, -371, 569, -375, 591, -364, 586, -364, 586, -697, 255, -699, 271, -692, 263, -687, 262, -683, 294, -670, 285, -372, 566, -11282, 282, -380, 563, -389, 566, -397, 570, -368, 585, -369, 591, -689, 270, 
[19:23:50.544][I][remote.raw:028]:   -673, 267, -690, 263, -701, 268, -677, 275, -691, 264, -372, 572, -11299, 299, -345, 586, -366, 596, -351, 594, -364, 586, -391, 567, -698, 252, -697, 247, -716, 239, -709, 261, -684, 294, -671, 283, -364, 564, -11308, 259, -380, 590, -365, 592, -366, 
[19:23:50.561][I][remote.raw:028]:   584, -370, 574, -380, 569, -690, 269, -699, 253, -698, 246, -695, 291, -671, 293, -673, 268, -360, 601, -11276, 282, -355, 586, -388, 585, -342, 609, -370, 573, -382, 571, -689, 269, -699, 252, -692, 268, -699, 264, -698, 268, -673, 267, -386, 556, 
[19:23:50.637][I][remote.raw:028]:   -11294, 297, -353, 573, -386, 574, -391, 564, -364, 584, -369, 584, -698, 268, -688, 262, -700, 269, -677, 274, -697, 246, -716, 239, -384, 592, -11274, 298, -348, 577, -376, 592, -365, 590, -367, 572, -369, 590, -700, 267, -674, 284, -674, 268, -703, 
[19:23:50.638][I][remote.raw:028]:   263, -698, 270, -678, 271, -368, 583, -11278, 283, -381, 562, -387, 561, -393, 585, -369, 572, -382, 571, -690, 269, -699, 252, -696, 265, -697, 264, -686, 267, -698, 264, -371, 567, -11289, 283, -380, 563, -387, 587, -365, 585, -369, 573, -382, 569, 
[19:23:50.638][I][remote.raw:028]:   -690, 268, -699, 257, -700, 247, -716, 240, -709, 261, -685, 268, -372, 598, -11278, 264, -388, 577, -365, 588, -365, 587, -373, 583, -367, 584, -695, 262, -710, 241, -699, 254, -722, 220, -721, 241, -712, 262, -382, 569, -11286, 277, -375, 585, -369, 
[19:23:50.711][I][remote.raw:028]:   591, -364, 592, -342, 600, -367, 583, -696, 270, -697, 264, -665, 268, -704, 264, -698, 270, -676, 268, -362, 603, -11288, 273, -351, 601, -360, 575, -392, 564, -391, 568, -372, 583, -695, 247, -721, 235, -699, 264, -697, 269, -686, 252, -710, 263, 
[19:23:50.712][I][remote.raw:028]:   -386, 565, -11298, 298, -336, 593, -379, 571, -364, 589, -363, 584, -370, 600, -670, 273, -687, 292, -671, 265, -699, 243, -706, 263, -700, 270, -352, 598, -11284, 282, -357, 589, -364, 589, -359, 584, -383, 582, -359, 584, -698, 267, -685, 262, -701, 
[19:23:50.712][I][remote.raw:028]:   272, -674, 276, -695, 263, -681, 268, -373, 584, -11292, 268, -372, 572, -392, 564, -388, 561, -394, 571, -369, 588, -696, 269, -671, 286, -687, 243, -705, 262, -701, 268, -676, 276, -368, 586, -11281, 298, -346, 576, -390, 580, -368, 566, -388, 587, 
[19:23:50.786][I][remote.raw:028]:   -367, 573, -698, 267, -688, 250, -710, 267, -696, 262, -699, 243, -703, 262, -374, 591, -11275, 287, -350, 593, -371, 590, -363, 591, -341, 607, -370, 576, -684, 291, -671, 267, -699, 266, -686, 263, -701, 273, -674, 275, -366, 584, -11277, 282, -354, 
[19:23:50.786][I][remote.raw:028]:   586, -387, 586, -365, 585, -350, 596, -365, 601, -691, 261, -683, 268, -703, 250, -699, 244, -719, 240, -710, 261, -385, 564, -11297, 296, -333, 593, -381, 570, -365, 587, -388, 561, -369, 596, -697, 247, -692, 291, -670, 267, -700, 244, -709, 263, 
[19:23:50.786][I][remote.raw:028]:   -700, 270, -352, 595, -11276, 285, -358, 593, -391, 562, -366, 571, -383, 584, -369, 593, -678, 265, -697, 268, -693, 244, -707, 262, -702, 266, -677, 275, -369, 587, -11292, 272, -352, 598, -363, 576, -392, 564, -388, 560, -392, 586, -676, 273, -696, 
[19:23:50.860][I][remote.raw:028]:   247, -691, 263, -710, 261, -684, 268, -697, 255, -395, 565, -11286, 298, -345, 583, -359, 590, -385, 570, -391, 565, -389, 560, -709, 263, -675, 268, -702, 263, -699, 268, -678, 273, -694, 247, -391, 571, -11299, 272, -353, 599, -363, 574, -391, 566, 
[19:23:50.861][I][remote.raw:028]:   -390, 566, -371, 583, -698, 244, -706, 262, -700, 268, -676, 274, -690, 265, -704, 260, -371, 586, -11275, 289, -376, 569, -370, 592, -359, 587, -364, 585, -372, 583, -698, 243, -707, 262, -701, 268, -678, 275, -694, 247, -690, 263, -385, 590, -11273, 
[19:23:50.861][I][remote.raw:028]:   298, -355, 572, -383, 573, -365, 586, -363, 585, -392, 587, -676, 275, -690, 241, -720, 264, -697, 268, -673, 268, -688, 261, -376, 586, -11274, 290, -373, 571, -373, 592, -363, 590, -368, 572, -394, 564, -697, 267, -696, 262, -698, 243, -702, 262, 
[19:23:50.935][I][remote.raw:028]:   -701, 268, -676, 274, -365, 583, -11280, 298, -346, 599, -369, 586, -368, 565, -391, 567, -370, 597, -695, 247, -692, 264, -697, 265, -700, 244, -705, 265, -690, 266, -370, 587, -11280, 277, -373, 588, -370, 565, -390, 565, -369, 603, -370, 566, -727, 
[19:23:50.936][I][remote.raw:028]:   237, -698, 264, -698, 243, -707, 262, -700, 268, -678, 274, -367, 586, -11281, 283, -354, 587, -364, 585, -369, 583, -396, 567, -381, 570, -693, 267, -700, 257, -701, 243, -718, 264, -672, 267, -698, 268, -359, 601, -11278, 271, -351, 597, -367, 578, 
[19:23:50.936][I][remote.raw:028]:   -391, 564, -388, 586, -368, 572, -697, 269, -698, 264, -698, 268, -673, 268, -686, 262, -701, 268, -374, 573, -11287, 294, -346, 572, -395, 566, -373, 591, -366, 591, -368, 573, -697, 268, -686, 262, -700, 269, -675, 276, -689, 265, -703, 260, -372, 
[19:23:51.009][I][remote.raw:028]:   586, -11285, 283, -348, 591, -370, 591, -362, 586, -364, 586, -372, 584, -695, 247, -716, 239, -709, 262, -683, 268, -699, 255, -699, 246, -394, 573, -11301, 272, -352, 598, -363, 574, -393, 563, -385, 587, -368, 573, -696, 270, -698, 264, -697, 268, 
[19:23:51.009][I][remote.raw:028]:   -672, 268, -686, 262, -702, 268, -352, 595, -11280, 284, -359, 592, -364, 586, -364, 585, -369, 583, -370, 596, -680, 292, -671, 267, -701, 243, -706, 263, -675, 295, -677, 272, -367, 584, -11285, 273, -373, 582, -360, 591, -380, 570, -391, 564, -365, 
[19:23:51.009][I][remote.raw:028]:   585, -696, 256, -692, 263, -706, 262, -700, 269, -676, 274, -696, 247, -390, 568, -11300, 272, -352, 597, -363, 578, -392, 565, -389, 561, -396, 576, -672, 269, -703, 263, -701, 266, -677, 272, -695, 247, -694, 289, -371, 568, -11280, 276, -371, 586, 
[19:23:51.064][I][remote.raw:028]:   -370, 590, -363, 586, -365, 585, -373, 583, -685, 267, -689, 275, -687, 262, -685, 267, -697, 259, -699, 268, -373, 571, -11302, 272, -352, 598, -363, 574, -392, 563, -388, 586, -368, 570, -713, 241, -706, 263, -700, 268, -679, 271, -695, 247, -692, 
[19:23:51.064][I][remote.raw:028]:   265, -370, 586, -11283, 277, -372, 589, -371, 590, -364, 591, -368, 571, -395, 567, -680, 265, -697, 266, -682, 269, -688, 275, -689, 262, -685, 293, -369, 560, -11294, 267, -373, 576, -391, 567, -386, 564, -392, 576, -370, 569, -702, 267, -697, 262, 
[19:23:51.089][I][remote.raw:041]:   -683, 267, -687, 290, -674, 269, -700, 254, -695, 247, -11303, 259, -379, 563, -388, 585, -365, 587, -373, 573, -390, 578, -669, 294, -671, 282, -673, 268, -702, 252, -708, 267, -697, 263, -674, 268
[19:23:51.107][W][component:547]: remote_receiver took a long time for an operation (783 ms)
[19:23:51.107][W][component:550]: Components should block for at most 30 ms

Again, IrScrutinizer is no help with these codes. I’ve also found many other posts of people trying this very setup and concluding that it is either not feasible with the 433 MHz CC1101 boards, or not worth the trouble when devices like the Sonoff iFan04 exist :sweat_smile:

Your reception is not so bad. There’s lot of drift, but I’m pretty sure we can make it work.
If I take the signal like you received it and clean it just a little bit, you could send it like this:

- remote_transmitter.transmit_raw:
    code: [300, -350, 580, -370, 580, -370, 580, -370, 580, -370, 580, -700, 270, -700, 270, -700, 270, -700, 270, -700, 270, -700, 270, -350, 600, -11300]
    repeat:
      times: 10 #probably 3 would be enough
      wait_time: 0ms

But I believe it was originally built with timings like this:

code: [300, -300, 600, -300, 600, -300, 600, -300, 600, -300, 600, -600, 300, -600, 300, -600, 300, -600, 300, -600, 300, -600, 300, -300, 600, -11400]

You can try them both. Let me know…

1 Like

The first codes you shared worked! From there, I just assumed that the first and last codes would always be the same, and that the length of the code would be constant. From there, I was able to successfully capture and transmit the codes from the CC1101. A massive thank you for all your help so far, but I do have some follow up questions for my own autonomy, if you would be so kind:

  • How did you figure out the code length? Was it just the pattern of starting with ~300 and ending with a stand out negative number around -11000, or is there some innate arcane knowledge about these remote controls?
  • Do you know of any good online resources for these kind of remote controls?

If anyone stumbles on this post with a similar problem, here’s the ESPHome configuration I ended up with:

cc1101:
  cs_pin: GPIO15 # Replace with your CS pin
  frequency: 303.875MHz

# Receiver configs used to capture the codes
remote_receiver:
  pin: GPIO4 # Replace with one of your CC1101 output pins
  dump: raw
  filter: 150us
  idle: 20ms
  buffer_size: 2kb

# ESPHome recommended dual pin CC1101 setup
remote_transmitter:
  pin: GPIO5 # Replace with the other CC1101 output pin
  carrier_duty_percent: 100%
  on_transmit:
    then:
      - cc1101.begin_tx
  on_complete:
    then:
      - cc1101.begin_rx

# Todo: Make the light button into on/off switch and find a way to represent the fan speed setting better instead of individual stateless button for each speed
button:
  - platform: template
    name: RF Light Button
    on_press:
      - remote_transmitter.transmit_raw:
          code: [300, -350, 580, -370, 580, -370, 580, -370, 580, -370, 580, -700, 270, -700, 270, -700, 270, -700, 270, -700, 270, -700, 270, -350, 600, -11300]
          repeat:
            times: 3
            wait_time: 0ms
  - platform: template
    name: Fan Off
    on_press:
      - remote_transmitter.transmit_raw:
          code: [300, -370, 580, -370, 570, -390, 560, -390, 560, -390, 570, -710, 240, -700, 270, -700, 240, -710, 260, -700, 270, -350, 590, -690, 250, -11300]
          repeat:
            times: 3
            wait_time: 0ms
  - platform: template
    name: Fan Lo
    on_press:
      - remote_transmitter.transmit_raw:
          code: [300, -370, 590, -370, 570, -370, 590, -350, 600, -360, 580, -690, 270, -700, 250, -700, 250, -390, 570, -700, 260, -680, 280, -700, 250, -11300]
          repeat:
            times: 3
            wait_time: 0ms
  - platform: template
    name: Fan Med
    on_press:
      - remote_transmitter.transmit_raw:
          code: [300, -370, 560, -390, 560, -390, 560, -370, 580, -390, 560, -720, 240, -690, 260, -380, 570, -690, 260, -720, 220, -710, 250, -720, 260, -11300]
          repeat:
            times: 3
            wait_time: 0ms
  - platform: template
    name: Fan Hi
    on_press:
      - remote_transmitter.transmit_raw:
          code: [300, -350, 580, -390, 560, -360, 590, -370, 590, -370, 570, -700, 260, -380, 560, -690, 260, -700, 240, -710, 260, -700, 270, -670, 270, -11300]
          repeat:
            times: 3
            wait_time: 0ms

These worked for my GE branded fan (I recently moved in to this house, so I don’t have the exact model). The remote control I was able to clone is from Rhine Electronic Co. Ltd Model # UC7070T. The controller has dip switches to match the controller to a specific device. In my case, all four switches were in the up position. I’m sure different dip switch positions will yield different codes (probably some sort of bit mask, and there’s probably a clever way to parameterize the dip switch settings :thinking: ). Here’s a picture of the fan and controller, all merged into 1 image as I cannot embed more than 1 image as a new user…

The performance of the little E07-M1101D module is surprisingly good for working outside of its specified range. It’s able to control the ceiling fan from a good 15ft away through closed cabinets.

Just looking at the raw signal.
Yours is pretty clean and short, so it’s not too hard (not always the case).
That 11ms gap is starting new signal.
I can see right away it could not be decoded with standard rc_switch protocols, so raw is the way to go here.

No I don’t. Just google how OOK signals are structured, about pulse distance encoding, pulse length encoding…
These are pretty similar to common IR signals at the end…

ps. thank’s to this capture, we know now that successful rx and tx are possible even if antenna circuit is tuned >100mhz off from original one. The range is probably reduced though.

Edit:
I analyzed the signal little bit further. While I believe the designer of the remote control coded it for 300us tics, counting the timings from your signal, it’s actually 320us. Cheap components of the remote are causing small drift, but the original receiver is tuned to that. Your remote sends 320/640 timings.
Now your CC1101 receives it, but there is quite considerable drift from HIGH to LOW pulses and 320, -320 becomes 270, -370. That’s likely acceptable if the total signal length doesn’t change too much. But there’s the final step, transmitting, and we don’t know the drift there, neither direction. I could drift further H>>L to 220, -420 or from L>>H correcting the first drift back to 320, -320.
Since the first code I posted worked, likely there is not significant change on TX or the change is in L>>H direction.
The most correct signal I could think here is:
code: [320, -320, 640, -320, 640, -320, 640, -320, 640, -320, 640, -640, 320, -640, 320, -640, 320, -640, 320, -640, 320, -640, 320, -320, 640, -11200]

We could also interpret this as rc_switch protocol 6 style inverted signal, starting reading from gap (synch), then it would become:
code: [-11200, 320, -320, 640, -320, 640, -320, 640, -320, 640, -320, 640, -640, 320, -640, 320, -640, 320, -640, 320, -640, 320, -640, 320, -320, 640]
What are your dip-switch positions?

Thanks for the pointers on further resources!

I will definitely keep this in mind should I start having issues with the codes I currently have programmed.

All four dip switches are in what I’m calling the up position. Picture for reference:

If you are happy with working solution, no need to spend time on this. Just capture every button press and you are god to go.
If you want to decode the signal, some extra effort is needed.