Kincony kc868-ag and RCSwitch

I bought an RF blaster from Kincony and configured it in the ESPHome dashboard.

remote_transmitter:
  - id: transmitter_ir
    pin: GPIO2
    carrier_duty_percent: 50%
  - id: transmitter_rf
    pin: GPIO22
    carrier_duty_percent: 50%

remote_receiver:
  # see https://esphome.io/components/remote_transmitter.html#setting-up-infrared-devices
  # for details on discovering the correct codes for your devices
  - id: receiver_ir
    pin:
      number: GPIO23
      inverted: True
    dump: rc_switch

  # see https://esphome.io/components/remote_transmitter.html#setting-up-rf-devices
  # for details on discovering the correct codes for your devices
  - id: receiver_rf
    pin:
      number: GPIO13
    dump: rc_switch
    # Settings to optimize recognition of RF devices
    tolerance: 50%
    filter: 250us
    idle: 4ms
    buffer_size: 2kb

button:
  - platform: template
    name: Living Fan Power button
    on_press:
      - remote_transmitter.transmit_rc_switch_raw:
          transmitter_id: transmitter_ir
          code: '00010001000100010111110001101111'
          protocol: 1
          repeat:
            times: 3
            wait_time: 0s
  - platform: template
    name: Living Fan Light button
    on_press:
      - remote_transmitter.transmit_rc_switch_raw:
          transmitter_id: transmitter_ir
          code: '00001100000011000111110001101111'
          protocol: 1
          repeat:
            times: 4
            wait_time: 0s

When I tried to capture the code it showed me the following values.

on
[18:41:27][I][remote.rc_switch:261]: Received RCSwitch Raw: protocol=1 data='00001100000011000111110001101111'
[18:41:28][I][remote.rc_switch:261]: Received RCSwitch Raw: protocol=1 data='00001100000011000111110001101111'
[18:41:28][I][remote.rc_switch:261]: Received RCSwitch Raw: protocol=1 data='00001100000011000111110001101111'
[18:41:28][I][remote.rc_switch:261]: Received RCSwitch Raw: protocol=1 data='00001100000011000111110001101111'
[18:41:28][I][remote.rc_switch:261]: Received RCSwitch Raw: protocol=1 data='0000110000001100011111000110111'

off
[18:41:46][I][remote.rc_switch:261]: Received RCSwitch Raw: protocol=1 data='00001100000011000111110001101111'
[18:41:46][I][remote.rc_switch:261]: Received RCSwitch Raw: protocol=1 data='00001100'
[18:41:46][I][remote.rc_switch:261]: Received RCSwitch Raw: protocol=1 data='00001100000011000111110001101111'

I used the most repeated code and added that to the yaml. However, that will do nothing and also won’t repeat like I’m asking it to.

Here is the output of the button press.

[18:46:23][D][button:010]: 'Living Fan Light button' Pressed.
[18:46:24][W][component:237]: Component api took a long time for an operation (229 ms).
[18:46:24][W][component:238]: Components should block for at most 30 ms.
[18:46:24][I][remote.rc_switch:261]: Received RCSwitch Raw: protocol=1 data='00001100000011000111110001101111'
[18:46:24][I][remote.rc_switch:261]: Received RCSwitch Raw: protocol=1 data='00001100000011000111110001101111'
[18:46:24][I][remote.rc_switch:261]: Received RCSwitch Raw: protocol=1 data='00001100000011000111110001101111'
[18:46:24][I][remote.rc_switch:261]: Received RCSwitch Raw: protocol=1 data='0000110000001100011111000110111'

What also happens is that it changes the code when I press the remote button (not HA) multiple times.

second on
[18:42:14][I][remote.rc_switch:261]: Received RCSwitch Raw: protocol=1 data='00001100000011000111110001101111'
[18:42:14][I][remote.rc_switch:261]: Received RCSwitch Raw: protocol=1 data='00001100000011000111110001101111'
[18:42:15][I][remote.rc_switch:261]: Received RCSwitch Raw: protocol=1 data='00001100000011000111110001101111'
[18:42:15][I][remote.rc_switch:261]: Received RCSwitch Raw: protocol=1 data='0000110000001100011111000110111'

