Main Content

Turn M5StickC Into Universal IR Remote (Home Automation)

Take a $9 M5StickC, few lines of YAML configuration to build ESPHome, Home Assistant and start controlling your TVs and climates in minutes.

In this project I document how I changed my Home Assistant setup replacing the Logitech Harmony Hub ($60) for a cheaper, smaller, and more versatile M5StickC ($9) with just ESPHome onboard and a few lines of YAML configuration.

The ingredients are:

A running Home Assistant instance (mine is on a RPi4)
The SmartIR custom component
An MQTT broker (mine is the mosquitto hassio addon)
An M5StickC
The configuration/source files of this project.

Due to the great ability of the ESPHome lib/firmware for templatable actions, I was able to setup the remote_transmitter component to translate generic JSON inputs into IR codes to transmit with just 16 lines of ESPHome YAML config.

So I built a firmware that acts as an MQTT->IR bridge, and that can run on a M5StickC (or a M5CameraF + grove IR transmitter), making it fully integrated with the smartir custom component of Home Assistant.

In this way I can set up several “media_player” or “climate” entities, with just the list of codes they support as commands.”

Link to article