Halloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan NowHalloween DealsAmazon USOctober picks are moving - compare before checkoutAmazon US: current deals, useful picks and tech finds.See Picks×
BETTESWORTHConstruction
ESPHome

Turn an Original M5StickC Into a Home Assistant IR Remote

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Yes—the original M5StickC can work as a compact, Wi-Fi-controlled infrared transmitter. Its onboard IR emitter is connected to GPIO9, so ESPHome can send commands to compatible televisions, soundbars, receivers, set-top boxes, fans, and many air conditioners.

There is one important limitation: the original M5StickC can transmit but cannot learn commands by itself. To capture signals from an existing remote, add an M5Stack Unit IR or another compatible IR receiver. For a new installation, use ESPHome’s native API and current IR components rather than copying the older MQTT-and-SmartIR design unchanged.

As an Amazon Associate I earn from qualifying purchases.

What this project builds

The result is a network-connected IR blaster, not a universal replacement for every smart-home remote or protocol:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Home Assistant
      │ Wi-Fi / ESPHome API (or MQTT)
      ▼
ESPHome on original M5StickC
      │
      ▼
IR LED on GPIO9 ─────► TV, soundbar, receiver, fan or AC

Home Assistant creates or triggers an action. ESPHome receives it, and the M5StickC emits a modulated infrared signal. The appliance responds only when the code is correct and the signal reaches its IR receiver.

#1 Best Overall
ESP-WROOM-32 ESP32 ESP-32S Development Board 2.4GHz Dual-Mode WiFi + Bluetooth Dual Cores Microcontroller Processor Integrated with Antenna RF AMP Filter AP STA Compatible with Arduino IDE (3PCS)
  • 2.4GHz Dual Mode WiFi + Bluetooth Development Board
  • Support LWIP protocol, Freertos
  • SupportThree Modes: AP, STA, and AP+STA
  • Ultra-Low power consumption, Compatible with Arduino IDE
  • ESP32 is a safe, reliable, and scalable to a variety of applications

IR control does not directly operate Zigbee, Z-Wave, Bluetooth, Wi-Fi, cloud-controlled or proprietary RF devices. A remote that looks like an ordinary handheld remote may use radio rather than infrared, particularly for devices that work through walls or without pointing at the appliance.

Home Assistant’s Infrared integration describes the general adapter-and-device architecture. ESPHome can provide the adapter, while device-specific commands are defined in ESPHome, Home Assistant, or a compatible integration.

Original project versus a modern setup

The project commonly associated with this title was published on Hackster in 2019 and republished by DigiKey/M5Stack on June 29, 2020. It combined:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • Home Assistant
  • ESPHome firmware
  • MQTT, commonly Mosquitto
  • The SmartIR custom component
  • Device-specific IR code databases

That approach can still be useful when maintaining an existing installation. SmartIR created appliance-oriented Home Assistant entities such as media_player and climate, while MQTT carried commands to the ESPHome device. The original walkthrough is available from DigiKey/M5Stack.

For a new build, the simpler starting point is usually the ESPHome native API with remote_transmitter. If you need runtime learning and replay, ESPHome’s IR/RF proxy is the more current architecture to investigate. It is designed for transmission, reception, learning and replay through Home Assistant without recompiling firmware for every new command.

Hardware and prerequisites

Transmitter-only build

  • The original M5StickC, not automatically a StickC Plus or StickC Plus2
  • USB power
  • A Wi-Fi network
  • A working Home Assistant installation
  • ESPHome
  • An IR-controlled appliance and its remote, if you need to identify commands

The M5StickC is an older ESP32-PICO-based product with an integrated IR transmitter. Its official product information is on the M5Stack product page.

Build that can learn commands