second off
[18:42:38][I][remote.rc_switch:261]: Received RCSwitch Raw: protocol=1 data='00001100000011000111110001101111'
[18:42:38][I][remote.rc_switch:261]: Received RCSwitch Raw: protocol=1 data='00001100000011000111110001101111'
[18:42:38][I][remote.rc_switch:261]: Received RCSwitch Raw: protocol=1 data='00001100000011000111110001101111'
[18:42:38][I][remote.rc_switch:261]: Received RCSwitch Raw: protocol=1 data='0000110000001100011111000110111'

It is a remote for a DC fan. I’m pretty new to this and I think I’m doing something wrong. Can someone please help me with this?

RF transmitter needs to have carrier_duty_percent: 100%
Also try 5 repeats since your first log has that.
Be aware that rc-switch protocols are general timing presets, even if you original remote doesn’t match to these, rc-switch is forcing it to best matching protocol.
So you could try with RAW dump.

Thank you for your advice. I did change it to 5 repeats

[11:02:36][D][button:010]: 'Living Fan Light button' Pressed.
[11:02:37][W][component:237]: Component api took a long time for an operation (287 ms).
[11:02:37][W][component:238]: Components should block for at most 30 ms.
[11:02:37][I][remote.rc_switch:261]: Received RCSwitch Raw: protocol=1 data='00001100000011000111110001101111'
[11:02:37][I][remote.rc_switch:261]: Received RCSwitch Raw: protocol=1 data='00001100000011000111110001101111'
[11:02:37][I][remote.rc_switch:261]: Received RCSwitch Raw: protocol=1 data='00001100000011000111110001101111'
[11:02:37][I][remote.rc_switch:261]: Received RCSwitch Raw: protocol=1 data='00001100000011000111110001101111'
[11:02:37][I][remote.rc_switch:261]: Received RCSwitch Raw: protocol=1 data='000011000000110001111'

Still nothing. I changed the signal strength to 100%, then all I see I the log is

[11:07:16][D][button:010]: 'Living Fan Light button' Pressed.
[11:07:16][W][component:237]: Component api took a long time for an operation (286 ms).
[11:07:16][W][component:238]: Components should block for at most 30 ms.

Nothing about receiving the code. I tried using raw. However, the logs are so chatty that I’m unsure what code I’m looking at. I can’t even capture the raw of the remote press because 100 others are already there in the log.

I did try to capture this.

