DC ceiling fan RF

Hi,

I have a DC ceiling fan with a remote control.

With the Sonoff RF bridge original firmware I could clone the buttons and it worked fine.
But when I tried with tasmota, esphome and Portisch firmware It is impossible :frowning:

With ESPhome remote_receiver when I press the speed button 1 there is like a rotation code every press that it repeats every 4 press

[09:18:11][D][remote.rc_switch:261]: Received RCSwitch Raw: protocol=1 data='010001001011011100101'
[09:18:14][D][remote.rc_switch:261]: Received RCSwitch Raw: protocol=1 data='010111001011111100110'
[09:18:16][D][remote.rc_switch:261]: Received RCSwitch Raw: protocol=1 data='001101001010011100011'
[09:18:18][D][remote.rc_switch:261]: Received RCSwitch Raw: protocol=1 data='010011001010111100100'
[09:18:19][D][remote.rc_switch:261]: Received RCSwitch Raw: protocol=1 data='010001001011011100101'

I have connect a logic analyzer on pin DAT of the receiver


The first part is the same for every button pressed (I guess) and the second part is different.
And it keeps repeating until the button on the remote is released.
imatge

If I connect the ESPhome remote_transmitter pin directly to the output of the board receiver (DAT) pin I got the same codes “010001001011011100101”

It is possible that the Received RCSwitch Raw code there is something missing? May be the protocol is not standard?