Add the M5Stack Unit IR. It combines a 940-nm IR emitter with a 38-kHz demodulating receiver and connects through Grove HY2.0-4P. M5Stack documents an effective range of up to approximately 5 meters for the Unit IR.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
ELEGOO 3PCS ESP-32 Dev Boards, ESP-WROOM-32, USB-C, WiFi Bluetooth 4.2 | Low-power IoT Applications, Smart Devices, Automation, Wireless Communication, GPIO Headers, Simplifying Development
  • Dual-Core Performance Up to 240 MHz: Run sensor processing, wireless communication, automation logic and connected-device tasks on a 32-bit dual-core ESP32 platform designed for responsive embedded and IoT projects
  • Built-in Wi-Fi and Bluetooth 4.2: Connect to 2.4 GHz Wi-Fi networks or use Bluetooth Classic and BLE for wireless sensors, smart devices, remote controls, home automation and other connected projects
  • Flexible Power-Saving Modes: ESP32 power-management features support dynamic clock scaling and low-power operating modes, helping developers reduce energy use in compatible sensing, monitoring and connected-device applications, suitable for battery-powered Internet of Things (IoT) devices.
  • USB-C Programming with CP2102: Connect through USB-C for power, sketch uploads and serial monitoring, while GPIO, UART, SPI and I2C interfaces support sensors, displays, motor drivers and other modules (USB-C cable not included)
  • Over-the-Air Update Support: Configure OTA functionality through a compatible ESP-32 software framework to update deployed firmware over Wi-Fi without reconnecting the board by USB for every revision

The Unit IR is not standalone: it requires a compatible M5Stack controller such as the M5StickC. Its Grove signals are:

Signal Function
GND Ground
5V Power
IR_TX Transmit
IR_RX Receive

Do not assume the same GPIO numbers on newer M5Stack boards. M5Stack’s Home Assistant documentation warns that pin assignments vary by controller and connection.

Fast path: configure the onboard transmitter

In ESPHome, create a device for the original M5StickC and start with a configuration like this:

esphome:
  name: m5stickc-ir
  friendly_name: M5StickC IR

esp32:
  board: m5stick-c
  framework:
    type: arduino

logger:

api:

ota:
  - platform: esphome

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

remote_transmitter:
  pin: GPIO9
  carrier_duty_percent: 50%

The device-specific setting is the transmitter pin:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
remote_transmitter:
  pin: GPIO9
  carrier_duty_percent: 50%

GPIO9 applies to the original M5StickC configuration. Check the current ESPHome board support and OTA syntax for the version installed on your system; ESPHome configuration formats change over time. The remote transmitter documentation is the authoritative reference for the installed release.

Flash and add the device

  1. Open ESPHome in Home Assistant or use your normal ESPHome dashboard.
  2. Create the YAML configuration and replace the Wi-Fi secrets.
  3. Validate and compile it.
  4. Connect the M5StickC by USB for its first flash.
  5. After it joins Wi-Fi, add it to Home Assistant through the ESPHome integration when prompted.
  6. Keep the M5StickC powered and point its IR emitter toward the appliance.

At this stage the device is an IR transmitter, but it has no useful command until you supply a protocol code or captured timing sequence.

Send a known protocol command

Do not invent an IR code. Obtain one from the appliance documentation, a suitable IR code database, an existing Home Assistant integration, or a capture from the original remote.

Rank #3
Sale
ELEGOO ESP-32 Super Starter Kit with Tutorial Compatible with Arduino IDE | Development Board, USB-C Dual Core Microcontroller Support AP/STA/AP+STA, CP2102 Chip, WiFi, Bluetooth, 200+ parts for IoT
  • Powerful ESP-32 Board: Unlock the world of Internet of Things (IoT) and advanced electronics with the heart of this kit: the ESP-32 board. It features a powerful dual-core processor, integrated Wi-Fi and Bluetooth 4.2, making it perfect for building connected, smart devices that communicate with your phone or the cloud. It's fully compatible with the Arduino IDE for easy programming.
  • Super Starter Kit: This kit contains over 35 different modules and electronic components, including sensors, displays, motors, and input devices. From LEDs and buttons to an OLED screen, servo motor, and keypad, you have everything needed to explore a vast range of projects in one box.
  • Step by Step Online Tutorial: Jump right in with our detailed, beginner-friendly tutorial. Access 30+ projects with complete code, clear circuit diagrams, and step-by-step instructions. Learn the fundamentals of electronics, coding, and how to utilize the ESP-32's unique capabilities without any prior experience.
  • Hands-on Learning for All Skill Levels: Perfect for students, makers, engineers, and hobbyists. Start with basic circuits and coding, then progress to intermediate and advanced IoT applications. Build practical projects like weather stations, smart home controllers, remote-controlled devices, and interactive gadgets. The skills you learn are the foundation for real-world innovation.
  • Quality & Great Support: Elegoo is committed to quality. We provide a clear, detailed tutorial guide, refined code, and a well-organized component kit. All modules are carefully selected for reliability and ease of use. Our dedicated technical support team and active online community are ready to help you succeed in your learning journey.