[11:13:49][I][remote.raw:028]: Received Raw: 388, -796, 367, -811, 338, -851, 324, -859, 879, -306, 861, -320, 266, -908, 269, -895, 279, -890, 288, -885, 291, -876, 295, -877, 877, -309, 859, -324, 261, -903, 278, -893, 282, -886, 871, -308, 863, -310, 861, -320, 853, -317, 858, 
[11:13:49][I][remote.raw:041]:   -321, 263, -907, 268, -905, 272, -902, 843, -348, 829, -1501, 854, -315, 855, -326, 850, -319, 857, -320, 263
[11:13:49][I][remote.raw:028]: Received Raw: 324, -850, 321, -850, 321, -853, 321, -853, 898, -281, 890, -287, 294, -882, 295, -876, 297, -872, 303, -871, 300, -870, 306, -866, 887, -293, 879, -295, 288, -892, 286, -882, 294, -877, 881, -299, 872, -300, 870, -311, 864, -310, 861, 
[11:13:49][I][remote.raw:041]:   -315, 272, -903, 273, -888, 291, -883, 872, -312, 862, -307, 279, -895, 867, -303, 868, -308, 863, -316, 856, -324, 260
[11:13:49][I][remote.raw:028]: Received Raw: 333, -840, 330, -845, 325, -848, 321, -854, 899, -282, 883, -294, 291, -882, 293, -878, 298, -873, 303, -867, 305, -868, 305, -867, 885, -294, 880, -300, 283, -887, 292, -879, 297, -876, 876, -300, 873, -308, 864, -309, 862, -325, 849, 
[11:13:49][I][remote.raw:041]:   -312, 274, -898, 279, -888, 290, -883, 872, -306, 867, -314, 270, -897, 869, -305, 865, -310, 863, -313, 859, -317, 272
[11:13:49][I][remote.raw:028]: Received Raw: 330, -844, 326, -847, 322, -850, 324, -852, 898, -284, 884, -293, 290, -882, 297, -872, 302, -873, 298, -875, 298, -868, 307, -869, 885, -292, 873, -308, 278, -896, 283, -888, 284, -883, 880, -295, 872, -305, 869, -311, 862, -310, 861, 
[11:13:49][I][remote.raw:041]:   -312, 275, -904, 272, -894, 281, -889, 873, -301, 870, -307, 275, -898, 867, -303, 867, -313, 860, -314, 858, -320, 264
[11:13:49][I][remote.raw:028]: Received Raw: 336, -842, 327, -848, 324, -848, 322, -852, 899, -282, 887, -293, 289, -879, 298, -878, 295, -876, 300, -873, 297, -875, 298, -874, 882, -295, 878, -297, 290, -884, 290, -880, 295, -874, 883, -299, 872, -305, 866, -311, 861, -310, 861, 
[11:13:49][I][remote.raw:041]:   -319, 266, -908, 269, -901, 276, -890, 871, -306, 865, -308, 278, -892, 870, -307, 863, -314, 861, -311, 861
[11:13:49][I][remote.raw:041]: Received Raw: -88
[11:13:49][I][remote.raw:041]: Received Raw: -234
[11:13:49][I][remote.raw:041]: Received Raw: -99
[11:13:50][I][remote.raw:028]: Received Raw: -9428, 382, -5513, 490, -1725, 483, -1764, 286, -1956, 358, -2453, 336, -3528, 492, -1254, 396, -2354, 429, -853, 1291, -707, 756, -3649, 329, -606, 1263, -6008, 603, -1458, 822, -522, 1265, -856, 637, -387, 278, -380, 928, -1157, 578, 
[11:13:50][I][remote.raw:041]:   -743, 402, -520, 2086, -268, 857, -1183, 409, -259, 491, -974, 957, -757, 1143, -995, 1398, -797, 2208, -1184, 352, -430, 304, -739, 3771
[11:13:50][I][remote.raw:041]: Received Raw: -141, 1896, -728, 840, -341, 588, -1333, 1937, -809, 875, -1547, 362, -608, 937, -314, 3970, -473, 1203, -738, 1370, -829, 1980, -1505, 2622, -404, 409, -8020, 927, -609, 1595, -255, 610, -561, 2471, -330, 1733, -289
[11:13:51][I][remote.raw:028]: Received Raw: -573, 1308, -728, 4006, -262, 1477, -1196, 549, -415, 1119, -324, 2038, -911, 955, -436, 1955, -909, 4064, -559, 3599, -313, 327, -560, 1438, -661, 2750, -923, 1238, -1951, 1011, -1493, 836, -255, 629, -594, 1214, -390, 2287, -300, 2237, 
[11:13:51][I][remote.raw:028]:   -809, 4405, -958, 403, -284, 693, -426, 281, -361, 2131, -656, 412, -351, 805, -414, 2533, -561, 1605, -277, 266, -2731, 928, -637, 267, -509, 2515, -463, 694, -256, 2209, -300, 1075, -998, 2773, -1578, 742, -1148, 3349, -505, 2555, -259, 1894, -772, 
[11:13:51][I][remote.raw:041]:   720, -1328, 1879, -313, 4226, -382, 257, -1595, 1218, -4253, 322, -524, 840, -877, 432, -266, 752

Is there an easier way to find out which one is which from the raw code?

You could try with that.

- remote_transmitter.transmit_raw:
          code: [333, -840, 330, -845, 325, -848, 321, -854, 899, -282, 883, -294, 291, -882, 293, -878, 298, -873, 303, -867, 305, -868, 305, -867, 885, -294, 880, -300, 283, -887, 292, -879, 297, -876, 876, -300, 873, -308, 864, -309, 862, -325, 849, -312, 274, -898, 279, -888, 290, -883, 872, -306, 867, -314, 270, -897, 869, -305, 865, -310, 863, -313, 859, -317, 272]
          repeat:
            times: 5
            wait_time: 0s

Did you change duty to 100%?

- id: transmitter_rf
    pin: GPIO22
    carrier_duty_percent: 100%

Thank you for this. However, still nothing.

