ESPHome RF Receiver + Transmitter issues

Hello,

I’m trying to setup a LOLIN D32 with an RF receiver (to decode the signals) and a RF transmitter without any success. I’d like to decode a rf remote codes from my outdoor awning to control it via home assistant.

Using the default settings to catch signals:

  pin: 
    number: 16
    mode: INPUT_PULLUP
  dump: rc_switch
  # Settings to optimize recognition of RF devices
  tolerance: 50%
  filter: 250us
  idle: 4ms
  buffer_size: 10kb

I could once see logs of the signal (I kept the remote button pressed for 30 seconds or more), and I got this:

[23:28:10][D][remote.rc_switch:256]: Received RCSwitch Raw: protocol=6 data='1101001110111011000101111000101101001100110101011'
[23:28:13][D][remote.rc_switch:256]: Received RCSwitch Raw: protocol=6 data='110100111011101100010111100'
[23:28:15][D][remote.rc_switch:256]: Received RCSwitch Raw: protocol=6 data='110100111011101100010111100010'
[23:28:22][D][remote.rc_switch:256]: Received RCSwitch Raw: protocol=6 data='110100111011101100010111100'
[23:28:22][D][remote.rc_switch:256]: Received RCSwitch Raw: protocol=6 data='110100111011101100010111100'
[23:28:24][D][remote.rc_switch:256]: Received RCSwitch Raw: protocol=6 data='110100111011'

I’ve tried to reproduce it again, but I wasn’t able. No more data received.

When I then tried to emit the signals - tried all above options - using this code:

switch:
  - platform: template
    name: Raw Code Power Button
    turn_on_action:
      - remote_transmitter.transmit_rc_switch_raw:
          code: '110100111011101100010111100'
          protocol: 6

It did not work and the receiver didn’t catch the transmitter code. If I relax the tolerance to 60% I can get data output on every button click, and when I emit it via the esp32 emitter the receiver catches it and I can see the data on the logs, the problem is that the awning doesn’t work.

I’d appreciate if someone could help!

Thanks!

anyone? :pray:

was trying to use esphome rf receiver too but no success. Then flash another board esp32 with tasmota32_sensor firmware and connect rf receiver to it. And now i decode all my rf433 buttons.

18:58:54 RFR: Data 0xEF2FA2 (15675298), Bits 24, Protocol 17, Delay 324
18:58:54 MQT: tele/tasmota_F3D220/RESULT = {"Time":"2021-01-10T18:58:54","RfReceived":{"Data":"0xEF2FA2","Bits":24,"Protocol":17,"Pulse":324}}
18:58:54 RFR: Data 0xEF2FE2 (15675362), Bits 24, Protocol 1, Delay 240
18:58:54 RFR: Data 0xEF2FE2 (15675362), Bits 24, Protocol 1, Delay 240
18:58:54 RFR: Data 0xEF2FE2 (15675362), Bits 24, Protocol 1, Delay 240
18:58:58 RFR: Data 0xEF2FE8 (15675368), Bits 24, Protocol 1, Delay 240
18:58:58 MQT: tele/tasmota_F3D220/RESULT = {"Time":"2021-01-10T18:58:58","RfReceived":{"Data":"0xEF2FE8","Bits":24,"Protocol":1,"Pulse":240}}
18:58:58 RFR: Data 0xEF2FE8 (15675368), Bits 24, Protocol 1, Delay 241
18:58:58 RFR: Data 0xEF2FE8 (15675368), Bits 24, Protocol 1, Delay 240
18:58:58 RFR: Data 0xEF2FE8 (15675368), Bits 24, Protocol 1, Delay 240
18:58:59 RFR: Data 0xEF2FE1 (15675361), Bits 24, Protocol 1, Delay 240
18:58:59 MQT: tele/tasmota_F3D220/RESULT = {"Time":"2021-01-10T18:58:59","RfReceived":{"Data":"0xEF2FE1","Bits":24,"Protocol":1,"Pulse":240}}
18:58:59 RFR: Data 0xEF2FE1 (15675361), Bits 24, Protocol 1, Delay 241
18:58:59 RFR: Data 0xEF2FE1 (15675361), Bits 24, Protocol 1, Delay 241
18:59:02 RFR: Data 0xEF2FE4 (15675364), Bits 24, Protocol 1, Delay 240
18:59:02 MQT: tele/tasmota_F3D220/RESULT = {"Time":"2021-01-10T18:59:02","RfReceived":{"Data":"0xEF2FE4","Bits":24,"Protocol":1,"Pulse":240}}
18:59:02 RFR: Data 0xEF2FE4 (15675364), Bits 24, Protocol 1, Delay 241

