logo elektroda
logo elektroda
X
logo elektroda

Configuring IR Transmitter and Receiver on Tuya IR Blaster S08Pro

brianroy86 1881 4
ADVERTISEMENT
  • #1 20828706
    brianroy86
    Level 6  
    Close-up of a circuit board with electronic components. A circuit board of an electronic device with several LED lights and a connected USB cable.

    Hi all,

    I have a S08Pro that I got on aliexpress for like $3. I have cracked it open and was able to use cloud cutter to install the esphome kickstarter on it. I got the temp and humidity sensors working, but I need some assistance with the IR transmitter and receiver. I'm not sure which pins to use, could someone take a look and let me know? Hopefully we can get this added as a cc profile for future users as well.

    My current ESPHome yaml below.
    
    # do not include api keys in config! stripped to GPIO
    sensor:
      - platform: uptime
        name: Uptime
    
      - platform: tuya
        sensor_datapoint: 101
        name: Temperature
        unit_of_measurement: ""
        accuracy_decimals: 1
        filters:
          - lambda: return (x * 0.1) * (9.0/5.0) + 32.0;
    
      - platform: tuya
        sensor_datapoint: 102
        name: Humidity
        unit_of_measurement: "%"
    
    remote_transmitter:
      pin: 26 # from IRSend line
      carrier_duty_percent: 50%
    
    remote_receiver:
      pin: 
        number: 11 # from IRRecv line
        inverted: true
      dump: all
      
    
    status_led:
      pin: 9 # from LED 0 line
    
    # Button config will not do anything
    # and you have to write more code
    output:
      - platform: gpio
        pin: 6 # from Btn line
        id: btn_output
    
    button:
      - platform: output
        name: "Generic Output"
        output: btn_output
        duration: 500ms
    
      - platform: restart
        name: Restart
        
    uart:
      rx_pin: RX1
      tx_pin: TX1
      baud_rate: 9600
    
  • ADVERTISEMENT
  • #2 20839187
    brianroy86
    Level 6  

    Is there anything else I can provide to help get this to be a supported model with ESPHome? If not, is there documentation on how I can move from ESPHome to OpenBeken? I wasn't able to just grab the bin file from the releases and upload it to the ESPHome web UI.
  • ADVERTISEMENT
  • #3 21127779
    sri4shopping
    Level 1  
    >>20839187
    Have you figured out the solution for this to make the IR Tx and Rx working? If I am right, I was able to make one of the IR Blasters working with WB3S chip. Let me know.
  • ADVERTISEMENT
  • #4 21131413
    cmuki
    Level 1  
    Hello all!

    After dedicating a lot of time of trying to get IR Remote for OpenBK to work, I couldn't do it and gave up.

    Yesterday I stumbled upon this post and managed to get everything working - temperature, humidity and IR (I'm using it for a Daikin AC).

    Here's the content of my yaml after the wifi configuration - it's an amalgamation of several posts and yamls I found on the internet as well as the AC component. Don't forget to add the tuya component.

    sensor:
      - platform: uptime
        name: Uptime
    
      - platform: tuya
        sensor_datapoint: 101
        name: Temperature
        unit_of_measurement: "°C"
        accuracy_decimals: 1
        filters:
          - lambda: return (x * 0.1);
    
      - platform: tuya
        sensor_datapoint: 102
        name: Humidity
        unit_of_measurement: "%"
    
    remote_transmitter:
      id: tamtr
      pin: 26 # from IRSend line
      carrier_duty_percent: 50%
    
    remote_receiver:
      id: rcvr
      pin:
        number: 8
        inverted: True # from IRRecv line
      dump: all
    
    status_led:
      pin: 9 # from LED 0 line
    
    climate:
      - platform: daikin_arc
        id: ac
        name: "AC"
        receiver_id: rcvr
        transmitter_id: tamtr
    
    # Button config will not do anything
    # and you have to write more code
    output:
      - platform: gpio
        pin: 6 # from Btn line
        id: btn_output
    
    button:
      - platform: output
        name: "Generic Output"
        output: btn_output
        duration: 500ms
    
    uart:
      rx_pin: RX1
      tx_pin: TX1
      baud_rate: 9600
    
  • #5 21611520
    rpashaby
    Level 1  
    I have the same board S08Pro
    my code is the latest (I get the code and check it through repeet)

    
    esphome:
      name: devices03
      friendly_name: ir01
    bk72xx:
      board: wb3s
    logger:
      level: DEBUG  # study the code
    ota:
      - platform: esphome
        password: "XXXXXXXXXXXX"
    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: "qoXXXXXXXXXXXXXGvU="
      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; 
              }
    
    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
    switch:
      - platform: template
        name: "IR01 Learning Mode"
        id: learning_mode
        optimistic: true
        restore_mode: ALWAYS_OFF
    
    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  
                  - delay: 50ms  
                  - lambda: |-
                      ESP_LOGI("IR01", "Code sent successfully");
                else:
                  - logger.log:
                      level: ERROR
                      format: "Error: No saved code for redo"
    #Example
      - platform: template
        name: "IR01 Laser"
        icon: "mdi:laser"
        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: 100ms
    
    
    # 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
    
ADVERTISEMENT