[17:35:36][D][button:010]: 'Living Fan Light button' Pressed.
[17:35:36][W][component:237]: Component api took a long time for an operation (194 ms).
[17:35:36][W][component:238]: Components should block for at most 30 ms.
[17:35:36][I][remote.raw:028]: Received Raw: -2840, 1799, -293, 441, -908, 3385, -688, 2602, -562, 483, -282, 5247, -522, 3508, -285, 842, -848, 4607, -774, 304, -281, 284, -586, 617, -654, 1751, -518, 403, -369, 1263, -3514, 319, -2212, 2701, -333, 4217, -685, 1717, -277, 1272, 
[17:35:36][I][remote.raw:028]:   -1193, 1200, -1797, 2537, -1193, 1745, -752, 507, -652, 975, -2282, 1140, -1104, 694, -1800, 4080, -712, 283, -292, 323, -865, 1687, -1321, 2046, -1309, 317, -570, 1109, -318, 700, -312, 1000, -354, 4354, -637, 352, -265, 1347, -277, 3029, -565, 1628, 
[17:35:36][I][remote.raw:041]:   -397, 382, -1031, 2306, -1083, 532, -408, 274, -477, 1496, -505, 400, -286, 1158, -553, 1445, -502, 1018, -525
[17:35:36][W][component:237]: Component remote_receiver took a long time for an operation (71 ms).
[17:35:36][W][component:238]: Components should block for at most 30 ms.
[17:35:36][I][remote.raw:041]: Received Raw: -94
[17:35:36][I][remote.raw:041]: Received Raw: -1953
[17:35:36][I][remote.raw:041]: Received Raw: -2663
[17:35:43][I][remote.raw:028]: Received Raw: -2819, 520, -14267, 284, -4283, 616, -2569, 907, -3275, 381, -398, 456, -5927, 929, -2741, 276, -337, 723, -644, 1003, -879, 905, -652, 1507, -880, 387, -1533, 302, -1950, 514, -3161, 389, -707, 954, -447, 265, -511, 1447, -1936, 512, -260, 
[17:35:43][I][remote.raw:028]:   652, -401, 428, -873, 2064, -648, 599, -289, 826, -741, 254, -1220, 2187, -884, 749, -633, 923, -605, 11971, -1170, 6542, -403, 719, -251, 353, -1729, 5332, -865, 871, -251, 842, -1530, 2255, -1010, 1173, -890, 388, -522, 2172, -395, 334, -2616, 287, 
[17:35:43][I][remote.raw:041]:   -294, 254, -278, 2135, -325, 790, -348, 789, -1355, 1171, -683, 433, -988, 729, -545, 1453, -300, 275, -359, 729, -461

Yes I did change the yaml to the below.

remote_transmitter:
  - id: transmitter_ir
    pin: GPIO2
    carrier_duty_percent: 50%
  - id: transmitter_rf
    pin: GPIO22
    carrier_duty_percent: 100%

remote_receiver:
  # see https://esphome.io/components/remote_transmitter.html#setting-up-infrared-devices
  # for details on discovering the correct codes for your devices
  - id: receiver_ir
    pin:
      number: GPIO23
      inverted: True
    dump: raw

  # see https://esphome.io/components/remote_transmitter.html#setting-up-rf-devices
  # for details on discovering the correct codes for your devices
  - id: receiver_rf
    pin:
      number: GPIO13
    dump: raw
    # Settings to optimize recognition of RF devices
    tolerance: 50%
    filter: 250us
    idle: 4ms
    buffer_size: 2kb

button:
  - platform: template
    name: Living Fan Power button
    on_press:
      - remote_transmitter.transmit_rc_switch_raw:
          transmitter_id: transmitter_rf
          code: '00010001000100010111110001101111'
          protocol: 1
          repeat:
            times: 3
            wait_time: 0s
  - platform: template
    name: Living Fan Light button
    on_press:
      - remote_transmitter.transmit_raw:
          transmitter_id: transmitter_rf
          code: [333, -840, 330, -845, 325, -848, 321, -854, 899, -282, 883, -294, 291, -882, 293, -878, 298, -873, 303, -867, 305, -868, 305, -867, 885, -294, 880, -300, 283, -887, 292, -879, 297, -876, 876, -300, 873, -308, 864, -309, 862, -325, 849, -312, 274, -898, 279, -888, 290, -883, 872, -306, 867, -314, 270, -897, 869, -305, 865, -310, 863, -313, 859, -317, 272]
          repeat:
            times: 5
            wait_time: 0s        

Do you have idea for this warning after button press?
I would expect some info log for transmission, something like this:
[remote_transmitter:075]: Sending remote code…

I saw someone on ESPHome git saying it was a debugging issue. But then there are like 100s of people posting all different Yamls and saying they, too, have it, and the last entry there is an RF remote. So not so sure what it is about. I even tried using a different remote, and it is still the same. Going to return this one and get a different one. Maybe a BOND or Broadlink.