Sending RAW RF values

Hello,

i have hooked up a rf reciever and trasmitter to a wemos D1.
The recived codes are:

How do i resend these codes.
if i send one off the lines it doesn’t do anything, so i think i have all the lines to let things happend.

how can i do that ?

on:

[19:36:12][D][remote.rc_switch:243]: Received RCSwitch Raw: protocol=1 data='0011000100001110101001111000'
[19:36:12][D][remote.rc_switch:243]: Received RCSwitch Raw: protocol=1 data='0011000100001110101001111000'
[19:36:12][D][remote.rc_switch:243]: Received RCSwitch Raw: protocol=1 data='0011000100001110101001111000'
[19:36:12][D][remote.rc_switch:243]: Received RCSwitch Raw: protocol=1 data='001100010000111010100111100'

off

[19:36:53][D][remote.rc_switch:243]: Received RCSwitch Raw: protocol=1 data='0011000100001110101010000111'
[19:36:53][D][remote.rc_switch:243]: Received RCSwitch Raw: protocol=1 data='0011000100001110101010000111'
[19:36:53][D][remote.rc_switch:243]: Received RCSwitch Raw: protocol=1 data='0011000100001110101010000111'
[19:36:53][D][remote.rc_switch:243]: Received RCSwitch Raw: protocol=1 data='001100010000111010101000011'

this is my code so far:



remote_receiver:
  pin: D5
  dump:
    - rc_switch
  
remote_transmitter:
  pin: D1
  # RF uses a 100% carrier signal
  carrier_duty_percent: 100%
  
binary_sensor:
switch:
  - platform: template
    name: RF on
    turn_on_action:
      - remote_transmitter.transmit_rc_switch_raw:
          code: '001100010000111010100111100'
          protocol: 1
    turn_off_action:
      - remote_transmitter.transmit_rc_switch_raw:
          code: '001100010000111010101000011'
          protocol: 1

Hello I’m no expert on esphome, But i have used rc-switch a lot and depending on the settings you have you might be receiving the signal as the wrong protocol and when you sent it the receiver wont understand the signal

remote_receiver:
pin: D5
idle: 1ms
filter: 100us
dump:
- rc_switch

try different idle i would start at 1ms and increase with 1ms steps up to 25ms, you will probably receive the signal as a few different protocols try and see if the receiver will react to the signal you get at the different protocols… also try the filter might help a bit too

Some background info…

this is from rc-switch arduino

  { 350, {  1, 31 }, {  1,  3 }, {  3,  1 }, false },    // protocol 1
  { 650, {  1, 10 }, {  1,  2 }, {  2,  1 }, false },    // protocol 2
  { 100, { 30, 71 }, {  4, 11 }, {  9,  6 }, false },    // protocol 3
  { 380, {  1,  6 }, {  1,  3 }, {  3,  1 }, false },    // protocol 4
  { 500, {  6, 14 }, {  1,  2 }, {  2,  1 }, false },    // protocol 5
  { 450, { 23,  1 }, {  1,  2 }, {  2,  1 }, true },     // protocol 6 (HT6P20B)
  { 150, {  2, 62 }, {  1,  6 }, {  6,  1 }, false },    // protocol 7 (HS2303-PT, i. e. used in AUKEY Remote)
  { 200, {  3, 130}, {  7, 16 }, {  3,  16}, false},     // protocol 8 Conrad RS-200 RX
  { 200, { 130, 7 }, {  16, 7 }, { 16,  3 }, true},      // protocol 9 Conrad RS-200 TX
  { 365, { 18,  1 }, {  3,  1 }, {  1,  3 }, true },     // protocol 10 (1ByOne Doorbell)
  { 270, { 36,  1 }, {  1,  2 }, {  2,  1 }, true },     // protocol 11 (HT12E)
  { 320, { 36,  1 }, {  1,  2 }, {  2,  1 }, true }      // protocol 12 (SM5212)

const unsigned int RCSwitch::nSeparationLimit = 4300;
// separationLimit: minimum microseconds between received codes, closer codes are ignored.
// according to discussion on issue #14 it might be more suitable to set the separation
// limit to the same time as the 'low' part of the sync signal for the current protocol.

if i undestant it right idle are the same as nSeparationLimit
so for protocol 4 the idle should be 6*380 =2280 use idle 2ms

Best of luck