I would like to try at last

  • remote_transmitter.transmit_raw:
    code: [4088, -1542, 1019, -510, 513, -1019, …

Capture RAW is crazy because I got lot of noise and don’t know with values are the good ones.

Thanks in advance.

1 Like

Finally I managed to generate the raw code from the signal captured by the logic analyzer (configuring parameters I managed to obtain a very clean signal). Also with an optocoupler I managed to see if the fan is on or off.

remote_transmitter:
  #pin: D1 #vell
  pin: D5 #nou
  # RF uses a 100% carrier signal
  carrier_duty_percent: 100%


#for raw code
switch:
  - platform: template
    name: power raw
    turn_on_action:
      - remote_transmitter.transmit_raw:
          code: [2415, -2178, 4345, -32179, 442, -2178, 2174, -4353, 8632, -10940, 2151, -4372, 2160, -2192, 2163, -25156, 931, -4352, 10806, -4455, 5719, -5808, 350, -632, 653, -331, 350, -631, 353, -627, 357, -623, 663, -321, 662, -324, 357, -632, 662, -321, 662, -323, 661, -324, 658, -326, 355, -626, 659, -325, 356, -626, 358, -631, 362, -619, 666, -318, 362, -620, 363, -619, 366, -614, 369, -612, 674, -311, 670, -317, 6122, -5798, 357, -624, 662, -324, 357, -625, 358, -623, 362, -618, 668, -318, 665, -319, 360, -628, 666, -318, 664, -320, 662, -323, 660, -325, 356, -624, 662, -323, 358, -622, 362, -628, 364, -617, 669, -315, 364, -618, 366, -615, 368, -613, 370, -612, 674, -312, 669, -317, 6121, -5797] 

  - platform: template
    name: boto1 raw
    turn_on_action:
      - remote_transmitter.transmit_raw:
          code: [848, -2222, 4313, -32087, 536, -2194, 2162, -4362, 8625, -10942, 2149, -4373, 2159, -2192, 2162, -25157, 927, -4350, 10804, -4394, 5719, -5805, 653, -333, 347, -631, 656, -330, 351, -628, 356, -625, 661, -324, 658, -326, 355, -633, 662, -323, 357, -624, 361, -621, 664, -319, 362, -620, 665, -319, 362, -619, 364, -624, 670, -315, 666, -318, 664, -320, 361, -621, 362, -619, 365, -615, 669, -315, 668, -318, 6118, -5797, 659, -328, 352, -627, 659, -325, 356, -625, 358, -623, 663, -320, 663, -323, 357, -632, 662, -323, 358, -623, 361, -619, 666, -319, 362, -618, 668, -318, 362, -619, 364, -625, 669, -315, 666, -318, 664, -320, 360, -620, 363, -618, 366, -614, 670, -314, 668, -318, 6117, -5798]

  - platform: template
    name: boto2 raw
    turn_on_action:
      - remote_transmitter.transmit_raw:
          code: [418, -2208, 4320, -32382, 236, -2189, 2164, -4360, 8625, -10939, 2146, -4373, 2158, -2194, 2159, -25161, 919, -4353, 10800, -4399, 5723, -5801, 355, -628, 356, -624, 662, -323, 658, -326, 355, -625, 661, -325, 355, -625, 359, -630, 362, -620, 363, -618, 366, -613, 370, -612, 673, -311, 369, -612, 674, -312, 368, -621, 370, -611, 675, -310, 672, -312, 669, -315, 364, -617, 366, -615, 369, -612, 672, -313, 6121, -5796, 358, -624, 359, -621, 665, -318, 663, -321, 359, -621, 664, -321, 358, -621, 363, -627, 364, -617, 366, -615, 368, -613, 370, -611, 675, -311, 368, -613, 672, -312, 368, -621, 371, -611, 674, -311, 670, -314, 668, -317, 363, -618, 366, -614, 369, -612, 674, -312, 6121, -5796]

 - platform: template
    name: boto3 raw
    turn_on_action:
      - remote_transmitter.transmit_raw:
          code: [250, -2209, 4322, -32222, 393, -2189, 2165, -4358, 8626, -10938, 2149, -4373, 2158, -2192, 2162, -25162, 919, -4350, 10803, -4461, 5720, -5804, 351, -631, 656, -329, 352, -627, 356, -625, 359, -620, 665, -320, 359, -620, 364, -625, 669, -315, 666, -319, 663, -320, 662, -321, 660, -325, 356, -624, 662, -323, 357, -632, 361, -619, 666, -319, 361, -620, 364, -617, 366, -614, 369, -613, 370, -611, 675, -309, 6122, -5795, 359, -624, 662, -323, 358, -623, 362, -619, 364, -615, 669, -317, 364, -617, 366, -623, 671, -313, 669, -315, 665, -319, 663, -320, 662, -324, 357, -623, 663, -321, 359, -630, 362, -619, 666, -318, 363, -618, 365, -615, 368, -614, 369, -612, 371, -609, 676, -310, 6123, -5795]


  - platform: template
    name: boto4 raw
    turn_on_action:
      - remote_transmitter.transmit_raw:
          code: [452, -2191, 4334, -32228, 383, -2182, 2169, -4355, 8625, -10936, 2150, -4372, 2158, -2192, 2160, -25144, 933, -4349, 10800, -4470, 5716, -5803, 352, -631, 655, -330, 351, -628, 355, -625, 359, -623, 360, -619, 666, -318, 362, -627, 666, -317, 665, -319, 663, -321, 358, -623, 663, -321, 359, -621, 362, -618, 365, -625, 366, -613, 672, -313, 366, -614, 369, -612, 672, -312, 669, -314, 668, -317, 665, -320, 6114, -5798, 355, -627, 658, -326, 355, -625, 358, -623, 362, -619, 364, -617, 668, -317, 364, -624, 669, -315, 666, -318, 664, -320, 359, -620, 665, -319, 361, -620, 363, -618, 365, -624, 369, -612, 672, -313, 366, -614, 369, -611, 674, -312, 670, -313, 668, -317, 665, -320, 6114, -5797]

  - platform: template
    name: boto5 raw
    turn_on_action:
      - remote_transmitter.transmit_raw:
          code: [3530, -2217, 4314, -32139, 484, -2173, 2176, -4350, 8629, -10935, 2150, -4372, 2158, -2192, 2160, -25147, 932, -4349, 10800, -4443, 5719, -5803, 351, -632, 352, -628, 355, -625, 359, -621, 362, -618, 668, -317, 664, -320, 663, -330, 358, -621, 362, -619, 666, -318, 664, -320, 662, -323, 357, -623, 663, -320, 662, -331, 659, -325, 356, -625, 358, -623, 362, -619, 364, -617, 366, -614, 670, -314, 366, -615, 6121, -5793, 359, -624, 361, -620, 363, -618, 365, -615, 368, -613, 671, -313, 669, -315, 665, -327, 362, -619, 364, -617, 669, -314, 666, -318, 664, -320, 361, -620, 664, -319, 663, -330, 661, -324, 357, -623, 361, -621, 362, -619, 365, -615, 368, -613, 671, -313, 366, -615, 6121, -5795]


  - platform: template
    name: boto6 raw
    turn_on_action:
      - remote_transmitter.transmit_raw:
          code: [957, -2179, 4343, -32268, 346, -2177, 2175, -4352, 8631, -10936, 2151, -4371, 2160, -2192, 2162, -25156, 928, -4343, 10807, -4384, 5721, -5802, 656, -332, 349, -631, 352, -627, 357, -624, 662, -323, 358, -621, 362, -619, 666, -326, 665, -320, 359, -620, 665, -319, 663, -323, 358, -621, 664, -320, 360, -620, 665, -327, 361, -620, 364, -617, 366, -615, 369, -612, 371, -611, 674, -312, 369, -612, 371, -611, 6126, -5793, 663, -324, 357, -624, 361, -620, 363, -618, 668, -317, 363, -618, 366, -614, 670, -323, 669, -317, 363, -618, 668, -315, 666, -319, 361, -620, 665, -319, 362, -619, 666, -326, 363, -618, 365, -617, 366, -614, 369, -612, 372, -608, 676, -310, 370, -612, 371, -611, 6125, -5792]


  - platform: template
    name: botoBrisa raw
    turn_on_action:
      - remote_transmitter.transmit_raw:
          code: [580, -2196, 4331, -32146, 483, -2169, 2181, -4348, 8634, -10937, 2151, -4371, 2162, -2191, 2163, -25153, 933, -4349, 10804, -4411, 5720, -5805, 351, -631, 656, -329, 653, -331, 350, -630, 356, -624, 662, -324, 356, -624, 662, -331, 661, -323, 659, -326, 355, -625, 660, -324, 659, -325, 356, -625, 358, -622, 664, -328, 359, -621, 363, -618, 668, -318, 363, -618, 365, -617, 368, -613, 370, -611, 372, -611, 6125, -5795, 360, -621, 664, -320, 662, -324, 358, -621, 362, -619, 666, -318, 362, -619, 666, -326, 665, -319, 663, -323, 357, -623, 664, -320, 662, -323, 357, -623, 362, -619, 666, -327, 362, -619, 364, -617, 669, -315, 364, -618, 366, -614, 369, -613, 370, -611, 372, -611, 6125, -5793]

  - platform: template
    name: botoBrisaDormir raw
    turn_on_action:
      - remote_transmitter.transmit_raw:
          code: [428, -2200, 4329, -32269, 345, -2185, 2168, -4355, 8629, -10936, 2150, -4371, 2160, -2191, 2162, -25154, 926, -4350, 10802, -4486, 5720, -5803, 655, -332, 650, -333, 650, -334, 346, -633, 351, -628, 356, -624, 662, -324, 356, -632, 361, -620, 665, -319, 361, -621, 363, -617, 669, -317, 363, -618, 365, -615, 369, -620, 672, -312, 368, -613, 672, -313, 366, -614, 671, -313, 669, -315, 666, -317, 665, -321, 6115, -5798, 658, -327, 655, -330, 652, -331, 350, -631, 353, -627, 357, -623, 663, -321, 358, -631, 362, -618, 668, -318, 362, -619, 365, -614, 670, -315, 365, -615, 368, -614, 369, -620, 674, -311, 369, -613, 671, -313, 368, -613, 671, -313, 669, -315, 666, -318, 664, -321, 6115, -5798]


  - platform: template
    name: botoTemp1H raw
    turn_on_action:
      - remote_transmitter.transmit_raw:
          code: [600, -2189, 4337, -34784, 2185, -4365, 8626, -10942, 2149, -4374, 2159, -2194, 2162, -25162, 926, -4353, 10805, -4419, 5722, -5805, 655, -332, 651, -333, 347, -632, 655, -330, 653, -331, 350, -631, 353, -626, 358, -632, 361, -619, 666, -319, 663, -321, 359, -623, 362, -619, 666, -318, 664, -320, 360, -629, 666, -318, 664, -321, 359, -621, 664, -321, 359, -620, 665, -320, 361, -620, 665, -319, 6118, -5801, 658, -329, 655, -331, 350, -628, 658, -326, 657, -327, 352, -628, 356, -625, 359, -631, 362, -618, 668, -318, 665, -320, 359, -620, 364, -618, 668, -317, 666, -319, 360, -627, 666, -318, 664, -321, 359, -621, 665, -319, 362, -620, 665, -319, 360, -620, 666, -319, 6120, -5799]


  - platform: template
    name: invertir Gir raw
    turn_on_action:
      - remote_transmitter.transmit_raw:
          code: [662, -2202, 4326, -32418, 203, -2171, 2177, -4348, 8631, -10932, 2152, -4369, 2160, -2191, 2162, -25154, 925, -4343, 10803, -4475, 5720, -5801, 353, -630, 353, -626, 358, -623, 662, -323, 358, -621, 362, -619, 666, -317, 363, -627, 365, -615, 669, -315, 364, -617, 669, -314, 666, -318, 363, -618, 365, -615, 368, -621, 671, -313, 368, -613, 369, -612, 674, -311, 670, -314, 668, -317, 665, -318, 663, -323, 6112, -5799, 355, -627, 357, -624, 359, -620, 665, -320, 361, -619, 364, -617, 668, -317, 364, -625, 366, -614, 670, -314, 366, -614, 670, -314, 668, -317, 364, -617, 366, -615, 368, -621, 671, -313, 366, -614, 370, -611, 674, -309, 671, -313, 669, -317, 665, -318, 663, -323, 6114, -5798]

  - platform: template
    name: boto llum raw
    turn_on_action:
      - remote_transmitter.transmit_raw:
          code: [230, -2183, 4340, -32222, 398, -2166, 2182, -4346, 8632, -10934, 2152, -4369, 2160, -2191, 2162, -25162, 919, -4348, 10802, -4375, 5718, -5803, 352, -631, 353, -626, 357, -624, 361, -619, 666, -319, 361, -619, 665, -319, 663, -328, 360, -620, 363, -618, 666, -317, 665, -319, 362, -619, 665, -318, 664, -320, 662, -331, 659, -324, 356, -625, 359, -621, 362, -619, 364, -617, 669, -314, 668, -317, 363, -619, 6117, -5796, 358, -625, 359, -621, 362, -619, 365, -615, 669, -315, 365, -615, 669, -314, 668, -326, 362, -619, 365, -615, 669, -315, 666, -318, 362, -618, 668, -317, 664, -320, 662, -330, 662, -323, 357, -624, 360, -620, 363, -617, 366, -614, 670, -314, 668, -317, 363, -619, 6117, -5795]



binary_sensor:
  - platform: gpio
    pin:
      number: D6
      inverted: true
    filters:
      - delayed_off: 1000ms
    name: "Estat ventilador"
1 Like

I know that this is an old topic, but I came across it on my search for my own ceiling fan.
I’ve got the Sonoff RF BridgeR2 and I’ve flashed it with ESPhome and the OB38S003 microcontroller with a passthrough firmware.

I got the signals from the remote which are 8 rolling codes for each button, so if it won’t work if the same signal is sent again.
Here is an example of the codes for the low speed control. I’ve split them in 4 parts. The 1st is constant, the second is the command, the 3rd is the rolling code and the 4th is the checksum:

00010011011000100000 10000 000 0100
00010011011000100000 10000 001 0101
00010011011000100000 10000 010 0110
00010011011000100000 10000 011 0111
00010011011000100000 10000 100 0000
00010011011000100000 10000 101 0001
00010011011000100000 10000 110 0010
00010011011000100000 10000 111 0011

When trying sending them, they don’t get recognized by my fan. I’ve tried other devices on my home to test the transmitter, but they work flawlessly.

Could you help me send the signals correctly or even convert these into raw signals?