This is a syntax template only; the address and command are deliberately placeholders:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
button:
  - platform: template
    name: "Send Power"
    on_press:
      - remote_transmitter.transmit_nec:
          address: 0x0000
          command: 0x0000

Replace the values with the actual code and use the correct ESPHome action for the protocol. Protocol names, fields and action syntax should be checked against the current ESPHome documentation.

For signals that do not map cleanly to a supported protocol, replay the captured raw timings:

on_press:
  - remote_transmitter.transmit_raw:
      code: [9000, -4500, 560, -560]

The timings above are not a complete command. They illustrate the format only. A working raw command must come from the target remote.

Learn an unknown remote with Unit IR

Connect the Unit IR to the appropriate Grove port and add a receiver block. The GPIO below is intentionally shown as a placeholder because the correct receive pin depends on the exact controller and port:

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
remote_receiver:
  pin: GPIOXX
  dump: all

Use the pin mapping for your exact M5StickC and Grove connection. Do not copy a GPIO number from a different Stick-series model.

The learning workflow is:

  1. Flash the receiver-enabled firmware.
  2. Open the ESPHome device logs.
  3. Point the original remote at the Unit IR receiver.
  4. Press one button several times, holding the remote at a consistent distance.
  5. Record any decoded protocol and the raw timing output.
  6. Create a transmitter action using the decoded or raw result.
  7. Reflash the firmware, or use the IR/RF proxy approach for runtime learning and replay.
  8. Test from the intended operating position.

ESPHome’s remote receiver documentation and its RMT setup guide explain receiver output, protocol decoding and replay more fully.

Rank #4
ESP-WROOM-32 ESP32 ESP-32S Development Board 2.4GHz Dual-Mode WiFi + Bluetooth Dual Cores Microcontroller Processor Integrated with Antenna RF AMP Filter AP STA Compatible with Arduino IDE (1 PCS)
  • 2.4GHz Dual Mode WiFi + Bluetooth Development Board
  • Support LWIP protocol, Freertos;ESP32 is a safe, reliable, and scalable to a variety of applications
  • SupportThree Modes: AP, STA, and AP+STA
  • Ultra-Low power consumption, Compatible with Arduino IDE
  • 1PCS 30Pin ESP32 Development Board 2.4GHz WiFi Dual Cores Microcontroller Integrated with Antenna RF Low Noise Amplifiers Filters

Expose useful controls in Home Assistant

With the ESPHome API connected, you can expose ESPHome buttons, switches or scripts and use them in dashboards and automations. For example, a TV power button can be represented by an ESPHome template button and then placed on a Home Assistant dashboard.

You can also call the device action from a Home Assistant script or automation. A typical design is:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • A button for power and input selection
  • Separate buttons for volume up, volume down and mute
  • A script that sends a sequence of commands, such as selecting an input and starting playback
  • An automation that sends an IR command when another Home Assistant event occurs

IR is generally one-way. Home Assistant can send “power on,” but it normally cannot confirm that the appliance changed state. Avoid treating an IR switch as authoritative state unless you have a separate sensor or a carefully managed assumption.

Why air conditioners are different

Television and audio remotes often send discrete commands such as power, volume or input. Many air-conditioner remotes instead transmit the complete desired state in one message: power, mode, temperature, fan speed and swing position.

That makes AC control more sensitive to the exact model and protocol. Capturing a single “power” press may not be enough, and the displayed Home Assistant state can drift from the physical unit if someone also uses the handheld remote.

M5Stack’s Home Assistant examples include device-specific IR climate platforms such as Coolix and Midea. Treat those as protocol-specific examples, not proof that every air conditioner will work with the same configuration.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Placement and range

Place the M5StickC where its emitter faces the appliance, with a clear path. Walls, cabinet doors, tinted glass, bright sunlight, distance and poor orientation can all cause missed commands.

