Tuya to ESPHome Conversions

Figured I'd put the ESPHome configs that I've used for converting some of those really cheap Tuya IR blasters from Aliexpress into ones that work via ESPHome.

S06 IR Remote (square, micro USB)

The first remote that I got. It's a square blaster, with four IR LEDs, a button on the underside, and a single status LED. Internally, it uses the CB3S WiFi module.

This was vulnerable to Tuya Cloudcutter using the 2.1.5 Avatto S06 Pro preset. this probably would work with the generic Tuya IR device preset as well.

Pin Function Notes
GPIO26 Transmitter IR LEDs You need to manually specify the carrier frequency, which for me is about 38 KHz
GPIO7 IR Receiver Needs to be inverted in software
GPIO6 Button Needs to be inverted in software
GPIO8 Blue Status LED
ESPHome Configuration
			esphome:
  name: rename_me
  friendly_name: S06 IR Blaster

bk72xx:
  board: cb3s

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: "xxxxxxx"
  services:
    - service: send_raw_command
      variables:
        command: int[]
      then:
        - remote_transmitter.transmit_raw:
            code: !lambda "return command;"
            carrier_frequency: !lambda "return 38029.0;"
    - service: send_pronto_command
      variables:
        command: string
      then:
        - remote_transmitter.transmit_pronto: 
            data: !lambda "return command;"

ota:
  - platform: esphome
    password: "xxxxxxx"

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "idk this is default"
    password: "xxxxx"

captive_portal:
    
light:
  - platform: status_led
    name: "Status LED"
    pin: GPIO8
    id: statusled

binary_sensor:
  - platform: gpio
    pin: GPIO6
    name: "Button"
    filters: 
      - invert:

remote_transmitter:
  pin: GPIO26
  carrier_duty_percent: 50%
  on_transmit:
    then:
      - light.toggle: statusled
  on_complete:
    then:
      - light.toggle: statusled

remote_receiver:
  pin: 
    number: GPIO7
    inverted: true
            
	      

IRC03 IR Remote (round, USB-C)

The second remote that I got. It's a round blaster, with six IR LEDs arranged circularly, a button on the underside, what appears to be an always-on blue power LED, and a red status LED right next to it. Internally, it uses a generic Beken BK7231N chip integrated into the main PCB.

As with the S06, this was vulnerable to Tuya Cloudcutter using the generic Tuya IR Blaster preset.

Pin Function Notes
GPIO7 Transmitter IR LEDs You need to manually specify the carrier frequency, which for me is about 38 KHz
GPIO8 IR Receiver Needs to be inverted in software
GPIO9 Button Needs to be inverted in software
GPIO24 Red Status LED A bit hard to see when on
ESPHome Configuration
			esphome:
  name: rename_me
  friendly_name: Tuya Round IR Blaster

bk72xx:
  board: generic-bk7231n-qfn32-tuya

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: "xxxxxx"
  services:
    - service: send_raw_command
      variables:
        command: int[]
      then:
        - remote_transmitter.transmit_raw:
            code: !lambda "return command;"
            carrier_frequency: !lambda "return 38029.0;"
    - service: send_pronto_command
      variables:
        command: string
      then:
        - remote_transmitter.transmit_pronto: 
            data: !lambda "return command;"

ota:
  - platform: esphome
    password: "xxxxxx"

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Tuya-Round-Ir-Blaster"
    password: "xxxxxx"

captive_portal:
    
light:
  - platform: status_led
    name: "Status LED"
    pin: GPIO24
    id: statusled

binary_sensor:
  - platform: gpio
    pin: GPIO9
    name: "Button"
    filters: 
      - invert:

remote_transmitter:
  pin: GPIO7
  carrier_duty_percent: 50%
  on_transmit:
    then:
      - light.toggle: statusled
  on_complete:
    then:
      - light.toggle: statusled

remote_receiver:
  pin: 
    number: GPIO8
    inverted: true