data - is rf code in hex format, it can be easy format to binary, but i publish it in hex to mqtt topic…

1 Like

Awesome suggestion: Tasmota allowed to look at Receivers data (hex format),

from Tasmota: {“Data”:“0x8546C224”,“Bits”:32,“Protocol”:1,“Pulse”:252}}

then I converted to binary and got it working on esphome with some tuning to set and repeats and not using the “protocol: 1” instead supplying specific pulses:

switch:
  - platform: template
    name: "RF test switch"
    turn_on_action:
      - remote_transmitter.transmit_rc_switch_raw:
          code: '10000101010001101100001000100100'
          protocol:
            pulse_length: 252
          repeat:
            times: 10
            wait_time: 0ms

Thank you, thank you! This finally worked for me.

The “protocol” options for RCSwitch are not particularly clear and the Receiver dump doesn’t help much. From using Arduino RCSwitch I already knew the “protocol” number, raw code, and pulse length. My Tx worked fine using a simple sketch and protocol 1 in arduino. Not in ESPHome.

When I simply specified pulse_length and the repeat sequence it finally worked.

remote_transmitter:
  pin: 19
  carrier_duty_percent: 100%

switch:
  - platform: template
    name: Blind RF Power Switch
    id: dewenwils_a
    optimistic: true
    assumed_state: true
    restore_mode: ALWAYS_ON
    turn_on_action:
      remote_transmitter.transmit_rc_switch_raw:
        code: '110100011110100100111100'
        protocol: 
          pulse_length: 190
        repeat:
          times: 10
          wait_time: 0s
    turn_off_action:
      remote_transmitter.transmit_rc_switch_raw:
        code: '110100011110100100110100'
        protocol: 
          pulse_length: 190
        repeat: 
          times: 10
          wait_time: 0s

On the RX side, things were even more complicated for me. In Arduino I got nice clean output from the RF remote control such as:

1 On – Decimal: 13756732 (24Bit) Binary: 110100011110100100111100 Tri-State: not applicable PulseLength: 189 microseconds Protocol: 1

In ESPHome RX dump I would get a lot of noise and garbage. Based on another post, I slowly played around with the tolerance and idle parameters until the output was pretty good, but far from the quality I got from the Arduino sketch. The ESPHome RX dump is still showing protocol 6, which I’m not going to spend the time to figure out why because it works.

Here are the settings I ended up with:

remote_receiver:
  pin: 
    number: GPIO13
    inverted: true
    mode:
      input: true
      pullup: true
  dump: 
    - rc_switch 
  tolerance: 62%
  filter: 185us
  idle: 3ms

I’m not sure how to improve the documentation, but this almost requires a special FAQ to get to work, certainly compared to the simplicity of getting the simple arduino sketches working. I figured once I had those working this would be simple. I was quite wrong.

Hi there! I’m trying to do the same thing but with a Sonoff RF bridge, get the codes using Tasmota but I can’t get it to work, I don’t receive any codes. I should say that I’ve hardware hacked it but it shouldn’t be an issue I think. Can you give an example of how you set it up in the Tasmota config?