Basic ESPhome 433 gateway, without home assistant control, can somebody help me?

I am trying to make a 433 gateway with ESPhome, but without home assistant control.
This is the first time i am working with ESPhome. Step by step i got i build up. But now i got stuck with the if/then code part

What i am looking for, it it receives code 011001110100110100001110
then send 110011010000010110101000

I hope somebody can set me to the right direction.
I tried to search for an example. Thoughed i found something with the esphome 433 gateway. Tried to copy it and modify it to my wish. But running from one to another error.

My code i have now

esphome:
  name: rfscanne
  platform: ESP8266
  board: d1_mini

# Enable logging
logger:

# Enable Home Assistant API
api:
  password: "Secret"

ota:
  password: "Secret"

wifi:
  networks:
  - ssid: "Secret"
    password: "Secret"
  - ssid: "Secret"
    password: "Secret"

captive_portal:

#build webserver
web_server:
  port: 80

#Enable remote transmitter
remote_transmitter:
  pin: GPIO14
  carrier_duty_percent: 50%
  
#Enable remote receiver
remote_receiver:
  pin:
    number: GPIO4
    inverted: True
    mode: INPUT_PULLUP
#  dump: all
  dump: rc_switch
  tolerance: 60%
  filter: 4us
  idle: 4ms
  on_rc_switch: 
    
    binary_sensor:
      - platform: remote_receiver
        name: Doorbell_Push
        rc_switch_raw:
          code: '011001110100110100001110'
          protocol: 6
        filters:
          - delayed_off: 1000ms
      
    switch:
      - platform: template
        name: Doorbell_Push Switch
        icon: "mdi:remote"
        id: Doorbell_Push_switch
        turn_on_action:
          - remote_transmitter.transmit_rc_switch_raw:
              code: '110011010000010110101000'
              protocol: 
                pulse_length: 300
              repeat:
                times: 5
                wait_time: 9ms

No logs, no issue.

1 Like

That was not the answer i am looking for.
I was hoping for a little friendly reply, instead of your short reply “no logs, no issue”.

I will validate the code with esphome, this evening. And post the output from it.

we need to know what your errors are, your post didn’t tell us.

It is fundamental to provide your logs.

2 Likes

I think i found the error.
There was a line “on_rc_switch” in it, but without the correct code after it.

The code doesn’t give any error. Can compile and upload.
When i push a 433mhz button, this is received and performs the send command in the log.
But in real time it isn’t sending anything. How do i know this, i have another esphome running with a receiver. It receives the push button. But not the switch command from the first esphome.

looks like something around this part of the code " - remote_transmitter.transmit_rc_switch_raw:
" doesn’t work. Is this because i programmed something wrong?

esphome:
  name: rfscanne
  platform: ESP8266
  board: d1_mini

# Enable logging
logger:

# Enable Home Assistant API
api:
  password: "Secret"

ota:
  password: "Secret"

wifi:
  networks:
  - ssid: "Secret"
    password: "Secret"

captive_portal:

#build webserver
web_server:
  port: 80

#Enable remote transmitter
remote_transmitter:
  pin: GPIO14
  carrier_duty_percent: 100%
  
#Enable remote receiver
remote_receiver:
  pin:
    number: GPIO4
    inverted: True
    mode: INPUT_PULLUP
  dump: rc_switch
  tolerance: 60%
  filter: 4us
  idle: 4ms
  
binary_sensor:
  - platform: remote_receiver
    name: Nedis Doorbell push
    rc_switch_raw:
      code: '011001110100110100001110'
      protocol: 6
    filters:
      - delayed_off: 1000ms
   
switch:
  - platform: template
    name: Nedis Doorbell Switch
    icon: "mdi:bell"
    id: nedis_doorbell_switch
    turn_on_action:
      - remote_transmitter.transmit_rc_switch_raw:
          code: '01000101101111111000'
          protocol: 1 
          repeat:
            times: 5
            wait_time: 50ms
  
  - platform: template
    name: Nedis Doorbell
    icon: "mdi:bell"
    turn_on_action:
    - switch.turn_on: nedis_doorbell_switch

An image from the debug log. Reading this i would say it works, but nothing is send

Added this undernead the binary sensor.
Then it works.
Did i do this correct?
I ask this, because it is the first time working with esphome

on_press: 
     then:
       - switch.turn_on: nedis_doorbell_switch

Binary sensor then looks like:
This is only thing changed within the code that was added in the previous post

binary_sensor:
  - platform: remote_receiver
    name: Nedis Doorbell push
    rc_switch_raw:
      code: '011001110100110100001110'
      protocol: 6
    filters:
      - delayed_off: 1000ms
    on_press: 
     then:
       - switch.turn_on: nedis_doorbell_switch

Does this type of code work?
With the focus on how i defined “protocol”?

When looking on “ESPHome Remote Transmitter” then i can’t find that the code is written like this. But looking at some examples, i see sometime people use this way, to define the protocol.

The reason for me, that there is no protocol number in de library, that works with my device.
Otherwise i need to look at custom version, but i do not prefer. Not easy to do when i read it (i am not a programmer person)

  - remote_transmitter.transmit_rc_switch_raw:
          code: '01000101101111111000'
          protocol: 
            pulse_length: 500
            sync: [6, 1]
            zero: [1, 2]
            one: [2, 1]
            inverted: false
          repeat:
            times: 5
            wait_time: 50ms