Maker.io main logo

Turn M5StickC Into Universal IR Remote (Home Automation)

255

2020-06-29 | By M5Stack

License: General Public License

* Thanks to the project info and source code provided by @Alessandro Polselli

Hello everybody.

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

The ingredients are:

  • A running Home Assistant instance (mine is hass.io on a RPi4)
  • The SmartIR custom component
  • An MQTT broker (mine is the mosquitto hassio addon)
  • An M5StickC (or M5Atom, see UPDATE below)
  • 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.

The full Home Assistant configuration is here:

https://github.com/apolselli/home-assistant-config

UPDATE: You can even use a M5Atom (smaller, cheaper, + cool Led Matrix) for this project! For this device the YAML is here:

https://github.com/apolselli/home-assistant-config/blob/master/esphome/m5atom_ir.yaml

 

Mfr Part # K016-C
M5STICKC ESP32-PICO IOT DEV KIT
M5Stack Technology Co., Ltd.
More Info
View More Details
Mfr Part # C008-B
ATOM MATRIX ESP32 DEV KIT
M5Stack Technology Co., Ltd.
99,20 kr.
View More Details
Add all DigiKey Parts to Cart
Have questions or comments? Continue the conversation on TechForum, DigiKey's online community and technical resource.