Best Value
HiLetgo ESP-WROOM-32 ESP32 ESP-32S Development Board 2.4GHz Dual-Mode WiFi + Bluetooth Dual Cores Microcontroller Processor Integrated with Antenna RF AMP Filter AP STA for Arduino IDE
  • 2.4GHz Dual Mode WiFi + Bluetooth Development Board
  • Ultra-Low power consumption, works perfectly with the Arduino IDE
  • Support LWIP protocol, Freertos
  • SupportThree Modes: AP, STA, and AP+STA
  • ESP32 is a safe, reliable, and scalable to a variety of applications

The approximately 5-meter specification belongs to the Unit IR, not necessarily to the M5StickC’s onboard emitter. Treat the onboard LED as a short-range, line-of-sight transmitter rather than a whole-room omnidirectional blaster. If you need cabinet operation, wide coverage or highly reliable whole-room control, a purpose-built IR hub may be a better fit.

Historical MQTT and SmartIR compatibility path

If you are reproducing the original project, retain its general architecture: MQTT carries commands, ESPHome bridges those commands to the IR LED, and SmartIR supplies device-oriented Home Assistant entities and code databases.

This remains a reasonable compatibility route for an existing system, but it adds moving parts:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • An MQTT broker and topic configuration
  • A custom SmartIR component
  • Device database coverage for the exact appliance
  • Potential YAML changes caused by newer Home Assistant and ESPHome releases

The original project’s claim that the setup required only a few lines described the author’s existing environment. It is not a guarantee that a new user will have the same result today. For a new installation, compare it with native ESPHome API entities, Home Assistant’s current infrared layer, and ESPHome’s runtime proxy.

What the M5StickC cannot do

  • Guarantee compatibility with every IR appliance or protocol
  • Control Zigbee, Z-Wave, Bluetooth, Wi-Fi, cloud or RF devices simply because they have a remote
  • Learn commands using the original M5StickC alone
  • Reliably transmit through walls or closed cabinets
  • Provide two-way confirmation that an appliance changed state
  • Reliably reproduce rolling-code systems or remotes whose command changes on every press

ESPHome’s RMT guidance distinguishes ordinary IR from RF and discusses rolling-code limitations; see the RMT setup guide.

Troubleshooting

Nothing transmits

  • Confirm that the board is the original M5StickC and that GPIO9 is correct.
  • Check that the device is online in ESPHome and Home Assistant.
  • Verify the protocol, address, command and carrier settings.
  • Remove anything blocking the IR LED.
  • Move the M5StickC closer and aim it directly at the appliance.

The receiver captures nothing

  • Check the Unit IR cable and Grove port.
  • Verify the receive GPIO for the exact board and port.
  • Confirm that dump: all is enabled and logs are open.
  • Aim the original remote at the receiver and try a short distance.
  • Confirm that the handheld remote uses IR rather than RF or Bluetooth.

Power works but other buttons fail

This usually points to a wrong protocol variant, incorrect address or command bit order, incomplete raw timings, or a command that requires a particular repeat behavior. Capture the failing button again rather than assuming every button uses the same format.

The television works but the air conditioner does not

Check the exact AC model and protocol, and capture a complete state message. AC commands commonly encode more than a single button press, so a television-style power-button workflow may not apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Which route should you choose?

Need Best fit
You already own an original M5StickC and know the codes Use the onboard GPIO9 transmitter
You need to learn an existing remote Add M5Stack Unit IR
You want runtime learning and replay Evaluate ESPHome IR/RF proxy
You are maintaining the original tutorial Keep MQTT and SmartIR, checking compatibility with current releases
You need whole-room coverage or cabinet operation Consider a purpose-built or commercial IR hub

The Unit IR is the most direct upgrade because it solves the original board’s biggest limitation: the lack of a receiver. M5Stack displayed a price of $3.95 when checked on August 18, 2026, but price and stock are volatile. The historical “$9 M5StickC” figure belongs to the original project and should not be treated as a current price.

If buying new hardware, confirm the board generation, ESPHome support, GPIO mapping, power arrangement and availability first. A newer M5Stack controller plus Unit IR may be a better long-term purchase than an older original M5StickC, but it will not necessarily use the same board definition or pin assignments.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.