# ir-433-capture-replay.yaml — ESPHome: capture + replay IR / 433 MHz # magikh0e.pl # # For YOUR OWN fixed-code devices. Rolling-code remotes (modern garage # doors, car keys, KeeLoq with a rotating counter) are rolling-code # precisely so capture-replay fails — don't try to bypass those. # # Wiring (adjust GPIOs to your board): # IR receiver (TSOP38238) OUT -> GPIO14 (data in) # 433 MHz RX module DATA -> GPIO13 (data in) # IR LED (via NPN transistor) -> GPIO4 (data out) # 433 MHz TX module DATA -> GPIO12 (data out) esphome: name: ir-433-bridge esp32: board: esp32dev logger: level: DEBUG # dump output prints at DEBUG api: ota: wifi: ssid: !secret wifi_ssid password: !secret wifi_password # --- CAPTURE --------------------------------------------------------- # Point a remote at the receiver, then `esphome logs this.yaml` and # press buttons. Copy the decoded (or raw) line the dumper prints. remote_receiver: - id: ir_rx pin: number: GPIO14 inverted: true mode: input: true pullup: true dump: all # try every known protocol, plus raw tolerance: 25% filter: 50us idle: 10ms - id: rf_rx pin: GPIO13 dump: rc_switch # most cheap 433 remotes are rc_switch / raw tolerance: 60% filter: 250us idle: 4ms # --- REPLAY ---------------------------------------------------------- remote_transmitter: - id: ir_tx pin: GPIO4 carrier_duty_percent: 50% # IR: ~38 kHz carrier - id: rf_tx pin: GPIO12 carrier_duty_percent: 100% # 433 MHz: no carrier # Buttons that replay a captured code — paste what the dumper printed. # Home Assistant sees these buttons automatically over the API. button: - platform: template name: "TV Power (IR)" on_press: - remote_transmitter.transmit_nec: # decoded form transmitter_id: ir_tx address: 0x20DF command: 0x10EF - platform: template name: "Outlet A On (433)" on_press: - remote_transmitter.transmit_raw: # raw form transmitter_id: rf_tx code: [320, -960, 320, -960, 960, -320] # <- from the dump