IR Transmitter and Receiver Tuya S08Pro (WB3S module) with temperature and humidity

I noticed many people change Tuya modules to ESP8266.

AHT20 (i2c) - connected to WB3S via MCU on uart

I offer my code:
There is a button to check the received code.
And send via ESPhome (code) or automation

esphome:
  name: devices03
  friendly_name: ir01
bk72xx:
  board: wb3s
logger:
  level: DEBUG  # study the code
ota:
  - platform: esphome
    password: "xxxxxxxxxxxxxxxxx"
wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  power_save_mode: none
  manual_ip:
    static_ip: 192.168.0.53
    gateway: 192.168.0.1
    subnet: 255.255.255.0
captive_portal:
web_server:
  port: 80  
api:
  encryption:
    key: "qouxxxxxxxxxxxxxxxxxxxxxxU="
  services:
    - service: send_ir
      variables:
        raw_data: int[]
      then:
        - remote_transmitter.transmit_raw:
            transmitter_id: ir01_ir_tx
            code: !lambda 'return raw_data;'
            carrier_frequency: 38kHz
status_led:
  pin: P9
# Global
globals:
  - id: last_ir_code
    type: std::string
    restore_value: no
    initial_value: ""
  - id: ir_code_buf
    type: std::vector<int32_t>
    restore_value: no

remote_receiver:
  id: ir01_ir_rx
  pin:
    number: P8
    inverted: true
  dump:
    - raw
  tolerance: 50%  
  buffer_size: 4kb 
  on_raw:
    then:
      - lambda: |-
          if (id(learning_mode).state && !x.empty()) {
            std::string code;
            
            code.reserve(x.size() * 8); 
            for (size_t i = 0; i < x.size(); ++i) {
              if (i != 0) code += ",";
              code += std::to_string(x[i]);
            }
            id(ir01_code).publish_state("RAW:" + code);
            id(last_ir_code) = code;
            id(ir_code_buf) = x; 
          }

switch:
  - platform: template
    name: "IR01 Learning Mode"
    id: learning_mode
    optimistic: true
    restore_mode: ALWAYS_OFF

remote_transmitter:
  id: ir01_ir_tx
  pin: P26
  carrier_duty_percent: 50%
binary_sensor:
  - platform: gpio
    pin: P6
    name: "IR01 Learn Button"
    on_press:
      then:
        - switch.toggle: learning_mode

button:
  - platform: template
    name: "IR01 Repeat code"
    icon: "mdi:repeat"
    disabled_by_default: false
    on_press:
      then:
        - if:
            condition:
              lambda: |-
                if (id(ir_code_buf).empty()) {
                  ESP_LOGW("IR01", "Code buffer is empty!");
                  return false;
                }
                return true;
            then:
              - lambda: |-
                  ESP_LOGI("IR01", "Sending code: %s", id(last_ir_code).c_str());
                  ESP_LOGD("IR01", "Buffer size: %d", id(ir_code_buf).size());
              - remote_transmitter.transmit_raw:
                  transmitter_id: ir01_ir_tx
                  code: !lambda |-
                    ESP_LOGD("IR01", "First element of the code: %d", id(ir_code_buf)[0]);
                    return id(ir_code_buf);
                  carrier_frequency: 38kHz
                  repeat:
                    times: 3  
                    wait_time: 100ms  # pause
              - delay: 50ms  
              - lambda: |-
                  ESP_LOGI("IR01", "Code sent successfully");
            else:
              - logger.log:
                  level: ERROR
                  format: "Error: No saved code for redo"

  - platform: template
    name: "IR01 Laser"
    icon: "mdi:laser-pointer"
    id: ir01_laser_button
    disabled_by_default: false
    on_press:
      then:
        - remote_transmitter.transmit_raw:
            transmitter_id: ir01_ir_tx
            carrier_frequency: 38kHz
            code: [
              8925,-4508,560,-559,563,-563,562,-563,531,-594,
              563,-563,562,-563,563,-563,563,-562,532,-1719,
              532,-1719,532,-1719,563,-1691,560,-1688,562,-1689,
              593,-1657,594,-1688,563,-563,531,-1720,563,-1688,
              562,-1689,562,-563,563,-562,563,-563,562,-563,
              563,-1688,563,-562,563,-563,562,-563,563,-1688,
              563,-1688,563,-1688,562,-1689,531,-10000
            ]
        - delay: 200ms




# tuya mcu
tuya:
uart:
  rx_pin: RX1
  tx_pin: TX1
  baud_rate: 9600
text_sensor:
  - platform: template
    name: "IR01 Last IR Code"
    id: ir01_code
sensor:
  - platform: tuya
    sensor_datapoint: 101
    name: "IR01 Temperature"
    unit_of_measurement: "°C"
    accuracy_decimals: 1
    filters:
      - lambda: return x * 0.1;
  - platform: tuya
    sensor_datapoint: 102
    name: "IR01 Humidity"
    unit_of_measurement: "%"
  - platform: wifi_signal
    name: "IR01 Dummy RSSI"
    update_interval: 60s
alias: Send IR code on event
description: ""
triggers:
  - domain: mqtt
    device_id: 038cb24eaa43bfd3af00abb0b52e74dd
    type: action
    subtype: 2_double
    trigger: device
actions:
  - data:
      raw_data:
        - 8925
        - -4508
        - 560
        - -559
        - 563
        - -563
        - 562
        - -563
        - 531
        - -594
        - 563
        - -563
        - 562
        - -563
        - 563
        - -563
        - 563
        - -562
        - 532
        - -1719
        - 532
        - -1719
        - 532
        - -1719
        - 563
        - -1691
        - 560
        - -1688
        - 562
        - -1689
        - 593
        - -1657
        - 594
        - -1688
        - 563
        - -563
        - 531
        - -1720
        - 563
        - -1688
        - 562
        - -1689
        - 562
        - -563
        - 563
        - -562
        - 563
        - -563
        - 562
        - -563
        - 563
        - -1688
        - 563
        - -562
        - 563
        - -563
        - 562
        - -563
        - 563
        - -1688
        - 563
        - -1688
        - 563
        - -1688
        - 562
        - -1689
        - 531
        - -10000
    action: esphome.devices03_send_ir
  • I first flashed via UART in Open B K7238_Q Ю_1.18.136.bin via BK7231GUIFlashTool-v32 (When flashing, via uart you need to short-circuit Pin1 - Pin9 (CEN-GND);
  • From ESPhome firmware “bin” via Itchiptool v4.12.1 (When flashing, via uart you need to short-circuit Pin1 - Pin9 (CEN-GND));
  • then it is esphome updated via WiFi.

Do yo have image with the body on? I found this one from where I am from, but it doesn’t have temp/humidity sensor

View from the outside