Automate infrared devices
In Home Assistant
Introduction
With an infrared transmitter and receiver device, you can automate all your infrared controlled devices!
There are a lot of devices that have a remote which works via infrared. Like a TV, air conditioner, (ceiling) fans, fireplace, screens, lights and electric candles. The signal of an infrared remote has no encryption and is always the same. This makes it easy to capture, store and resend the signal.





Read further how you can create buttons, on your Home Assistant dashboard, to control your infrared devices.

NOTE: Also affiliate links are used on this page. You sponsor my work and still pay the original price.
Video
In this video, you see the device in action. I can control the lights via the original remote and also from my Home Assistant dashboard.
Smart infrared transmitter / receiver
I used for this project the Zigbee IR remote control - Moes (AliExpress)
|
UFO-R11
With this small black box, powered on batteries, you can control any infrared device.
An infrared sender needs to be in a direct line with the receiver. If you have more devices you want to control, it can be that you need multiple smart devices to control them all.
There are also similar WiFi versions available of this device.

You can set the device in learning mode to copy signals and store the signal on the device.
When you trigger the device with a code, it sends the stored signals but now from this box.
You can save a lot of signals on this box, each button on a remote and that for multiple remotes.
I used this solution also for my Christmas paper star, see my dedicated page about my automated Christmas lights and decorations.
Learning mode
There are multiple ways to set the device in learning mode to receive the IR codes: via the Zigbee2MQTT frontend, for example.
This device is also compatible with ZHA then you can set it also via a messages on a MQTT topic to learning mode.
Option 1: via Zigbee2MQTT
If the device is paired with Zigbee2MQTT, you can go to the frontend and in the Exposes
tab you can enable the learning mode.
When you point the original remote to the device, and press a single button, the code will be visible in the second row.
You can test the code by copy it to the input field and press the Enter
key, the device sends now the cloned signal.

Option 2: via MQTT
It’s also possible via MQTT.
To learn a new signal, set the device in learning mode by sending this payload to the MQTT topic of the device zigbee2mqtt/irremote/set
{
"learn_ir_code": "ON"
}
Now a LED light turned on in front of the device.
Now you can hold the original remote in front of the device and press a single button.
The response is sent to the MQTT topic zigbee2mqtt/irremote
and contains the infrared code.
You need this code to resend the signal via this same device.
{
"battery" : 11,
"last_seen" : "2024-11-03T09:21:03.343Z",
"learn_ir_code" : null,
"learned_ir_code" : "Bb8jphFIAuAXAQF9BuAVA0ABwCPgAwFAE0ABwAdAAUALwANAAUALCcqdvyPBCEgC///gAgcCCEgC",
"linkquality" : 43,
"voltage" : 1200
}
Resend signal
To resend the signal, send on the MQTT topic zigbee2mqtt/irremote/set
this payload to resend the same signal as sent from the original remote.
Make sure your signal is in line with the device because the infrared signal is an invisible light beam. My experience is that the signal can control devices still in a range of 5 meters. Because it works on batteries your free to position the device.
{
"ir_code_to_send": "Bb8jphFIAuAXAQF9BuAVA0ABwCPgAwFAE0ABwAdAAUALwANAAUALCcqdvyPBCEgC///gAgcCCEgC"
}
If all goes well, the device now also reacts on your box!
Now you can add also other buttons from the remote to the box and clone the signals of other remotes as well.
Now the fun continues to automation the commands! Turn the candles/fireplace on when you enter the room in the evening or whatever scenario you can think of! Enjoy home automation!
Home Assistant
From Home Assistant, you can create buttons on your dashboard and send a MQTT events with a specific copied IR signal to the IR device topic.

# Sourcecode by vdbrink.github.io
# Dashboard button card code
show_name: true
show_icon: true
type: button
tap_action:
action: perform-action
perform_action: mqtt.publish
data:
topic: zigbee2mqtt/irremote/set
payload: >-
{"ir_code_to_send":"BdsjmxFPAuAXAQF1BuAZA0ABQCfgAwHgAw/AC0AHwANAAUALCdma2yO3CE8C///gEgcCCE8C"}
name: Turn on
icon: mdi:candle
You can also create a script which contains the MQTT event and call this script from an automation.
For readability, I place it here direct on the dashboard as action for a button.

Hardware
These hardware devices are examples of what you need and can use in your own infrared automations.
Infrared transmitter / receiver
-
An few examples of Zigbee and WiFi devices which act as programmable infrared remotes.
They can learn signals from the original remote, and via WiFi or Zigbee you can resend the copied signal to simulate the press on the button via an automation. There are also devices that support RF signals as well.
I use in these examples the Zigbee Moes UFO-R11.
Infrared controlled devices
As mentioned in the introduction, there are a lot of devices that can be controlled via infrared. Here are some links to products which all work via infrared, and can be controlled via the above mentioned infrared transmitter / receiver.
LEDS
Light curtains
Tea lights
Candles
-
Candle lights controlled by an infrared remote
-
Candle lights controlled by an infrared remote
-
Long candle lights controlled by an infrared remote
Also, some Christmas decorations have an infrared remote, see my dedicated page how I used this project for it.
Physical stores
Where do you use the infrared transmitter / receiver for in your smart home?