Open source ESPHome IR blaster?

I found this awesome product on AliExpress:

NZ$ 58.10 | KC868-AG ESP32 IR RF Gateway Made For ESPHome Home Assistant Automation DIY
https://a.aliexpress.com/_mP3b4ji

It’s an IR blaster for controlling air conditioners, etc. It uses an ESP32 chip and is designed to run ESPHome with your own custom configuration.

The only problem is that I need 4 of these, and I don’t really want to spend $240 NZD. I have a bunch of spare ESP32 development boards and a 3D printer, so I can make my own cases. I also know how to order PCBs from JLCPCB. So I could make my own at a much lower cost.

Does anyone know if there’s something like this that’s open source on GitHub, with a case STL that I can 3D print, and a PCB design that I can order? Thanks!

Well the Kincory box you listed works like a charm for IR control, I have used already a bunch of these and they work great and they also include a radio receiver/transmitter.
I’m not aware of any open-source design for that but you can re-use the design of the Kincony and get rid of everything you don’t need :wink:
It’s mainly a transistor on the GPIO used to control the IR Led (don’t make the mistake to power IR Led from GPIO straight, it won’t work :wink:
If you don’t find the kincony layout on their messy website here is my copy:

1 Like

Do you only need IR or RF too?

Not sure what your asthetic standards are (mine are low;) but I would have thought a few components attached to a (smaller form) esp32 all thrown in a simple 3d printed enclosure would do the job?

I’ve never done PCB design so can’t speak to that.

I decided to leave my diy RF blaster “naked”:slight_smile:

I do like the rttl buzzer on mine so I can hear a signal has been sent/recieved.

1 Like

https://go.tuya.com/en/productDetail?code=818dt4kx44e8

This one is based on the ESP8266 chip, I bought it for $3

1 Like

I also tried to make it myself and found that the effect is not comparable to commercial ones. I bought the above UFO-R1 product and the effect is very satisfactory. It is much better than my own DIY.

1 Like

The off shelf ones tend to have multi-directional arrays of ir transmitters/recievers.

You can also scan the ESPHome device list.

Best to do some research and check they still have ESPHOME compatible chips before you buy.

The KC868-AG seems like the best one given I prefer to stick to ESP32 based devices but it is a bit pricey for my application. I have a rangehood that has an IR remote to turn the light on/off and the fan up/down (4 speeds) plus on/off. I am currently using a Broadlink RM4 mini but would like to replace it with an esphome solution.

If I cannot find a puck similar to the KC868-AG at a more reasonable price (the one I found on aliexpress was ~$35 USD +$8 for shipping) then I would just build one myself. The device is hidden on top of my kitchen cabinets so hidden out of sight. Due to its location I am guessing I need as much IR power output and in as many directions as possible because it needs to bounce just right to reach the receiver below it on the rangehood. Cabinets and rangehood are on the same wall… The Broadlink Mini never failed and it has 7 leds pointing in different directions.

Picture is of a RM mini 3 but it is similar/same on the mini 4:

Does anyone know of a prebuilt IR emitter that has 7 leds on it already built? All I can find is 1 or 2 LED solutions. I could reuse the one from the Broadlink but I want to build the replacement and test it before tearing the other one down.

Maybe. But I reckon you just need ONE pointing in the RIGHT direction.

You might be able to confirm that by masking 6 leds and playing with position?

I seem to recall seeing some posts of people having decent results with this kind of thing.

Just found this amazing item on AliExpress. Check it out! AU$5.07 30%OFF | ESP8285 IR Infrared Receiver Transmitter ESP-01M Wifi Wireless Remote Control Switch Module Development Board Module
https://a.aliexpress.com/_mMUer3k

I’d say the cheapest option would still be tuya ir remote, with the beken chip swapped with esp32.
$3-4 bucks for the remote + $2 for esp32-c3

I ended up getting 4 FK-UFO-R4 and replacing the SOC with an ESP32-C3F.


They work great, and the replacement was not too difficult. The case is easy to open as there are 3 screws under the feet and then opens up without any damage. Figuring out the pins was quite easy too with a bit of probing around with a DMM.

1 Like

I have a similar IR Blaster device, can you share your ESPHome yaml please.

@gaz99 - This is one of the ones I am working on. The external component was necessary due to the C3 chip and some issue where resources are not allocated properly. The external component fixes that along with the order in which the RX and TX are listed in the code if I recall correctly.

substitutions:
  devicename: "kitchen-ir-blaster"
  friendly_devicename: "Kitchen IR Blaster"
  device_description: "Kitchen IR Blaster"
  update_interval_s: "10s"
  update_interval_wifi: "60s"

esphome:
  name: ${devicename}
  comment: ${device_description}
  friendly_name: ${friendly_devicename}

esp32:
  board: esp32-c3-devkitm-1
  framework:
    type: arduino


external_components:
  - source: github://Jorre05/remote_receiver
    components: [ remote_receiver ]


#Investigate globals to see if they always get written on only if marked as restore.
#This setting preserves the flash by limiting writes
#preferences:
#  flash_write_interval: 5min

# Enable logging
logger:
#  baud_rate: 0 #Disable logger on UART since it is being used for the sensor. Helps not overload.
  level: DEBUG

# Enable Home Assistant API
api: 

ota:

wifi:
  ssid: !secret iot_wifi_ssid
  password: !secret iot_wifi_password

#Faster than DHCP. Also use if can't reach because of name change
  manual_ip:
    static_ip: 192.168.3.231
    gateway: 192.168.3.1
    subnet: 255.255.255.0
    dns1: 192.168.1.25
    dns2: 192.168.1.36

  #fast_connect: true

#Manually override what address to use to connect to the ESP.
#Defaults to auto-generated value. Example, if you have changed your
#static IP and want to flash OTA to the previously configured IP address.
  #use_address: 192.168.3.231
  
  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "${devicename}"
    password: !secret iot_wifi_password


# Sync time with Home Assistant
time:
  - platform: homeassistant
    id: ha_time

text_sensor:
  - platform: wifi_info
    ip_address:
      name: "IP"
      id: device_ip
      icon: "mdi:ip-outline"
      update_interval: ${update_interval_wifi}
    ssid:
      name: "SSID"
      icon: "mdi:wifi-settings"
      update_interval: ${update_interval_wifi}
    bssid:
      name: "BSSID"
      icon: "mdi:wifi-settings"
      update_interval: ${update_interval_wifi}
    mac_address:
      name: "MAC"
      icon: "mdi:network-outline"
    scan_results:
      name: "Wifi Scan"
      icon: "mdi:wifi-refresh"
      disabled_by_default: true


sensor:
  - platform: wifi_signal
    name: "WiFi Signal"
    update_interval: ${update_interval_wifi}
    device_class: signal_strength



button:
  - platform: restart
    name: "Restart"
    entity_category: diagnostic

  - platform: safe_mode
    name: "Safe Mode"
    entity_category: diagnostic

#Rangehood IR CODES
  - platform: template
    name: "Rangehood Power"
    on_press:
      remote_transmitter.transmit_nec:
        address: 0xFE01
        command: 0xF30C

  - platform: template
    name: "Rangehood Light"
    on_press:
      remote_transmitter.transmit_nec:
        address: 0xFE01
        command: 0xF708

  - platform: template
    name: "Rangehood Circulate"
    on_press:
      remote_transmitter.transmit_nec:
        address: 0xFE01
        command: 0xF50A

  - platform: template
    name: "Rangehood Minus"
    on_press:
      remote_transmitter.transmit_nec:
        address: 0xFE01
        command: 0xF807

  - platform: template
    name: "Rangehood Plus"
    on_press:
      remote_transmitter.transmit_nec:
        address: 0xFE01
        command: 0xF906

  - platform: template
    name: "Rangehood Clock"
    on_press:
      remote_transmitter.transmit_nec:
        address: 0xFE01
        command: 0xF40B

  - platform: template
    name: "Rangehood Test"
    on_press:
      remote_transmitter.transmit_nec:
        address: 0xFE01
        command: 0xF30F

  - platform: template
    name: "Rangehood Test2"
    on_press:
      remote_transmitter.transmit_nec:
        address: 0xFE01
        command: 0xF30E


binary_sensor:
  - platform: gpio
    id: bottom_button
    pin:
      number: 5
      inverted: true
    on_press:
      - output.turn_on: onboard_led
    on_release:
      - output.turn_off: onboard_led

output:
  - id: onboard_led
    platform: gpio
    pin: 18
    inverted: false

remote_transmitter:
  id: ir_tx
  pin: 3
  carrier_duty_percent: 50%

remote_receiver:
  id: ir_rx
  pin:
    number: 19
    inverted: true
    mode:
      input: true
      pullup: true
  rmt_channel: 2
  dump: all


These are my notes tracing what pin did what:

GPIO0 has to be held low during power up to get into flash mode.

JP1 Pads (top)
1 - 3.3V
2 - RST
3 - TXD
4 - RXD
5 - IO0
6 - IO2
7 - GND

ESP32-C3 Antenna on Top / Looking at it from the Front (shield)
1- EN 16- TXD0
2- IO0 15- RXD0
3- IO2 14- IO19
4- IO1 13- IO18
5- IO3 12- IO9
6- IO4 11- IO8
7- IO5 10- IO10
8- VCC 9- GND

TEST POINTS
J1 GND
J2 5V
J3 3.3V
J4 LED
J5 IR RX
J6 IR TX
J7 Button

GPIO03 IR TX
GPIO05 Button
GPIO18 LED
GPIO19 IR RX

Thanks for that. I have successfully used cloudcutter on the CB3S module and have ESPHome on my device and it seems to work but still yet to get the basic remote_receiver component to detect any signals.

I have an ESP32C3-12 so may just do a module swap.

@gaz99 Are there any errors in the logs about the transmitter or receiver? I forget the details but I believe that one can only work on a specific resource and the other too so the order in which I have the tx and rx YAML matters as it appears to define what resources go to what. The external component takes care of the issue in part, but I think I still had issues until I inverted the IR rx and tx code. Check your pins too.

Have you tried tasmota on the esp32 c3?
I have an issue with sending irhvac commands (takes a few attempts to be received by the device)
No issues on esphome though

No, I have no other Tasmota devices and would like to stick to ESPHome. But I will convert one of the devices to an ESP just to troubleshoot the issue.

It could be that I just got crappy devices that don’t work, can’t expect much for AU$7 !!

Thanks for that, I have done a module swap for an ESP-C3-12F and it works using the external component.

I could not get LibreTiny on the CB3S module to do anything useful, it would only occasionally detect a pronto code where the C3 works well.

No to get the rest of it working with my Daikin AC.

@gaz99 - Once tx and rx work, all I did was press buttons on the remote pointed at the IR blaster and copy the logs into a text document notating which button I pressed. Once done, I simply copy pasted the commands into the YAML and it worked first try.

I know this is after the fact, but got this from Athom via AliExpress
https://www.aliexpress.com/item/1005005772315510.html?spm=a2g0o.order_list.order_list_main.258.4c2f1802Wqc4rR

Athom do Tasmota/ESPHome/Homekit/WLED devices pre-flashed, they also have some support for re-flashing with different protocols for the devices they make e.g. Tasmota ↔ ESPHome. I’ve not got round to actually installing this device yet, but I have got bulbs and plugs from them and they seem to be robust and well made.

1 Like